ScummVM API documentation
DefaultTimerManager Class Reference
Inheritance diagram for DefaultTimerManager:
Common::TimerManager Common::NonCopyable EmscriptenTimerManager LibretroTimerManager PspTimerManager SdlTimerManager

Public Member Functions

bool installTimerProc (TimerProc proc, int32 interval, void *refCon, const Common::String &id) override
 
void removeTimerProc (TimerProc proc) override
 
virtual void handler ()
 
void checkTimers (uint32 interval=10)
 

Protected Attributes

Common::Mutex _mutex
 
TimerSlot_head
 

Additional Inherited Members

- Public Types inherited from Common::TimerManager
typedef void(* TimerProc) (void *refCon)
 

Member Function Documentation

◆ installTimerProc()

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

Install a new timer callback.

After it has been created, the timer is called every interval microseconds. The timer can 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 10 ms.
Parameters
procCallback.
intervalInterval in which the timer shall be invoked (in microseconds).
refConArbitrary void pointer passed to the timer callback.
idUnique string ID of the installed timer. Used by the event recorder.
Returns
True if the timer was installed successfully, false otherwise.

Implements Common::TimerManager.

◆ removeTimerProc()

void DefaultTimerManager::removeTimerProc ( TimerProc  proc)
overridevirtual

Remove the given timer callback.

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

Implements Common::TimerManager.

◆ handler()

virtual void DefaultTimerManager::handler ( )
virtual

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

Reimplemented in EmscriptenTimerManager.


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