|
Yate
|
Main signalling component holder. More...
#include <yatesig.h>
Public Member Functions | |
| SignallingEngine (const char *name="signalling") | |
| virtual | ~SignallingEngine () |
| void | insert (SignallingComponent *component) |
| void | remove (SignallingComponent *component) |
| bool | remove (const String &name) |
| SignallingComponent * | find (const String &name) |
| SignallingComponent * | find (const String &name, const String &type, const SignallingComponent *start=0) |
| SignallingComponent * | build (const String &type, NamedList ¶ms, bool init=false, bool ref=true) |
| bool | control (NamedList ¶ms) |
| bool | find (const SignallingComponent *component) |
| void | notify (SignallingComponent *component, NamedList notifs) |
| bool | start (const char *name="Sig Engine", Thread::Priority prio=Thread::Normal, unsigned long usec=0) |
| void | stop () |
| void | setNotifier (SignallingNotifier *notifier) |
| void | removeNotifier (SignallingNotifier *notifier) |
| Thread * | thread () const |
| unsigned long | tickSleep (unsigned long usec=1000000) |
| unsigned long | tickDefault () const |
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 () | |
| Mutex & | operator= (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 SignallingEngine * | self (bool create=false) |
| static long | maxLockWait () |
| static void | maxLockWait (long maxWait) |
| template<class Obj> | |
| static void | destruct (Obj *&obj) |
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 () |
Protected Member Functions | |
| virtual unsigned long | timerTick (const Time &when) |
Protected Member Functions inherited from DebugEnabler | |
| void | debugName (const char *name) |
Protected Attributes | |
| ObjList | m_components |
Friends | |
| class | SignallingComponent |
| class | SignallingThreadPrivate |
Main signalling component holder.
The engine is the center of all SS7 or ISDN applications. It is used as a base to build the protocol stack from components.
| SignallingEngine | ( | const char * | name = "signalling" | ) |
|
virtual |
Destructor, removes all components
| SignallingComponent * build | ( | const String & | type, |
| NamedList & | params, | ||
| bool | init = false, | ||
| bool | ref = true ) |
Retrieve and reference an existing component, create by factory if not present
| type | Class or base class of the component to find or create |
| params | Name of component to find or create and creation parameters |
| init | Set to true to initialize a newly created component |
| ref | True to add a reference when returning existing component |
| bool control | ( | NamedList & | params | ) |
Apply a control operation to all components in the engine
| params | The list of parameters to query or change |
|
inlinestatic |
Helper template used to remove a component descendant from its engine, destroy it and set the received pointer to 0
| obj | Reference to pointer (lvalue) to the object to remove and destroy |
| bool find | ( | const SignallingComponent * | component | ) |
Check if a component is in the engine's list
| component | Pointer to component to check |
| SignallingComponent * find | ( | const String & | name | ) |
Retrieve a component by name, lock the list while searching for it
| name | Name of the component to find |
| SignallingComponent * find | ( | const String & | name, |
| const String & | type, | ||
| const SignallingComponent * | start = 0 ) |
Retrieve a component by name and class, lock the list while searching for it
| name | Name of the component to find, empty to find any of the type |
| type | Class or base class of the component to find, empty to match any |
| start | Component to start searching from, search all list if NULL |
References start().
| void insert | ( | SignallingComponent * | component | ) |
Insert a component in the engine, lock the list while doing so
| component | Pointer to component to insert in engine |
|
inlinestatic |
Get the maximum time we should spend acquiring a non-critical Mutex
|
static |
Set the maximum time we should spend acquiring a non-critical Mutex
| maxWait | New maximum non-critical lock wait in usec, negative to wait forever |
| void notify | ( | SignallingComponent * | component, |
| NamedList | notifs ) |
Handle notifications from a SignallingComponent
| component | The SignallingComponent from which the notifications were received |
| notifs | The notifications sent by this SignallingComponent |
| bool remove | ( | const String & | name | ) |
Remove and destroy a component from the engine by name
| name | Name of component to remove from engine |
| void remove | ( | SignallingComponent * | component | ) |
Remove a component from the engine, lock the list while doing so
| component | Pointer to component to remove from engine |
|
inline |
Remove from this engine a notifier object
| notifier | The SignallingNotifier object to be removed from the engine |
|
static |
Get a pointer to the first (and usually only) instance created
| create | Create the instance if it doesn't exist |
References SignallingEngine().
|
inline |
Add to this engine a notifier object
| notifier | The SignallingNotifier object to be added to the engine |
| bool start | ( | const char * | name = "Sig Engine", |
| Thread::Priority | prio = Thread::Normal, | ||
| unsigned long | usec = 0 ) |
| void stop | ( | ) |
Stops and destroys the worker thread if running
| Thread * thread | ( | ) | const |
Return a pointer to the worker thread
|
inline |
Get the default engine tick sleep time in microseconds
| unsigned long tickSleep | ( | unsigned long | usec = 1000000 | ) |
Adjust (decrease only) the desired maximum time until next tick. Can be called only from within timerTick()
| usec | Desired time until next timerTick() call in usec |
|
protectedvirtual |
Method called periodically by the worker thread to keep everything alive
| when | Time to use as computing base for events and timeouts |
|
protected |
The list of components managed by this engine