xoreos
0.0.5
|
The global timer manager. More...
#include <timerman.h>
Public Member Functions | |
TimerManager () | |
~TimerManager () | |
void | init () |
void | addTimer (uint32 interval, TimerHandle &handle, const TimerFunc &func) |
Add a function to be called regularly. More... | |
void | removeTimer (TimerHandle &handle) |
Remove that timer function. More... | |
Private Member Functions | |
void | removeTimer (TimerID &id) |
Static Private Member Functions | |
static uint32 | timerCallback (uint32 interval, void *data) |
Private Attributes | |
Common::Mutex | _mutex |
std::list< TimerID > | _timers |
Additional Inherited Members | |
Static Public Member Functions inherited from Common::Singleton< TimerManager > | |
static TimerManager & | instance () |
static void | destroy () |
Protected Types inherited from Common::Singleton< TimerManager > | |
typedef TimerManager | SingletonBaseType |
Protected Member Functions inherited from Common::Singleton< TimerManager > | |
Singleton () | |
virtual | ~Singleton () |
The global timer manager.
Allows registering functions to be called at specific intervals.
Definition at line 59 of file timerman.h.
Events::TimerManager::TimerManager | ( | ) |
Definition at line 41 of file timerman.cpp.
Events::TimerManager::~TimerManager | ( | ) |
Definition at line 44 of file timerman.cpp.
References _timers, and removeTimer().
void Events::TimerManager::addTimer | ( | uint32 | interval, |
TimerHandle & | handle, | ||
const TimerFunc & | func | ||
) |
Add a function to be called regularly.
interval | The interval in ms. The granularity is platform-dependent. The most common number is 10ms. |
handle | The timer handle to use. |
func | The function to call. |
Definition at line 52 of file timerman.cpp.
References Events::TimerHandle::_empty, Events::TimerHandle::_iterator, _mutex, _timers, removeTimer(), and timerCallback().
void Events::TimerManager::init | ( | ) |
Definition at line 49 of file timerman.cpp.
void Events::TimerManager::removeTimer | ( | TimerHandle & | handle | ) |
Remove that timer function.
Definition at line 77 of file timerman.cpp.
References Events::TimerHandle::_empty, Events::TimerHandle::_iterator, _mutex, and _timers.
Referenced by addTimer(), and ~TimerManager().
|
private |
Definition at line 91 of file timerman.cpp.
Definition at line 98 of file timerman.cpp.
References Events::TimerHandle::_empty, Events::TimerHandle::_iterator, and TimerMan.
Referenced by addTimer().
|
private |
Definition at line 79 of file timerman.h.
Referenced by addTimer(), and removeTimer().
|
private |
Definition at line 81 of file timerman.h.
Referenced by addTimer(), removeTimer(), and ~TimerManager().