ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

DefaultTimerManager Class Reference

#include <default-timer.h>

Inheritance diagram for DefaultTimerManager:
Collaboration diagram for DefaultTimerManager:

List of all members.

Public Member Functions

 DefaultTimerManager ()
virtual ~DefaultTimerManager ()
virtual bool installTimerProc (TimerProc proc, int32 interval, void *refCon, const Common::String &id)
 Install a new timer callback.
virtual void removeTimerProc (TimerProc proc)
 Remove the given timer callback.
void handler ()
 Timer callback, to be invoked at regular time intervals by the backend.
void checkTimers (uint32 interval=10)

Private Types

typedef Common::HashMap
< Common::String, TimerProc,

Private Attributes

Common::Mutex _mutex
TimerSlotMap _callbacks
uint32 _timerCallbackNext

Detailed Description

Definition at line 33 of file default-timer.h.

Member Typedef Documentation

Constructor & Destructor Documentation

DefaultTimerManager::DefaultTimerManager (  ) 

Definition at line 64 of file default-timer.cpp.

DefaultTimerManager::~DefaultTimerManager (  )  [virtual]

Definition at line 71 of file default-timer.cpp.

Member Function Documentation

void DefaultTimerManager::checkTimers ( uint32  interval = 10  ) 

Definition at line 118 of file default-timer.cpp.

void DefaultTimerManager::handler (  ) 

Timer callback, to be invoked at regular time intervals by the backend.

Definition at line 83 of file default-timer.cpp.

bool DefaultTimerManager::installTimerProc ( TimerProc  proc,
int32  interval,
void *  refCon,
const Common::String id 
) [virtual]

Install a new timer callback.

It will from now be called every interval microseconds. The timer may be invoked from a separate thread. Hence any timer code should be written following the same safety guidelines as any other threaded code.

Although the interval is specified in microseconds, the actual timer resolution may be lower. In particular, with the SDL backend the timer resolution is 10ms.
proc the callback
interval the interval in which the timer shall be invoked (in microseconds)
refCon an arbitrary void pointer; will be passed to the timer callback
id unique string id of the installed timer. Used by the event recorder
true if the timer was installed successfully, false otherwise

Implements Common::TimerManager.

Definition at line 128 of file default-timer.cpp.

void DefaultTimerManager::removeTimerProc ( TimerProc  proc  )  [virtual]

Remove the given timer callback.

It will not be invoked anymore, and no instance of this callback will be running anymore.

Implements Common::TimerManager.

Definition at line 160 of file default-timer.cpp.

Member Data Documentation

Definition at line 39 of file default-timer.h.

Definition at line 38 of file default-timer.h.

Definition at line 37 of file default-timer.h.

Definition at line 41 of file default-timer.h.

The documentation for this class was generated from the following files:

Generated on Sat Aug 1 2020 05:03:05 for ResidualVM by doxygen 1.7.1
curved edge   curved edge