#include <Nux/TimerProc.h>
Public Types |
enum | { TIMERTYPE_UNKNONW = 0L,
TIMERTYPE_PERIODIC,
TIMERTYPE_DURATION,
TIMERTYPE_ITERATION
} |
Public Member Functions |
| TimerHandler () |
| ~TimerHandler () |
TimerHandle | AddTimerHandler (unsigned int Period, TimerFunctor *Callback, void *Data, WindowThread *window_thread=NULL) |
| Add a timer callback.
|
TimerHandle | AddPeriodicTimerHandler (unsigned int Period, int Duration, TimerFunctor *Callback, void *Data) |
| Add a periodic timer callback.
|
TimerHandle | AddCountIterationTimerHandler (unsigned int Period, int NumberOfIteration, TimerFunctor *Callback, void *Data) |
| Add a timer callback to be called a finite number of time.
|
bool | FindTimerHandle (TimerHandle &handle) |
| Search for a timer handle.
|
bool | RemoveTimerHandler (TimerHandle &handle) |
| Remove a timer;.
|
int | DelayUntilNextTimerExpires () |
| Return the delay until the next timer expires.
|
int | ExecTimerHandler () |
void | StartEarlyTimerObjects () |
| Start the timers that were sett before the system was fully initialized.
|
Member Enumeration Documentation
- Enumerator:
TIMERTYPE_UNKNONW |
|
TIMERTYPE_PERIODIC |
|
TIMERTYPE_DURATION |
|
TIMERTYPE_ITERATION |
|
Constructor & Destructor Documentation
nux::TimerHandler::TimerHandler |
( |
| ) |
|
nux::TimerHandler::~TimerHandler |
( |
| ) |
|
Member Function Documentation
TimerHandle nux::TimerHandler::AddCountIterationTimerHandler |
( |
unsigned int |
Period, |
|
|
int |
NumberOfIteration, |
|
|
TimerFunctor * |
Callback, |
|
|
void * |
Data |
|
) |
| |
Add a timer callback to be called a finite number of time.
Add a timer callback to the timer manager. The timer callback will be call N times exactly. Every time the timer expires, the callback function is executed. The returned TimerHandle should not be deleted by the caller.
- Parameters:
-
Milliseconds | Period delay before the callback is executed. |
NumberOfIteration | The number of time to repeat the the wait period. |
Callback | The callback to execute when the timer expires. |
Data | The callback data |
- Returns:
- A handle to the timer.
TimerHandle nux::TimerHandler::AddPeriodicTimerHandler |
( |
unsigned int |
Period, |
|
|
int |
Duration, |
|
|
TimerFunctor * |
Callback, |
|
|
void * |
Data |
|
) |
| |
Add a periodic timer callback.
Add a timer callback to the timer manager. Every time the timer expires, the callback function is executed. The returned TimerHandle should not be deleted by the caller.
- Parameters:
-
Milliseconds | Period delay before the callback is executed. |
Duration | The duration over which the timer is repeated. |
Callback | The callback to execute when the timer expires. |
Data | The callback data |
- Returns:
- A handle to the timer.
Add a timer callback.
Add a timer callback to the timer manager. When the timer expires, the callback function is executed. The returned TimerObject should not be deleted by the caller.
- Parameters:
-
Milliseconds | Period delay before the callback is executed. |
Callback | The callback to execute when the timer expires. |
Data | The callback data |
window_thread | Thread safety mesure. Pass the WindowThread associated to this TimerHandler if it is called from a diferent thread than the one where the main thread was created. |
- Returns:
- A handle to the timer.
int nux::TimerHandler::DelayUntilNextTimerExpires |
( |
| ) |
|
Return the delay until the next timer expires.
- Returns:
- Delay to next timer expiration in milliseconds.
int nux::TimerHandler::ExecTimerHandler |
( |
| ) |
|
bool nux::TimerHandler::FindTimerHandle |
( |
TimerHandle & |
handle | ) |
|
Search for a timer handle.
Search for a timer handle in the timer handle queue. Return true if the timer is found.
- Parameters:
-
handle | Timer handle to search. |
- Returns:
- Return true if the timer is found; false otherwise.
bool nux::TimerHandler::RemoveTimerHandler |
( |
TimerHandle & |
handle | ) |
|
Remove a timer;.
- Parameters:
-
handle | Timer handle to search. |
- Returns:
- Return True if the timer is found.
void nux::TimerHandler::StartEarlyTimerObjects |
( |
| ) |
|
Start the timers that were sett before the system was fully initialized.
The documentation for this class was generated from the following file: