# class SignallingCircuitGroup | Group of data circuits used by signalling. More...
Full name | `TelEngine::SignallingCircuitGroup`
Definition | `#include <libs/ysig/yatesig.h>`
Inherits | TelEngine::Mutex [public ], TelEngine::SignallingComponent [public ]
Inherited by | AnalogLineGroup
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

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

#### Public Methods

- SignallingCircuitGroup (unsigned int base = 0, int strategy = Increment, const char* name = "circgroup")
- virtual ~SignallingCircuitGroup ()
- inline unsigned int count () const
- inline unsigned int base () const
- inline unsigned int last () const
- inline int strategy () const
- inline void setStrategy (int strategy)
- inline ObjList& circuits ()
- void getCicList (String& dest)
- bool insert (SignallingCircuit* circuit)
- void remove (SignallingCircuit* circuit)
- SignallingCircuitSpan* buildSpan (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)
- SignallingCircuit* find (unsigned int cic, bool local = false)
- SignallingCircuitRange* findRange (const char* name)
- SignallingCircuit::Status status (unsigned int cic)
- bool status (unsigned int cic, SignallingCircuit::Status newStat, bool sync = false)
- SignallingCircuit* reserve (int checkLock = -1, int strategy = -1, SignallingCircuitRange* range = 0)
- SignallingCircuit* reserve (const String& list, bool mandatory, int checkLock = -1, int strategy = -1, SignallingCircuitRange* range = 0)
- inline bool release (SignallingCircuit* cic, bool sync = false)

#### Public Static Methods

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

#### Public Members

- static const TokenDict s_strategy[]

#### Protected Methods

- virtual void destroyed ()

## Detailed Description

Interface to a stateful group of voice/data circuits

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

Circuit allocation strategy

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

Constructor, creates a group with a specific base code

Parameters:

base | Base of identification codes for this group
strategy | Default strategy used for circuit allocation
name | Name of this component

~SignallingCircuitGroup () | ### ~SignallingCircuitGroup

[virtual]

Destructor

inline unsigned int count () | ### count

[const]

Get the number of circuits in this group

Returns: The number of circuits owned by this group

Reimplemented from Mutex.

inline unsigned int base () | ### base

[const]

Get the base of identification codes for this group

Returns: Base of identification codes for this group

inline unsigned int last () | ### last

[const]

Get the maximum of identification codes for this group

Returns: The maximum of identification codes for this group

inline int strategy () | ### strategy

[const]

Get the circuit allocation strategy

Returns: Strategy flags ORed together

inline void setStrategy (int strategy) | ### setStrategy

Set the circuit allocation strategy

Parameters:

strategy | The new circuit allocation strategy

inline ObjList& circuits () | ### circuits

Get the circuit list

void getCicList (String& dest) | ### getCicList

Create a comma separated list with this group's circuits

Parameters:

dest | The destination string

bool insert (SignallingCircuit* circuit) | ### insert

Insert a circuit in the group

Parameters:

circuit | Pointer to the circuit to insert

Returns: False if a circuit with the same code already exists

Reimplemented from SignallingComponent.

void remove (SignallingCircuit* circuit) | ### remove

Remove a circuit from the group

Parameters:

circuit | Pointer to the circuit to remove

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

Create a circuit span using the factory

Parameters:

name | Name of the span to create
start | Desired start of circuit codes in span
params | Optional parameters for creation of span and circuits

Returns: Pointer to new circuit span or NULL on failure

bool insertSpan (SignallingCircuitSpan* span) | ### insertSpan

Insert a circuit span in the group

Parameters:

span | Pointer to the circuit span to insert

Returns: False on failure

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

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

Parameters:

span | Span to find
name | Range name or 0 to use span's id
strategy | Strategy used to allocate circuits from the new range, -1 to use group's strategy

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

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

Parameters:

range | String used to build the range
name | Range name
strategy | Strategy used to allocate circuits from the new range, -1 to use group's strategy

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

Remove a circuit span from the group

Parameters:

span | Pointer to the circuit span to remove
delCics | True to delete signalling circuits associated to the span
delSpan | True to delete the span

void removeSpanCircuits (SignallingCircuitSpan* span) | ### removeSpanCircuits

Remove signalling circuits associated to the given span

Parameters:

span | Pointer to the circuit span whose circuits will be removed

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

Find a specific circuit by its identification code

Parameters:

cic | Circuit Identification Code
local | Interpret the cic parameter as group-local code

Returns: Pointer to circuit or NULL if not found

SignallingCircuitRange* findRange (const char* name) | ### findRange

Find a range of circuits owned by this group

Parameters:

name | The range name to find

Returns: Pointer to circuit range or 0 if not found

SignallingCircuit::Status status (unsigned int cic) | ### status

Get the status of a circuit

Parameters:

cic | Circuit Identification Code

Returns: Enumerated status of circuit

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

Initiate a circuit status transition

Parameters:

cic | Circuit Identification Code
newStat | Desired new status
sync | Synchronous status change requested

Returns: True if status change has been initiated

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

Reserve a circuit for later use

Parameters:

checkLock | Lock flags to check. If the given lock flags are set, reservation will fail
strategy | Strategy used for allocation, use group default if negative
range | Range of circuits to allocate from. 0 to use group default

Returns: Referenced pointer to a reserved circuit or 0 on failure

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

Reserve a circuit for later use

Parameters:

list | Comma separated list of circuits
mandatory | The list is mandatory. If false and none of the circuits in the list are available, try to reserve a free one
checkLock | Lock flags to check. If the given lock flags are set, reservation will fail
strategy | Strategy used for allocation if failed to allocate one from the list, use group default if negative
range | Range of circuits to allocate from. 0 to use group default

Returns: Referenced pointer to a reserved circuit or 0 on failure

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

Initiate a release of a circuit

Parameters:

cic | Circuit to release
sync | Synchronous release requested

Returns: True if the circuit release was initiated

int str2strategy (const char* name, int def = Increment) | ### str2strategy

[static]

Get the strategy value associated with a given name

Parameters:

name | Strategy name whose value we want to obtain
def | Value to return if not found

Returns: The requested strategy value or the default one

static const TokenDict s_strategy[] | ### s_strategy[]

void destroyed () | ### destroyed

[protected virtual]

Remove all spans and circuits. Release object

Reimplemented from SignallingComponent.

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.