i6engine
1.0
|
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... | |
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' )
i6e::core::Timer::Timer | ( | EngineCoreController * | ctrl, |
const uint32_t | lngFrametime | ||
) |
Constructor for an immortal timer.
lngFrametime | This interval given in microseconds determines the update frequency e.g. the time between two calls of ptrFunc. |
i6e::core::Timer::~Timer | ( | ) |
destructor removes timer
|
inline |
bool i6e::core::Timer::setLastUpdate | ( | ) |
registered as job in Scheduler to be called when time is over
|
inline |
void i6e::core::Timer::update | ( | ) |
This method executes the given update function ptrFun() and lets the thread wait at a conditional variable.