i6engine  1.0
i6e::core::Timer Class Reference

This class provides gametime-synchronized Timers. They are controlled by the Scheduler. More...

#include <D:/Projekte/i6engine/libs/i6engine-core/include/i6engine/core/clock/Timer.h>

Public Member Functions

 Timer (EngineCoreController *ctrl, const uint32_t lngFrametime)
 Constructor for an immortal timer. More...
 
 ~Timer ()
 destructor removes timer More...
 
void start ()
 Start the timer so an update can be performed later. If the timer has not been started, the update method will do nothing. More...
 
void pause ()
 Pause the timer so an update will do nothing. More...
 
void update ()
 This method executes the given update function ptrFun() and lets the thread wait at a conditional variable. More...
 
bool setLastUpdate ()
 registered as job in Scheduler to be called when time is over More...
 

Detailed Description

This class provides gametime-synchronized Timers. They are controlled by the Scheduler.

A timer is always immortal until its deletion. When the frame time has been expired, the timer gets an update from the Scheduler. Eventual threads waiting in the Update method get awoken by the main thread. The immortal timer will shut down when the subsystem shuts down.

To get an overview of the Clock system in German, have a look at our wiki (topic: 'Taktgebung in der i6engine' )

Definition at line 49 of file Timer.h.

Constructor & Destructor Documentation

i6e::core::Timer::Timer ( EngineCoreController ctrl,
const uint32_t  lngFrametime 
)

Constructor for an immortal timer.

Parameters
lngFrametimeThis interval given in microseconds determines the update frequency e.g. the time between two calls of ptrFunc.
i6e::core::Timer::~Timer ( )

destructor removes timer

Member Function Documentation

void i6e::core::Timer::pause ( )
inline

Pause the timer so an update will do nothing.

Definition at line 71 of file Timer.h.

bool i6e::core::Timer::setLastUpdate ( )

registered as job in Scheduler to be called when time is over

void i6e::core::Timer::start ( )
inline

Start the timer so an update can be performed later. If the timer has not been started, the update method will do nothing.

Definition at line 66 of file Timer.h.

void i6e::core::Timer::update ( )

This method executes the given update function ptrFun() and lets the thread wait at a conditional variable.


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