|
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) |
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 String & | toString () const |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Static Public Member Functions | |
| static const char * | lookupType (int type) |
| static const char * | lookupStatus (int status) |
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 NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
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 Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
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
|
virtual |
Destructor. Clear event list
|
protected |
|
protected |
| void addEvent | ( | SignallingCircuitEvent * | event | ) |
Add an event to the queue This method is thread safe
| event | The event to enqueue |
|
inline |
Get the available status of the circuit
Referenced by reserve().
|
protectedvirtual |
Clear event queue This method is thread safe
|
inline |
Get the group-local code of this circuit
Referenced by SignallingCircuit(), and SignallingCircuit().
|
inline |
Connect this circuit
| format | Optional data format to update for both directions |
References status(), and updateFormat().
|
inline |
Get the connected status of the circuit
|
inline |
Disable this circuit for maintenance
References status().
|
inline |
Disconnect (set state to Reserved) this circuit if connected
References status().
|
protected |
Event termination notification
| event | The terminated event |
|
inlinevirtual |
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 |
|
inlinevirtual |
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 |
|
inlinevirtual |
Get circuit parameters
| params | Parameter list to fill from the circuit |
| category | Optional category used to select desired parameters |
References String::empty().
|
inline |
Get the group of circuits this one belongs to
Referenced by SignallingCircuit(), and SignallingCircuit().
|
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 |
|
inline |
Check if the given lock flags are set
| flags | The lock flags to check. -1 to check all flags |
|
static |
Get the text associated with a circuit status
| status | Circuit status used to retrieve the text |
References status().
|
static |
Get the text associated with a circuit type
| type | Circuit type used to retrieve the text |
References type().
| 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 |
|
inline |
Reserve this circuit for later use
References available(), and status().
|
inline |
Reset the given lock flags of this circuit
| flags | The lock flags to reset |
|
virtual |
Send an event through this circuit
| type | The type of the event to send |
| params | Optional event parameters |
References type().
|
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 |
|
virtual |
Set circuit data from a list of parameters
| params | Parameter list to set in the circuit |
|
inline |
Get the circuit span this one belongs to
Referenced by SignallingCircuit(), and SignallingCircuit().
|
inline |
Get the circuit span this one belongs to - const version
|
inline |
Get the status of this circuit
|
inlinevirtual |
Initiate a status transition
| newStat | Desired new status |
| sync | Synchronous status change requested |
Referenced by connect(), disable(), disconnect(), lookupStatus(), SignallingCircuitGroup::release(), reserve(), and SignallingCircuit().
|
inline |
Get the type of this circuit
Referenced by lookupType(), sendEvent(), SignallingCircuit(), and SignallingCircuit().
|
inlinevirtual |
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 |
Referenced by connect().
|
protected |
Circuit operations mutex
|
static |
Keep the lock flags names