Go to the source code of this file.
Functions |
MAMAExpDLL mama_status | mamaTimer_create (mamaTimer *result, mamaQueue queue, mamaTimerCb action, mama_f64_t interval, void *closure) |
| Create a repeating timer.
|
MAMAExpDLL mama_status | mamaTimer_create2 (mamaTimer *result, mamaQueue queue, mamaTimerCb action, mamaTimerCb onTimerDestroyed, mama_f64_t interval, void *closure) |
| Create a repeating timer.
|
MAMAExpDLL mama_status | mamaTimer_allocate (mamaTimer *result, mamaQueue queue) |
| Allocate a repeating timer.
|
MAMAExpDLL mama_status | mamaTimer_allocate2 (mamaTimer *result, mamaQueue queue, mamaTimerCb onTimerDestroyed) |
| Allocate a repeating timer.
|
MAMAExpDLL mama_status | mamaTimer_start (mamaTimer result, mamaTimerCb action, mama_f64_t interval, void *closure) |
| Start a repeating timer created using allocate.
|
MAMAExpDLL mama_status | mamaTimer_destroy (mamaTimer timer) |
| Destroy the timer.
|
MAMAExpDLL mama_status | mamaTimer_reset (mamaTimer timer) |
| Reset the timer to the beginning of the interval.
|
MAMAExpDLL mama_status | mamaTimer_setInterval (mamaTimer timer, mama_f64_t interval) |
| Set the timer to use a different interval (and reset to the beginning of that interval).
|
MAMAExpDLL mama_status | mamaTimer_getInterval (const mamaTimer timer, mama_f64_t *interval) |
| Get the current timer interval.
|
MAMAExpDLL mama_status | mamaTimer_getQueue (const mamaTimer timer, mamaQueue *queue) |
| Return the mamaQueue for this timer.
|
Typedef Documentation
Prototype for callback invoked by timer.
- Parameters
-
timer | The timer handle. |
closure | Caller supplied closure. |
Function Documentation
Create a repeating timer.
Since the mamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details.
The callback is invoked repeatedly at the specified interval until the timer is destroyed.
- Parameters
-
result | A pointer to the timer handle. |
queue | The queue from which the timer event will be dispatched. |
action | The callback to be invoked after the interval. |
closure | The closure that is passed to the callback. |
interval,: | The interval in seconds. |
Create a repeating timer.
Since the mamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details.
The callback is invoked repeatedly at the specified interval until the timer is destroyed.
- Parameters
-
result | A pointer to the timer handle. |
queue | The queue from which the timer event will be dispatched. |
action | The callback to be invoked after the interval. |
onTimerDestroyed | This callback will be invoked whenever the timer is destroyed, can be NULL. |
closure | The closure that is passed to the callback. |
interval,: | The interval in seconds. |
Allocate a repeating timer.
- Parameters
-
result | A pointer to the timer handle. |
queue | The queue from which the timer event will be dispatched. |
Allocate a repeating timer.
- Parameters
-
result | A pointer to the timer handle. |
queue | The queue from which the timer event will be dispatched. |
onTimerDestroyed | Callback will be invoked whenever the timer has been completely destroyed. |
Start a repeating timer created using allocate.
The callback is invoked repeatedly at the specified interval until the timer is destroyed.
- Parameters
-
result | The timer handle returned from allocate. |
queue | The queue from which the timer event will be dispatched. |
action | The callback to be invoked after the interval. |
closure | The closure that is passed to the callback. |
interval,: | The interval in seconds. |
Destroy 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. Note that this function is asynchronous and is only guaranteed to have finished whenever the onTimerDestroyed function passed to the mamaTimer_create2 has been called.
- Parameters
-
timer | The mamaTimer to be destroyed. |
Reset the timer to the beginning of the interval.
- Parameters
-
timer | The mamaTimer to be reset. |
Set the timer to use a different interval (and reset to the beginning of that interval).
- Parameters
-
timer | The mamaTimer to change the interval. |
interval | The new interval for the timer. |
Get the current timer interval.
- Parameters
-
timer | The mamaTimer. |
interval | Address of the location where the interval will be written. |
Return the mamaQueue
for this timer.
- Parameters
-
timer | The timer. |
queue | A pointer to hold the queue. |