SignallingTimer Class Reference
A signalling timer.
More...
#include <yatesig.h>
List of all members.
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 |
void | start (u_int64_t time=Time::msecNow()) |
void | stop () |
bool | started () |
bool | timeout (u_int64_t time=Time::msecNow()) |
Detailed Description
A signalling timer.
Timer management class. Used to manage timeouts. The time is kept in miliseconds
Constructor & Destructor Documentation
Constructor
- Parameters:
-
| interval | The timeout interval. Set to 0 to disable |
| time | Optional timeout value. If non 0, the timer is started |
Member Function Documentation
u_int64_t interval |
( |
|
) |
const [inline] |
Get the timeout interval
- Returns:
- The timeout interval
void interval |
( |
const NamedList & |
params, |
|
|
const char * |
param, |
|
|
unsigned int |
minVal, |
|
|
unsigned int |
defVal, |
|
|
bool |
allowDisable, |
|
|
bool |
sec = false | |
|
) |
| | [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
- 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 |
| allowDisable | True to allow 0 for the timer interval |
| sec | True if the interval value if given in seconds |
References NamedList::getIntValue().
void interval |
( |
u_int64_t |
value |
) |
[inline] |
Set the timeout interval
- Parameters:
-
| value | The new timeout value |
void start |
( |
u_int64_t |
time = Time::msecNow() |
) |
[inline] |
Start the timer if enabled (interval is positive)
- Parameters:
-
| time | Time to be added to the interval to set the timeout point |
bool started |
( |
|
) |
[inline] |
Check if the timer is started
- Returns:
- True if the timer is started
bool timeout |
( |
u_int64_t |
time = Time::msecNow() |
) |
[inline] |
Check if the timer is started and timed out
- Parameters:
-
| time | The time to compare with |
- Returns:
- True if the timer timed out
The documentation for this class was generated from the following file: