Blender V2.61 - r43446
|
#include <GHOST_TimerManager.h>
Public Member Functions | |
GHOST_TimerManager () | |
virtual | ~GHOST_TimerManager () |
virtual GHOST_TUns32 | getNumTimers () |
virtual bool | getTimerFound (GHOST_TimerTask *timer) |
virtual GHOST_TSuccess | addTimer (GHOST_TimerTask *timer) |
virtual GHOST_TSuccess | removeTimer (GHOST_TimerTask *timer) |
virtual GHOST_TUns64 | nextFireTime () |
virtual bool | fireTimers (GHOST_TUns64 time) |
virtual bool | fireTimer (GHOST_TUns64 time, GHOST_TimerTask *task) |
Protected Types | |
typedef std::vector < GHOST_TimerTask * > | TTimerVector |
Protected Member Functions | |
void | disposeTimers () |
Protected Attributes | |
TTimerVector | m_timers |
Manages a list of timer tasks. Timer tasks added are owned by the manager. Don't delete timer task objects.
Definition at line 50 of file GHOST_TimerManager.h.
typedef std::vector<GHOST_TimerTask*> GHOST_TimerManager::TTimerVector [protected] |
Definition at line 119 of file GHOST_TimerManager.h.
GHOST_TimerManager::GHOST_TimerManager | ( | ) |
Constructor.
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 47 of file GHOST_TimerManager.cpp.
GHOST_TimerManager::~GHOST_TimerManager | ( | ) | [virtual] |
GHOST_TSuccess GHOST_TimerManager::addTimer | ( | GHOST_TimerTask * | timer | ) | [virtual] |
Adds a timer task to the list. It is only added when it not already present in the list.
timer | The timer task added to the list. |
Definition at line 71 of file GHOST_TimerManager.cpp.
References getTimerFound(), GHOST_kFailure, GHOST_kSuccess, and m_timers.
Referenced by GHOST_System::installTimer().
void GHOST_TimerManager::disposeTimers | ( | ) | [protected] |
Deletes all timers.
Definition at line 157 of file GHOST_TimerManager.cpp.
References m_timers.
Referenced by ~GHOST_TimerManager().
bool GHOST_TimerManager::fireTimer | ( | GHOST_TUns64 | time, |
GHOST_TimerTask * | task | ||
) | [virtual] |
Checks this timer task to see if they are expired and fires them if needed.
time | The current time. |
task | The timer task to check and optionally fire. |
Definition at line 132 of file GHOST_TimerManager.cpp.
References GHOST_TimerTask::getInterval(), GHOST_TimerTask::getNext(), GHOST_TimerTask::getStart(), GHOST_TimerTask::getTimerProc(), next, and GHOST_TimerTask::setNext().
Referenced by fireTimers().
bool GHOST_TimerManager::fireTimers | ( | GHOST_TUns64 | time | ) | [virtual] |
Checks all timer tasks to see if they are expired and fires them if needed.
time | The current time. |
Definition at line 118 of file GHOST_TimerManager.cpp.
References fireTimer(), and m_timers.
Referenced by GHOST_System::dispatchEvents(), GHOST_System::installTimer(), GHOST_SystemWin32::processEvents(), GHOST_SystemCarbon::processEvents(), GHOST_SystemX11::processEvents(), and GHOST_SystemSDL::processEvents().
GHOST_TUns32 GHOST_TimerManager::getNumTimers | ( | ) | [virtual] |
Returns the number of timer tasks.
Definition at line 58 of file GHOST_TimerManager.cpp.
References m_timers.
bool GHOST_TimerManager::getTimerFound | ( | GHOST_TimerTask * | timer | ) | [virtual] |
Returns whther this timer task ins in our list.
Definition at line 64 of file GHOST_TimerManager.cpp.
References find(), and m_timers.
Referenced by addTimer().
GHOST_TUns64 GHOST_TimerManager::nextFireTime | ( | ) | [virtual] |
Finds the soonest time the next timer would fire.
Definition at line 103 of file GHOST_TimerManager.cpp.
References GHOST_kFireTimeNever, m_timers, and next.
Referenced by GHOST_SystemWin32::processEvents(), GHOST_SystemCarbon::processEvents(), GHOST_SystemX11::processEvents(), and GHOST_SystemSDL::processEvents().
GHOST_TSuccess GHOST_TimerManager::removeTimer | ( | GHOST_TimerTask * | timer | ) | [virtual] |
Removes a timer task from the list. It is only removed when it is found in the list.
timer | The timer task to be removed from the list. |
Definition at line 86 of file GHOST_TimerManager.cpp.
References find(), GHOST_kFailure, GHOST_kSuccess, and m_timers.
Referenced by GHOST_System::removeTimer().
TTimerVector GHOST_TimerManager::m_timers [protected] |
The list with event consumers.
Definition at line 121 of file GHOST_TimerManager.h.
Referenced by addTimer(), disposeTimers(), fireTimers(), getNumTimers(), getTimerFound(), nextFireTime(), and removeTimer().