|
Yate
|
A signalling timer. More...
#include <yatesig.h>
Public Member Functions | |
| SignallingTimer (u_int64_t interval, u_int64_t time=0) | |
| void | interval (u_int64_t value) |
| void | interval (const NamedList ¶ms, const char *param, unsigned int minVal, unsigned int defVal, bool allowDisable, bool sec=false) |
| u_int64_t | interval () const |
| u_int64_t | fireTime () const |
| void | start (u_int64_t time=Time::msecNow()) |
| void | fire (u_int64_t time=Time::msecNow()) |
| void | stop () |
| bool | started () const |
| bool | timeout (u_int64_t time=Time::msecNow()) const |
Static Public Member Functions | |
| static unsigned int | getInterval (const NamedList ¶ms, const char *param, unsigned int minVal, unsigned int defVal, unsigned int maxVal=0, bool allowDisable=false) |
A signalling timer.
Timer management class. Used to manage timeouts. The time is kept in miliseconds
|
inline |
Constructor
| interval | The timeout interval. Set to 0 to disable |
| time | Optional timeout value. If non 0, the timer is started |
References interval(), and start().
Referenced by SignallingMessageTimer::global(), SignallingMessageTimer::global(), and SignallingMessageTimer::SignallingMessageTimer().
|
inline |
Fire the timer at a specific absolute time
| time | Absolute time (in msec) when the timer will fire |
References Time::msecNow().
|
inline |
Get the time this timer will fire (timeout)
Referenced by SignallingMessageTimer::fireTime().
|
static |
Retrieve a timer interval from a list of parameters.
| params | The list of parameters |
| param | The name of the parameter containing the timer interval value |
| minVal | Minimum value allowed for the timer interval |
| defVal | Default value if it fails to get one from the given parameter |
| maxVal | Optional interval maximum value |
| allowDisable | True to allow 0 for the timer interval |
Referenced by interval().
|
inline |
Get the timeout interval
|
inline |
Set the timeout interval from a list of parameters. The interval value is checked to be at least minVal or 0 if allowDisable is true
| params | The list of parameters |
| param | The name of the parameter containing the timer interval value |
| minVal | Minimum value allowed for the timer interval |
| defVal | Default value if it fails to get one from the given parameter |
| allowDisable | True to allow 0 for the timer interval |
| sec | True if the interval value if given in seconds |
References getInterval().
|
inline |
Set the timeout interval
| value | The new timeout value |
Referenced by SignallingMessageTimer::SignallingMessageTimer(), and SignallingTimer().
|
inline |
Start the timer if enabled (interval is positive)
| time | Time to be added to the interval to set the timeout point |
References Time::msecNow().
Referenced by SignallingTimer().
|
inline |
|
inline |
Stop the timer
|
inline |
Check if the timer is started and timed out
| time | The time to compare with |
References Time::msecNow(), and started().