i6engine  1.0
i6e::utils::Clock< Updater > Class Template Reference

#include <D:/Projekte/i6engine/libs/i6engine-utils/include/i6engine/utils/Clock.h>

Public Member Functions

 Clock ()
 default constructor More...
 
 ~Clock ()
 stops the updating of the clock, removes all timers More...
 
void Update ()
 updates current time and notifies timers, called from outside This function tells the clock to update it's current time. it will query the Updater template to get the current time value More...
 
uint64_t getTime () const
 Will return the time since the Clock has been started. More...
 
uint64_t registerTimer ()
 registers a new timer waiting for this clock More...
 
void unregisterTimer (uint64_t timerID)
 removes the given timer More...
 
void updateWaitTime (uint64_t timerID, uint64_t time)
 updates the time a timer is waiting for More...
 
bool waitForTime (uint64_t timerID, uint64_t time)
 let's a timer wait for the given time More...
 
bool isRunning () const
 returns state of the Clock More...
 

Detailed Description

template<class Updater>
class i6e::utils::Clock< Updater >

Definition at line 40 of file Clock.h.

Constructor & Destructor Documentation

template<class Updater>
i6e::utils::Clock< Updater >::Clock ( )
inline

default constructor

Definition at line 45 of file Clock.h.

template<class Updater>
i6e::utils::Clock< Updater >::~Clock ( )
inline

stops the updating of the clock, removes all timers

Note
make sure, this function is never called while an Update is still in progress It will call Updater::Stop befor the critical section begins.

Definition at line 54 of file Clock.h.

Member Function Documentation

template<class Updater>
uint64_t i6e::utils::Clock< Updater >::getTime ( ) const
inline

Will return the time since the Clock has been started.

Returns
Current time in microseconds

Definition at line 80 of file Clock.h.

template<class Updater>
bool i6e::utils::Clock< Updater >::isRunning ( ) const
inline

returns state of the Clock

Definition at line 136 of file Clock.h.

template<class Updater>
uint64_t i6e::utils::Clock< Updater >::registerTimer ( )
inline

registers a new timer waiting for this clock

Definition at line 87 of file Clock.h.

template<class Updater>
void i6e::utils::Clock< Updater >::unregisterTimer ( uint64_t  timerID)
inline

removes the given timer

Note
calling this while another function concerning this timer is pending (updateWaitTime etc.) can lead to undefined behaviour

Definition at line 101 of file Clock.h.

template<class Updater>
void i6e::utils::Clock< Updater >::Update ( )
inline

updates current time and notifies timers, called from outside This function tells the clock to update it's current time. it will query the Updater template to get the current time value

Note
this function is not reentrant

Definition at line 70 of file Clock.h.

template<class Updater>
void i6e::utils::Clock< Updater >::updateWaitTime ( uint64_t  timerID,
uint64_t  time 
)
inline

updates the time a timer is waiting for

Definition at line 109 of file Clock.h.

template<class Updater>
bool i6e::utils::Clock< Updater >::waitForTime ( uint64_t  timerID,
uint64_t  time 
)
inline

let's a timer wait for the given time

Definition at line 123 of file Clock.h.


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