Yate
AnalogLineGroup Class Reference

A group of analog lines. More...

#include <yatesig.h>

Inheritance diagram for AnalogLineGroup:
SignallingCircuitGroup SignallingComponent Mutex RefObject DebugEnabler Lockable GenObject

Public Member Functions

 AnalogLineGroup (AnalogLine::Type type, const char *name, bool slave=false)
 
 AnalogLineGroup (const char *name, AnalogLineGroup *fxo)
 
virtual ~AnalogLineGroup ()
 
AnalogLine::Type type () const
 
ObjListlines ()
 
AnalogLineGroupfxo ()
 
bool slave ()
 
bool appendLine (AnalogLine *line, bool destructOnFail=true)
 
void removeLine (unsigned int cic)
 
void removeLine (AnalogLine *line)
 
AnalogLinefindLine (unsigned int cic)
 
AnalogLinefindLine (const String &address)
 
virtual AnalogLineEventgetEvent (const Time &when)
 
- Public Member Functions inherited from SignallingCircuitGroup
 SignallingCircuitGroup (unsigned int base=0, int strategy=Increment, const char *name="circgroup")
 
virtual ~SignallingCircuitGroup ()
 
unsigned int count () const
 
unsigned int base () const
 
unsigned int last () const
 
int strategy () const
 
void setStrategy (int strategy)
 
ObjListcircuits ()
 
void getCicList (String &dest)
 
bool insert (SignallingCircuit *circuit)
 
void remove (SignallingCircuit *circuit)
 
SignallingCircuitSpanbuildSpan (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)
 
SignallingCircuitfind (unsigned int cic, bool local=false)
 
SignallingCircuitRangefindRange (const char *name)
 
SignallingCircuit::Status status (unsigned int cic)
 
bool status (unsigned int cic, SignallingCircuit::Status newStat, bool sync=false)
 
SignallingCircuitreserve (int checkLock=-1, int strategy=-1, SignallingCircuitRange *range=0)
 
SignallingCircuitreserve (const String &list, bool mandatory, int checkLock=-1, int strategy=-1, SignallingCircuitRange *range=0)
 
bool release (SignallingCircuit *cic, bool sync=false)
 
- Public Member Functions inherited from SignallingComponent
virtual ~SignallingComponent ()
 
virtual const StringtoString () const
 
virtual bool initialize (const NamedList *config)
 
virtual bool control (NamedList &params)
 
virtual NamedListcontrolCreate (const char *oper=0)
 
virtual bool controlExecute (NamedList *params)
 
virtual void engine (SignallingEngine *eng)
 
SignallingEngineengine () const
 
int debugLevel (int level)
 
const StringcomponentType () const
 
- 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 StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- 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 ()
 
Mutexoperator= (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 ()
 

Protected Member Functions

virtual void destroyed ()
 
- Protected Member Functions inherited from SignallingComponent
 SignallingComponent (const char *name=0, const NamedList *params=0, const char *type="unknown")
 
void insert (SignallingComponent *component)
 
virtual void detach ()
 
virtual void timerTick (const Time &when)
 
void setName (const char *name)
 
void setCompType (const char *type)
 
unsigned long tickSleep (unsigned long usec=1000000) const
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
- Protected Member Functions inherited from DebugEnabler
void debugName (const char *name)
 

Protected Attributes

ObjList m_lines
 

Additional Inherited Members

- Public Types inherited from SignallingCircuitGroup
enum  Strategy {
  Other = 0 , Increment = 0x0001 , Decrement = 0x0002 , Lowest = 0x0003 ,
  Highest = 0x0004 , Random = 0x0005 , OnlyEven = 0x1000 , OnlyOdd = 0x2000 ,
  Fallback = 0x4000
}
 
- Static Public Member Functions inherited from SignallingCircuitGroup
static int str2strategy (const char *name, int def=Increment)
 
- Static Public Member Functions inherited from SignallingComponent
static bool resolveConfig (const String &cmpName, NamedList &params, const NamedList *config)
 
- 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 NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- 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 ()
 
- Static Public Attributes inherited from SignallingCircuitGroup
static const TokenDict s_strategy []
 

Detailed Description

A group of analog lines.

This class is an analog line container. It may contain another group when used to monitor analog lines

Constructor & Destructor Documentation

◆ AnalogLineGroup() [1/2]

AnalogLineGroup ( AnalogLine::Type type,
const char * name,
bool slave = false )

Constructor. Construct an analog line group owning single lines

Parameters
typeLine type as enumeration
nameName of this component
slaveTrue if this is an FXO group owned by an FXS one. Ignored if type is not FXO

References slave(), and type().

Referenced by AnalogLineGroup(), and fxo().

◆ AnalogLineGroup() [2/2]

AnalogLineGroup ( const char * name,
AnalogLineGroup * fxo )

Constructor. Construct an FXS analog line group owning another group of FXO analog lines. The fxo group is owned by this component and will be destructed if invalid (not FXO type)

Parameters
nameName of this component
fxoThe FXO group

References AnalogLineGroup(), and fxo().

◆ ~AnalogLineGroup()

virtual ~AnalogLineGroup ( )
virtual

Destructor

Member Function Documentation

◆ appendLine()

bool appendLine ( AnalogLine * line,
bool destructOnFail = true )

Append a line to this group. Line must have the same type as this group and must be owned by this group

Parameters
lineThe line to append
destructOnFailDestroy line if failed to append. Defaults to true
Returns
True on success

◆ destroyed()

virtual void destroyed ( )
protectedvirtual

Remove all lines. Release object

Reimplemented from SignallingCircuitGroup.

◆ findLine() [1/2]

AnalogLine * findLine ( const String & address)

Find a line by its address

Parameters
addressThe address of the line
Returns
AnalogLine pointer or 0 if not found

◆ findLine() [2/2]

AnalogLine * findLine ( unsigned int cic)

Find a line by its circuit

Parameters
cicThe signalling circuit's code used by the line
Returns
AnalogLine pointer or 0 if not found

◆ fxo()

AnalogLineGroup * fxo ( )
inline

Get the group holding the FXO lines if present

Returns
The group holding the FXO lines or 0

References AnalogLineGroup().

Referenced by AnalogLineGroup().

◆ getEvent()

virtual AnalogLineEvent * getEvent ( const Time & when)
virtual

Iterate through the line list to get an event

Parameters
whenThe current time
Returns
AnalogLineEvent pointer or 0 if no events

◆ lines()

ObjList & lines ( )
inline

Get the analog lines belonging to this group

Returns
The group's lines list

References m_lines.

◆ removeLine() [1/2]

void removeLine ( AnalogLine * line)

Remove a line from the list without destroying it

Parameters
lineThe line to be removed

◆ removeLine() [2/2]

void removeLine ( unsigned int cic)

Remove a line from the list and destruct it

Parameters
cicThe signalling circuit's code used by the line

◆ slave()

bool slave ( )
inline

Check if this is an FXO group owned by an FXS one

Returns
True if this is an FXO group owned by an FXS one

Referenced by AnalogLineGroup().

◆ type()

AnalogLine::Type type ( ) const
inline

Get this group's type

Returns
The group's type

Referenced by AnalogLineGroup().

Member Data Documentation

◆ m_lines

ObjList m_lines
protected

The analog lines belonging to this group

Referenced by lines().


The documentation for this class was generated from the following file: