Yate
SignallingCircuitGroup Class Reference

Group of data circuits used by signalling. More...

#include <yatesig.h>

Inheritance diagram for SignallingCircuitGroup:
SignallingComponent Mutex RefObject DebugEnabler Lockable GenObject AnalogLineGroup

Public Types

enum  Strategy {
  Other = 0 , Increment = 0x0001 , Decrement = 0x0002 , Lowest = 0x0003 ,
  Highest = 0x0004 , Random = 0x0005 , OnlyEven = 0x1000 , OnlyOdd = 0x2000 ,
  Fallback = 0x4000
}
 

Public Member Functions

 SignallingCircuitGroup (unsigned int base=0, int strategy=Increment, const char *name="circgroup")
 
virtual ~SignallingCircuitGroup ()
 
unsigned int count () const
 
unsigned int base () const
 
unsigned int last () const
 
int strategy () const
 
void setStrategy (int strategy)
 
ObjListcircuits ()
 
void getCicList (String &dest)
 
bool insert (SignallingCircuit *circuit)
 
void remove (SignallingCircuit *circuit)
 
SignallingCircuitSpanbuildSpan (const String &name, unsigned int start=0, NamedList *params=0)
 
bool insertSpan (SignallingCircuitSpan *span)
 
void insertRange (SignallingCircuitSpan *span, const char *name, int strategy=-1)
 
void insertRange (const String &range, const char *name, int strategy=-1)
 
void removeSpan (SignallingCircuitSpan *span, bool delCics=true, bool delSpan=false)
 
void removeSpanCircuits (SignallingCircuitSpan *span)
 
SignallingCircuitfind (unsigned int cic, bool local=false)
 
SignallingCircuitRangefindRange (const char *name)
 
SignallingCircuit::Status status (unsigned int cic)
 
bool status (unsigned int cic, SignallingCircuit::Status newStat, bool sync=false)
 
SignallingCircuitreserve (int checkLock=-1, int strategy=-1, SignallingCircuitRange *range=0)
 
SignallingCircuitreserve (const String &list, bool mandatory, int checkLock=-1, int strategy=-1, SignallingCircuitRange *range=0)
 
bool release (SignallingCircuit *cic, bool sync=false)
 
- Public Member Functions inherited from SignallingComponent
virtual ~SignallingComponent ()
 
virtual const StringtoString () const
 
virtual bool initialize (const NamedList *config)
 
virtual bool control (NamedList &params)
 
virtual NamedListcontrolCreate (const char *oper=0)
 
virtual bool controlExecute (NamedList *params)
 
virtual void engine (SignallingEngine *eng)
 
SignallingEngineengine () const
 
int debugLevel (int level)
 
const StringcomponentType () const
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from DebugEnabler
 DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
 
int debugLevel () const
 
int debugLevel (int level)
 
bool debugEnabled () const
 
void debugEnabled (bool enable)
 
const char * debugName () const
 
bool debugAt (int level) const
 
bool debugChained () const
 
void debugChain (const DebugEnabler *chain=0)
 
void debugCopy (const DebugEnabler *original=0)
 
- Public Member Functions inherited from Mutex
 Mutex (bool recursive=false, const char *name=0)
 
 Mutex (const Mutex &original)
 
 ~Mutex ()
 
Mutexoperator= (const Mutex &original)
 
virtual bool lock (long maxwait=-1)
 
virtual bool unlock ()
 
virtual bool locked () const
 
const char * owner () const
 
bool recursive () const
 
- Public Member Functions inherited from Lockable
virtual ~Lockable ()
 
virtual bool check (long maxwait=-1)
 
virtual bool unlockAll ()
 

Static Public Member Functions

static int str2strategy (const char *name, int def=Increment)
 
- Static Public Member Functions inherited from SignallingComponent
static bool resolveConfig (const String &cmpName, NamedList &params, const NamedList *config)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Static Public Member Functions inherited from Mutex
static int count ()
 
static int locks ()
 
static bool efficientTimedLock ()
 
- Static Public Member Functions inherited from Lockable
static void wait (unsigned long maxwait)
 
static unsigned long wait ()
 
static void startUsingNow ()
 
static void enableSafety (bool safe=true)
 
static bool safety ()
 

Static Public Attributes

static const TokenDict s_strategy []
 

Protected Member Functions

virtual void destroyed ()
 
- Protected Member Functions inherited from SignallingComponent
 SignallingComponent (const char *name=0, const NamedList *params=0, const char *type="unknown")
 
void insert (SignallingComponent *component)
 
virtual void detach ()
 
virtual void timerTick (const Time &when)
 
void setName (const char *name)
 
void setCompType (const char *type)
 
unsigned long tickSleep (unsigned long usec=1000000) const
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
- Protected Member Functions inherited from DebugEnabler
void debugName (const char *name)
 

Friends

class SignallingCircuit
 
class SignallingCallControl
 
class SS7ISUP
 
class ISDNQ931
 

Detailed Description

Group of data circuits used by signalling.

Interface to a stateful group of voice/data circuits

Member Enumeration Documentation

◆ Strategy

enum Strategy

Circuit allocation strategy

Constructor & Destructor Documentation

◆ SignallingCircuitGroup()

SignallingCircuitGroup ( unsigned int base = 0,
int strategy = Increment,
const char * name = "circgroup" )

Constructor, creates a group with a specific base code

Parameters
baseBase of identification codes for this group
strategyDefault strategy used for circuit allocation
nameName of this component

References base(), and strategy().

◆ ~SignallingCircuitGroup()

virtual ~SignallingCircuitGroup ( )
virtual

Destructor

Member Function Documentation

◆ base()

unsigned int base ( ) const
inline

Get the base of identification codes for this group

Returns
Base of identification codes for this group

Referenced by SignallingCircuitGroup().

◆ buildSpan()

SignallingCircuitSpan * buildSpan ( const String & name,
unsigned int start = 0,
NamedList * params = 0 )

Create a circuit span using the factory

Parameters
nameName of the span to create
startDesired start of circuit codes in span
paramsOptional parameters for creation of span and circuits
Returns
Pointer to new circuit span or NULL on failure

◆ circuits()

ObjList & circuits ( )
inline

Get the circuit list

◆ count()

unsigned int count ( ) const
inline

Get the number of circuits in this group

Returns
The number of circuits owned by this group

◆ destroyed()

virtual void destroyed ( )
inlineprotectedvirtual

Remove all spans and circuits. Release object

Reimplemented from SignallingComponent.

Reimplemented in AnalogLineGroup.

References SignallingComponent::destroyed().

◆ find()

SignallingCircuit * find ( unsigned int cic,
bool local = false )

Find a specific circuit by its identification code

Parameters
cicCircuit Identification Code
localInterpret the cic parameter as group-local code
Returns
Pointer to circuit or NULL if not found

◆ findRange()

SignallingCircuitRange * findRange ( const char * name)

Find a range of circuits owned by this group

Parameters
nameThe range name to find
Returns
Pointer to circuit range or 0 if not found

◆ getCicList()

void getCicList ( String & dest)

Create a comma separated list with this group's circuits

Parameters
destThe destination string

◆ insert()

bool insert ( SignallingCircuit * circuit)

Insert a circuit in the group

Parameters
circuitPointer to the circuit to insert
Returns
False if a circuit with the same code already exists

◆ insertRange() [1/2]

void insertRange ( const String & range,
const char * name,
int strategy = -1 )

Build and insert a range contained in a string. See parseUIntArray() for the format of the string range

Parameters
rangeString used to build the range
nameRange name
strategyStrategy used to allocate circuits from the new range, -1 to use group's strategy

References strategy().

◆ insertRange() [2/2]

void insertRange ( SignallingCircuitSpan * span,
const char * name,
int strategy = -1 )

Build and insert a range from circuits belonging to a given span

Parameters
spanSpan to find
nameRange name or 0 to use span's id
strategyStrategy used to allocate circuits from the new range, -1 to use group's strategy

References strategy().

◆ insertSpan()

bool insertSpan ( SignallingCircuitSpan * span)

Insert a circuit span in the group

Parameters
spanPointer to the circuit span to insert
Returns
False on failure

◆ last()

unsigned int last ( ) const
inline

Get the maximum of identification codes for this group

Returns
The maximum of identification codes for this group

◆ release()

bool release ( SignallingCircuit * cic,
bool sync = false )
inline

Initiate a release of a circuit

Parameters
cicCircuit to release
syncSynchronous release requested
Returns
True if the circuit release was initiated

References SignallingCircuit::status().

◆ remove()

void remove ( SignallingCircuit * circuit)

Remove a circuit from the group

Parameters
circuitPointer to the circuit to remove

◆ removeSpan()

void removeSpan ( SignallingCircuitSpan * span,
bool delCics = true,
bool delSpan = false )

Remove a circuit span from the group

Parameters
spanPointer to the circuit span to remove
delCicsTrue to delete signalling circuits associated to the span
delSpanTrue to delete the span

◆ removeSpanCircuits()

void removeSpanCircuits ( SignallingCircuitSpan * span)

Remove signalling circuits associated to the given span

Parameters
spanPointer to the circuit span whose circuits will be removed

◆ reserve() [1/2]

SignallingCircuit * reserve ( const String & list,
bool mandatory,
int checkLock = -1,
int strategy = -1,
SignallingCircuitRange * range = 0 )

Reserve a circuit for later use

Parameters
listComma separated list of circuits
mandatoryThe list is mandatory. If false and none of the circuits in the list are available, try to reserve a free one
checkLockLock flags to check. If the given lock flags are set, reservation will fail
strategyStrategy used for allocation if failed to allocate one from the list, use group default if negative
rangeRange of circuits to allocate from. 0 to use group default
Returns
Referenced pointer to a reserved circuit or 0 on failure

References strategy().

◆ reserve() [2/2]

SignallingCircuit * reserve ( int checkLock = -1,
int strategy = -1,
SignallingCircuitRange * range = 0 )

Reserve a circuit for later use

Parameters
checkLockLock flags to check. If the given lock flags are set, reservation will fail
strategyStrategy used for allocation, use group default if negative
rangeRange of circuits to allocate from. 0 to use group default
Returns
Referenced pointer to a reserved circuit or 0 on failure

References strategy().

◆ setStrategy()

void setStrategy ( int strategy)
inline

Set the circuit allocation strategy

Parameters
strategyThe new circuit allocation strategy

References Mutex::lock(), and strategy().

◆ status() [1/2]

SignallingCircuit::Status status ( unsigned int cic)

Get the status of a circuit

Parameters
cicCircuit Identification Code
Returns
Enumerated status of circuit

◆ status() [2/2]

bool status ( unsigned int cic,
SignallingCircuit::Status newStat,
bool sync = false )

Initiate a circuit status transition

Parameters
cicCircuit Identification Code
newStatDesired new status
syncSynchronous status change requested
Returns
True if status change has been initiated

◆ str2strategy()

static int str2strategy ( const char * name,
int def = Increment )
inlinestatic

Get the strategy value associated with a given name

Parameters
nameStrategy name whose value we want to obtain
defValue to return if not found
Returns
The requested strategy value or the default one

References s_strategy.

◆ strategy()

int strategy ( ) const
inline

Get the circuit allocation strategy

Returns
Strategy flags ORed together

Referenced by insertRange(), insertRange(), reserve(), reserve(), setStrategy(), and SignallingCircuitGroup().

Member Data Documentation

◆ s_strategy

const TokenDict s_strategy[]
static

Keep the strategy names

Referenced by str2strategy().


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