|
Yate
|
Abstract data circuit used by signalling. More...
#include <yatesig.h>
Public Types | |
| enum | Type { Unknown = 0, Local, TDM, RTP, IAX } |
| enum | Status { Missing = 0, Disabled, Idle, Reserved, Starting, Stopping, Special, Connected } |
| enum | LockFlags { LockLocalHWFail = 0x0001, LockLocalMaint = 0x0002, LockingHWFail = 0x0004, LockingMaint = 0x0008, LockLocalHWFailChg = 0x0010, LockLocalMaintChg = 0x0020, Resetting = 0x0040, LockRemoteHWFail = 0x0100, LockRemoteMaint = 0x0200, LockRemoteHWFailChg = 0x1000, LockRemoteMaintChg = 0x2000, LockLocal = LockLocalHWFail | LockLocalMaint, LockRemote = LockRemoteHWFail | LockRemoteMaint, LockLocked = LockLocal | LockRemote, LockBusy = LockingHWFail | LockingMaint | Resetting, LockLockedBusy = LockLocked | LockBusy, LockLocalChg = LockLocalHWFailChg | LockLocalMaintChg, LockRemoteChg = LockRemoteHWFailChg | LockRemoteMaintChg, LockChanged = LockLocalChg | LockRemoteChg } |
Public Member Functions | |
| virtual | ~SignallingCircuit () |
| virtual bool | status (Status newStat, bool sync=false) |
| Type | type () const |
| Status | status () const |
| int | locked (int flags=-1) const |
| void | setLock (int flags) |
| void | resetLock (int flags) |
| virtual bool | updateFormat (const char *format, int direction) |
| virtual bool | setParam (const String ¶m, const String &value) |
| virtual bool | setParams (const NamedList ¶ms) |
| virtual bool | getParam (const String ¶m, String &value) const |
| virtual bool | getBoolParam (const String ¶m, bool defValue=false) const |
| virtual int | getIntParam (const String ¶m, int defValue=0) const |
| virtual bool | getParams (NamedList ¶ms, const String &category=String::empty()) |
| SignallingCircuitGroup * | group () |
| SignallingCircuitSpan * | span () |
| const SignallingCircuitGroup * | group () const |
| const SignallingCircuitSpan * | span () const |
| unsigned int | code () const |
| bool | available () const |
| bool | connected () const |
| bool | reserve () |
| bool | connect (const char *format=0) |
| bool | disconnect () |
| bool | disable () |
| bool | hwLock (bool set, bool remote, bool changed=false, bool setChanged=false) |
| bool | maintLock (bool set, bool remote, bool changed=false, bool setChanged=false) |
| void | addEvent (SignallingCircuitEvent *event) |
| SignallingCircuitEvent * | getEvent (const Time &when) |
| virtual bool | sendEvent (SignallingCircuitEvent::Type type, NamedList *params=0) |
Static Public Member Functions | |
| static const char * | lookupType (int type) |
| static const char * | lookupStatus (int status) |
Static Public Attributes | |
| static const TokenDict | s_lockNames [] |
Protected Member Functions | |
| SignallingCircuit (Type type, unsigned int code, SignallingCircuitGroup *group=0, SignallingCircuitSpan *span=0) | |
| SignallingCircuit (Type type, unsigned int code, Status status, SignallingCircuitGroup *group=0, SignallingCircuitSpan *span=0) | |
| virtual void | clearEvents () |
| void | eventTerminated (SignallingCircuitEvent *event) |
Protected Attributes | |
| Mutex | m_mutex |
Friends | |
| class | SignallingCircuitGroup |
| class | SignallingCircuitEvent |
Abstract data circuit used by signalling.
Interface to an abstract voice/data circuit referenced by signalling
| enum Status |
Status of the circuit
| enum Type |
Type of the circuit hardware or transport
| virtual ~SignallingCircuit | ( | ) | [virtual] |
Destructor. Clear event list
| SignallingCircuit | ( | Type | type, |
| unsigned int | code, | ||
| SignallingCircuitGroup * | group = 0, |
||
| SignallingCircuitSpan * | span = 0 |
||
| ) | [protected] |
Constructor
| SignallingCircuit | ( | Type | type, |
| unsigned int | code, | ||
| Status | status, | ||
| SignallingCircuitGroup * | group = 0, |
||
| SignallingCircuitSpan * | span = 0 |
||
| ) | [protected] |
Constructor
| void addEvent | ( | SignallingCircuitEvent * | event | ) |
Add an event to the queue This method is thread safe
| event | The event to enqueue |
| bool available | ( | ) | const [inline] |
Get the available status of the circuit
| virtual void clearEvents | ( | ) | [protected, virtual] |
Clear event queue This method is thread safe
| unsigned int code | ( | ) | const [inline] |
Get the group-local code of this circuit
| bool connect | ( | const char * | format = 0 | ) | [inline] |
Connect this circuit
| format | Optional data format to update for both directions |
| bool connected | ( | ) | const [inline] |
Get the connected status of the circuit
| bool disable | ( | ) | [inline] |
Disable this circuit for maintenance
| bool disconnect | ( | ) | [inline] |
Disconnect (set state to Reserved) this circuit if connected
| void eventTerminated | ( | SignallingCircuitEvent * | event | ) | [protected] |
Event termination notification
| event | The terminated event |
| virtual bool getBoolParam | ( | const String & | param, |
| bool | defValue = false |
||
| ) | const [inline, virtual] |
Get boolean circuit parameter
| param | The parameter to get |
| defValue | The default returned value |
| SignallingCircuitEvent* getEvent | ( | const Time & | when | ) |
Get an event from queue This method is thread safe
| when | The current time |
| virtual int getIntParam | ( | const String & | param, |
| int | defValue = 0 |
||
| ) | const [inline, virtual] |
Get integer circuit parameter
| param | The parameter to get |
| defValue | The default returned value |
Get circuit parameter
| param | The parameter to get |
| value | The value of the parameter |
| virtual bool getParams | ( | NamedList & | params, |
| const String & | category = String::empty() |
||
| ) | [inline, virtual] |
Get circuit parameters
| params | Parameter list to fill from the circuit |
| category | Optional category used to select desired parameters |
| SignallingCircuitGroup* group | ( | ) | [inline] |
Get the group of circuits this one belongs to
| const SignallingCircuitGroup* group | ( | ) | const [inline] |
Get the group of circuits this one belongs to - const version
| bool hwLock | ( | bool | set, |
| bool | remote, | ||
| bool | changed = false, |
||
| bool | setChanged = false |
||
| ) |
Set/reset HW failure lock flag
| set | True to set, false to reset the flag |
| remote | True to use remote side of the circuit, false to use the local one |
| changed | Set/reset changed flag. If false the changed flag won't be affected |
| setChanged | The value of the changed flag. gnored if changed is false |
| int locked | ( | int | flags = -1 | ) | const [inline] |
Check if the given lock flags are set
| flags | The lock flags to check. -1 to check all flags |
| static const char* lookupStatus | ( | int | status | ) | [static] |
Get the text associated with a circuit status
| status | Circuit status used to retrieve the text |
| static const char* lookupType | ( | int | type | ) | [static] |
Get the text associated with a circuit type
| type | Circuit type used to retrieve the text |
| bool maintLock | ( | bool | set, |
| bool | remote, | ||
| bool | changed = false, |
||
| bool | setChanged = false |
||
| ) |
Set/reset maintenance lock flag
| set | True to set, false to reset the flag |
| remote | True to use remote side of the circuit, false to use the local one |
| changed | Set/reset changed flag. If false the changed flag won't be affected |
| setChanged | The value of the changed flag. gnored if changed is false |
| bool reserve | ( | ) | [inline] |
Reserve this circuit for later use
| void resetLock | ( | int | flags | ) | [inline] |
Reset the given lock flags of this circuit
| flags | The lock flags to reset |
| virtual bool sendEvent | ( | SignallingCircuitEvent::Type | type, |
| NamedList * | params = 0 |
||
| ) | [virtual] |
Send an event through this circuit
| type | The type of the event to send |
| params | Optional event parameters |
| void setLock | ( | int | flags | ) | [inline] |
Set the given lock flags of this circuit
| flags | The lock flags to set |
Set circuit data or trigger some action
| param | The data to update or the action to trigger |
| value | The data value or action parameter |
Set circuit data from a list of parameters
| params | Parameter list to set in the circuit |
| SignallingCircuitSpan* span | ( | ) | [inline] |
Get the circuit span this one belongs to
| const SignallingCircuitSpan* span | ( | ) | const [inline] |
Get the circuit span this one belongs to - const version
Initiate a status transition
| newStat | Desired new status |
| sync | Synchronous status change requested |
Referenced by SignallingCircuitGroup::release().
Get the status of this circuit
| virtual bool updateFormat | ( | const char * | format, |
| int | direction | ||
| ) | [inline, virtual] |
Set the format of the data transported through this circuit
| format | The new data format |
| direction | The direction to be updated. -1 means to the lower layer, 1 from the lower layer, 0 both directions |
const TokenDict s_lockNames[] [static] |
Keep the lock flags names
1.7.6.1