Bayonne
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | Friends

ost::BayonneSpan Class Reference

A span is a collection of ports under a single control interface or communication channel, such as a T1/E1/PRI/BRI span. More...

#include <bayonne.h>

Inheritance diagram for ost::BayonneSpan:
ost::Bayonne

List of all members.

Public Member Functions

 BayonneSpan (BayonneDriver *driver, timeslot_t timeslots)
 Create a span for a specified number of timeslots.
BayonneSessiongetTimeslot (timeslot_t id)
 Get the session associated with the nth timeslot of the span.
timeslot_t getFirst (void)
 Get the first server timeslot of this span.
timeslot_t getCount (void)
 Return total number of server timeslots in this span.
unsigned getId (void)
 Get the id associated with this span.
BayonneDrivergetDriver (void)
 Get driver associated with this span.
unsigned getAvail (void)
 Get number of call slots still available.

Static Public Member Functions

static BayonneSpanget (unsigned id)
 Get a span by a global span id.
static void allocate (unsigned total=0)
 Allocate the total number of spans this server will support.
static unsigned getSpans (void)
 Return total spans in use.

Public Attributes

Traffic call_attempts
Traffic call_complete
volatile unsigned short active_calls

Protected Attributes

unsigned id
BayonneDriverdriver
BayonneSpannext
timeslot_t timeslot
timeslot_t count
timeslot_t used

Static Protected Attributes

static BayonneSpanfirst
static BayonneSpanlast
static unsigned spans
static BayonneSpan ** index

Friends

class __EXPORT BayonneSession
class __EXPORT BayonneDriver

Detailed Description

A span is a collection of ports under a single control interface or communication channel, such as a T1/E1/PRI/BRI span.

Author:
David Sugar <dyfet@gnutelephony.org> Span management object.

Constructor & Destructor Documentation

ost::BayonneSpan::BayonneSpan ( BayonneDriver driver,
timeslot_t  timeslots 
)

Create a span for a specified number of timeslots.

Parameters:
driverassociated with span.
timeslotsthis span covers.

Member Function Documentation

static void ost::BayonneSpan::allocate ( unsigned  total = 0) [static]

Allocate the total number of spans this server will support.

Parameters:
totalspan count.
static BayonneSpan* ost::BayonneSpan::get ( unsigned  id) [static]

Get a span by a global span id.

Parameters:
idof span.
Returns:
span object associated with id.
unsigned ost::BayonneSpan::getAvail ( void  ) [inline]

Get number of call slots still available.

Returns:
count of call slots available.
timeslot_t ost::BayonneSpan::getCount ( void  ) [inline]

Return total number of server timeslots in this span.

Returns:
server timeslot count.
BayonneDriver* ost::BayonneSpan::getDriver ( void  ) [inline]

Get driver associated with this span.

Returns:
driver object for span.
timeslot_t ost::BayonneSpan::getFirst ( void  ) [inline]

Get the first server timeslot of this span.

Returns:
first server timeslot.
unsigned ost::BayonneSpan::getId ( void  ) [inline]

Get the id associated with this span.

Returns:
global id of this span object.
static unsigned ost::BayonneSpan::getSpans ( void  ) [inline, static]

Return total spans in use.

Returns:
total spans in use.
BayonneSession* ost::BayonneSpan::getTimeslot ( timeslot_t  id)

Get the session associated with the nth timeslot of the span.

Parameters:
idof nth timeslot of span.
Returns:
associated session object.

Friends And Related Function Documentation

friend class __EXPORT BayonneDriver [friend]
friend class __EXPORT BayonneSession [friend]

Member Data Documentation

volatile unsigned short ost::BayonneSpan::active_calls
BayonneSpan* ost::BayonneSpan::first [static, protected]
unsigned ost::BayonneSpan::id [protected]
BayonneSpan** ost::BayonneSpan::index [static, protected]
BayonneSpan* ost::BayonneSpan::last [static, protected]
unsigned ost::BayonneSpan::spans [static, protected]

The documentation for this class was generated from the following file: