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, const NamedList ¶ms, bool init=false) |
bool | control (NamedList ¶ms) |
bool | find (const SignallingComponent *component) |
bool | start (const char *name="Sig Engine", Thread::Priority prio=Thread::Normal, unsigned long usec=0) |
void | stop () |
Thread * | thread () const |
unsigned long | tickSleep (unsigned long usec=1000000) |
unsigned long | tickDefault () const |
Static Public Member Functions | |
template<class Obj > | |
static void | destruct (Obj *&obj) |
Protected Member Functions | |
virtual unsigned long | timerTick (const Time &when) |
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" | ) |
Constructor of an empty engine
name | The debug name of this engine |
virtual ~SignallingEngine | ( | ) | [virtual] |
Destructor, removes all components
SignallingComponent* build | ( | const String & | type, |
const NamedList & | params, | ||
bool | init = false |
||
) |
Retrive 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 |
bool control | ( | NamedList & | params | ) |
Apply a control operation to all components in the engine
params | The list of parameters to query or change |
static void destruct | ( | Obj *& | obj | ) | [inline, static] |
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 |
References TelEngine::destruct().
SignallingComponent* find | ( | const String & | name, |
const String & | type, | ||
const SignallingComponent * | start = 0 |
||
) |
Retrive 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 |
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 | ) |
Retrive a component by name, lock the list while searching for it
name | Name of the component to find |
void insert | ( | SignallingComponent * | component | ) |
Insert a component in the engine, lock the list while doing so
component | Pointer to component to insert in 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 |
bool remove | ( | const String & | name | ) |
Remove and destroy a component from the engine by name
name | Name of component to remove from engine |
bool start | ( | const char * | name = "Sig Engine" , |
Thread::Priority | prio = Thread::Normal , |
||
unsigned long | usec = 0 |
||
) |
Starts the worker thread that keeps components alive
name | Static name of the thread |
prio | Thread's priority |
usec | How long to sleep between iterations in usec, 0 to use library default |
void stop | ( | ) |
Stops and destroys the worker thread if running
Thread* thread | ( | ) | const |
Return a pointer to the worker thread
unsigned long tickDefault | ( | ) | const [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 |
virtual unsigned long timerTick | ( | const Time & | when | ) | [protected, virtual] |
Method called periodically by the worker thread to keep everything alive
when | Time to use as computing base for events and timeouts |
ObjList m_components [protected] |
The list of components managed by this engine