DelegateMQ
Loading...
Searching...
No Matches
Timer Class Reference

A timer class provides periodic timer callbacks on the client's thread of control. Timer is thread safe. More...

#include <Timer.h>

Public Member Functions

 Timer (void)
 Constructor.
 
 ~Timer (void)
 Destructor.
 
void Start (dmq::Duration timeout, bool once=false)
 
void Stop ()
 Stops a timer.
 
bool Enabled ()
 

Static Public Member Functions

static dmq::Duration GetTime ()
 
static dmq::Duration Difference (dmq::Duration time1, dmq::Duration time2)
 
static void ProcessTimers ()
 Called on a periodic basic to service all timer instances.
 

Public Attributes

dmq::UnicastDelegateSafe< void(void)> Expired
 Client's register with Expired to get timer callbacks.
 

Detailed Description

A timer class provides periodic timer callbacks on the client's thread of control. Timer is thread safe.

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( void )

Constructor.

◆ ~Timer()

Timer::~Timer ( void )

Destructor.

Member Function Documentation

◆ Difference()

dmq::Duration Timer::Difference ( dmq::Duration time1,
dmq::Duration time2 )
static

Computes the time difference between two duration values taking into account rollover.

Parameters
[in]time1- time stamp 1.
[in]time2- time stamp 2.
Returns
The time difference.

◆ Enabled()

bool Timer::Enabled ( )
inline

Gets the enabled state of a timer.

Returns
TRUE if the timer is enabled, FALSE otherwise.

◆ GetTime()

dmq::Duration Timer::GetTime ( )
static

Get the current time.

Returns
The current time.

◆ ProcessTimers()

void Timer::ProcessTimers ( )
static

Called on a periodic basic to service all timer instances.

◆ Start()

void Timer::Start ( dmq::Duration timeout,
bool once = false )

Starts a timer for callbacks on the specified timeout interval.

Parameters
[in]timeout- the timeout.
[in]once- true if only one timer expiration

◆ Stop()

void Timer::Stop ( )

Stops a timer.

Member Data Documentation

◆ Expired

dmq::UnicastDelegateSafe<void(void)> Timer::Expired

Client's register with Expired to get timer callbacks.


The documentation for this class was generated from the following files: