ScummVM
Common::TimerManager Class Referenceabstract

#include <timer.h>

Inheritance diagram for Common::TimerManager:
Collaboration diagram for Common::TimerManager:

Public Types

typedef void(* TimerProc) (void *refCon)
 

Public Member Functions

virtual ~TimerManager ()
 
virtual bool installTimerProc (TimerProc proc, int32 interval, void *refCon, const Common::String &id)=0
 Install a new timer callback. More...
 
virtual void removeTimerProc (TimerProc proc)=0
 Remove the given timer callback. More...
 

Additional Inherited Members

- Private Member Functions inherited from Common::NonCopyable
 NonCopyable ()
 

Detailed Description

Definition at line 32 of file timer.h.

Member Typedef Documentation

◆ TimerProc

typedef void(* Common::TimerManager::TimerProc) (void *refCon)

Definition at line 34 of file timer.h.

Constructor & Destructor Documentation

◆ ~TimerManager()

virtual Common::TimerManager::~TimerManager ( )
inlinevirtual

Definition at line 36 of file timer.h.

Member Function Documentation

◆ installTimerProc()

virtual bool Common::TimerManager::installTimerProc ( TimerProc  proc,
int32  interval,
void refCon,
const Common::String id 
)
pure 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
procthe callback
intervalthe interval in which the timer shall be invoked (in microseconds)
refConan arbitrary void pointer; will be 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

Implemented in TizenTimerManager, and DefaultTimerManager.

◆ removeTimerProc()

virtual void Common::TimerManager::removeTimerProc ( TimerProc  proc)
pure virtual

Remove the given timer callback.

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

Implemented in TizenTimerManager, and DefaultTimerManager.


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