Classes Files

Wombat::MamaTimer

More…

#include <MamaTimer.h>

Public Functions

  Name
  MamaTimer(void )
virtual ~MamaTimer(void )
virtual void create(MamaQueue * queue, MamaTimerCallback * callback, mama_f64_t interval, void * closure =NULL)
virtual void destroy()
virtual bool isActive() const
virtual void reset()
virtual void setInterval(mama_f64_t intervalSeconds)
virtual mama_f64_t getInterval() const
virtual MamaTimerCallback * getCallback() const
virtual void * getClosure() const
mamaTimer getCValue()
const mamaTimer getCValue() const

Detailed Description

class Wombat::MamaTimer;

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.

Public Functions Documentation

function MamaTimer

MamaTimer(
    void 
)

function ~MamaTimer

virtual ~MamaTimer(
    void 
)

function create

virtual void create(
    MamaQueue * queue,
    MamaTimerCallback * callback,
    mama_f64_t interval,
    void * closure =NULL
)

Parameters:

  • queue The queue.
  • callback The callback.
  • interval The interval in seconds.
  • closure The caller supplied closure.

Create a repeating timer. The interval is in seconds.

The queue is the queue from which the timer event will be dispatched.

function destroy

virtual void destroy()

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.

function isActive

virtual bool isActive() const

Return whether the timer is active.

function reset

virtual void reset()

Reset the timer to the beginning of the interval.

function setInterval

virtual void setInterval(
    mama_f64_t intervalSeconds
)

Set the timer to use a different interval (and reset to the beginning of that interval).

function getInterval

virtual mama_f64_t getInterval() const

Get the current timer interval.

function getCallback

virtual MamaTimerCallback * getCallback() const

Return: the callback.

Return the callback for the timer.

function getClosure

virtual void * getClosure() const

Return: the closure.

Return the closure for the timer.

function getCValue

mamaTimer getCValue()

function getCValue

const mamaTimer getCValue() const

Updated on 2023-03-31 at 15:29:26 +0100