Public Methods | |
| timer (io_event_loop &loop, ntime when=ntime::none()) | |
| Constructor. | |
| virtual | ~timer () |
| Destructor. | |
| void | arm (ntime when) |
| Arms the timer for a particular point in time. | |
| void | disarm () |
| Disarms the timer. | |
| bool | is_armed () |
| Returns true if the timer is armed. | |
| ntime | get_when () |
| Returns the time that the timer will fire (or ntime::none()) if unarmed. | |
Protected Methods | |
| virtual void | fire ()=0 |
| Invoked by the event loop when the timer fires. | |
Friends | |
| class | io_event_loop |
|
||||||||||||
|
Constructor.
|
|
|
Destructor.
|
|
|
Arms the timer for a particular point in time. To disarm the timer, use arm(ntime::none()). To arm the timer for 1 millisecond in the future, use arm(ntime::now() + ntime::msec(1)). |
|
|
Disarms the timer.
|
|
|
Invoked by the event loop when the timer fires.
|
|
|
Returns the time that the timer will fire (or ntime::none()) if unarmed.
|
|
|
Returns true if the timer is armed.
|
|
|
|