A repeating timer. More...
#include <MamaTimer.h>
Public Member Functions | |
MamaTimer (void) | |
virtual | ~MamaTimer (void) |
virtual void | create (MamaQueue *queue, MamaTimerCallback *callback, mama_f64_t interval, void *closure=NULL) |
Create a repeating timer. More... | |
virtual void | destroy () |
Destroy (stop) the timer. More... | |
virtual bool | isActive () const |
Return whether the timer is active. More... | |
virtual void | reset () |
Reset the timer to the beginning of the interval. More... | |
virtual void | setInterval (mama_f64_t intervalSeconds) |
Set the timer to use a different interval (and reset to the beginning of that interval). More... | |
virtual mama_f64_t | getInterval () const |
Get the current timer interval. More... | |
virtual MamaTimerCallback * | getCallback () const |
Return the callback for the timer. More... | |
virtual void * | getClosure () const |
Return the closure for the timer. More... | |
mamaTimer | getCValue () |
const mamaTimer | getCValue () const |
A repeating timer.
The callback will be repeatedly called at the specified interval until the timer is destroyed. To restart the timer after destroying it if destroy(), use create(). To reset the timer to the beginning of the given interval, use reset(). To set the timer to a different interval, use setInterval().
The MAMA timer relies on underlying middleware so its resolution is also dependent on the middleware.
Wombat::MamaTimer::MamaTimer | ( | void | ) |
|
virtual |
|
virtual |
Create a repeating timer.
The interval is in seconds.
The queue is the queue from which the timer event will be dispatched.
queue | The queue. |
callback | The callback. |
interval | The interval in seconds. |
closure | The caller supplied closure. |
|
virtual |
Destroy (stop) the timer.
This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching.
|
virtual |
Return whether the timer is active.
|
virtual |
Reset the timer to the beginning of the interval.
|
virtual |
Set the timer to use a different interval (and reset to the beginning of that interval).
|
virtual |
Get the current timer interval.
|
virtual |
Return the callback for the timer.
|
virtual |
Return the closure for the timer.
mamaTimer Wombat::MamaTimer::getCValue | ( | ) |
const mamaTimer Wombat::MamaTimer::getCValue | ( | ) | const |