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.

Private Types

typedef Common::HashMap
< Common::String, TimerProc,
Common::IgnoreCase_Hash,
Common::IgnoreCase_EqualTo
TimerSlotMap

Private Attributes

Common::Mutex _mutex
TimerSlot_head
TimerSlotMap _callbacks

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 70 of file default-timer.cpp.


Member Function Documentation

void DefaultTimerManager::handler (  ) 

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

Definition at line 82 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.

Note:
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.
Parameters:
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
Returns:
true if the timer was installed successfully, false otherwise

Implements Common::TimerManager.

Definition at line 113 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 145 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.


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


Generated on Sat Sep 14 2019 05:03:13 for ResidualVM by doxygen 1.7.1
curved edge   curved edge