|
Blender V4.3
|
#include <GHOST_TimerManager.hh>
Public Member Functions | |
| GHOST_TimerManager () | |
| ~GHOST_TimerManager () | |
| uint32_t | getNumTimers () |
| bool | getTimerFound (GHOST_TimerTask *timer) |
| GHOST_TSuccess | addTimer (GHOST_TimerTask *timer) |
| GHOST_TSuccess | removeTimer (GHOST_TimerTask *timer) |
| uint64_t | nextFireTime () |
| bool | fireTimers (uint64_t time) |
| bool | fireTimer (uint64_t time, GHOST_TimerTask *task) |
Protected Types | |
| using | TTimerVector = std::vector<GHOST_TimerTask *> |
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 23 of file GHOST_TimerManager.hh.
|
protected |
Definition at line 91 of file GHOST_TimerManager.hh.
| GHOST_TimerManager::GHOST_TimerManager | ( | ) |
Constructor.
Copyright (C) 2001 NaN Technologies B.V.
Definition at line 19 of file GHOST_TimerManager.cc.
| GHOST_TimerManager::~GHOST_TimerManager | ( | ) |
| GHOST_TSuccess GHOST_TimerManager::addTimer | ( | GHOST_TimerTask * | timer | ) |
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 37 of file GHOST_TimerManager.cc.
References getTimerFound(), GHOST_kFailure, GHOST_kSuccess, m_timers, and timer.
Referenced by gwl_seat_key_repeat_timer_add(), and GHOST_System::installTimer().
|
protected |
Deletes all timers.
Definition at line 120 of file GHOST_TimerManager.cc.
References m_timers.
Referenced by ~GHOST_TimerManager().
| bool GHOST_TimerManager::fireTimer | ( | uint64_t | time, |
| GHOST_TimerTask * | task ) |
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 97 of file GHOST_TimerManager.cc.
References next.
Referenced by fireTimers().
| bool GHOST_TimerManager::fireTimers | ( | uint64_t | time | ) |
Checks all timer tasks to see if they are expired and fires them if needed.
| time | The current time. |
Definition at line 83 of file GHOST_TimerManager.cc.
References fireTimer(), and m_timers.
Referenced by GHOST_System::dispatchEvents(), GHOST_System::installTimer(), GHOST_SystemCocoa::processEvents(), GHOST_SystemSDL::processEvents(), GHOST_SystemWin32::processEvents(), and GHOST_SystemX11::processEvents().
| uint32_t GHOST_TimerManager::getNumTimers | ( | ) |
Returns the number of timer tasks.
Definition at line 26 of file GHOST_TimerManager.cc.
References m_timers.
| bool GHOST_TimerManager::getTimerFound | ( | GHOST_TimerTask * | timer | ) |
Returns whether this timer task ins in our list.
Definition at line 31 of file GHOST_TimerManager.cc.
References m_timers, and timer.
Referenced by addTimer().
| uint64_t GHOST_TimerManager::nextFireTime | ( | ) |
Finds the soonest time the next timer would fire.
Definition at line 67 of file GHOST_TimerManager.cc.
References GHOST_kFireTimeNever, m_timers, and next.
Referenced by GHOST_SystemCocoa::processEvents(), GHOST_SystemSDL::processEvents(), GHOST_SystemWin32::processEvents(), and GHOST_SystemX11::processEvents().
| GHOST_TSuccess GHOST_TimerManager::removeTimer | ( | GHOST_TimerTask * | timer | ) |
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 51 of file GHOST_TimerManager.cc.
References GHOST_kFailure, GHOST_kSuccess, m_timers, and timer.
Referenced by gwl_seat_key_repeat_timer_remove(), and GHOST_System::removeTimer().
|
protected |
The list with event consumers.
Definition at line 93 of file GHOST_TimerManager.hh.
Referenced by addTimer(), disposeTimers(), fireTimers(), getNumTimers(), getTimerFound(), nextFireTime(), and removeTimer().