ScummVM API documentation
Ultima::Ultima4::TimedEventMgr Class Reference

#include <timed_event_mgr.h>

Public Types

typedef TimedEvent::List List
 

Public Member Functions

 TimedEventMgr (int baseInterval)
 
 ~TimedEventMgr ()
 
void poll ()
 
bool isLocked () const
 
void add (TimedEvent::Callback theCallback, int interval, void *data=nullptr)
 
List::iterator remove (List::iterator i)
 
void remove (TimedEvent *event)
 
void remove (TimedEvent::Callback theCallback, void *data=nullptr)
 
void tick ()
 
void reset (uint interval)
 

Protected Attributes

uint32 _lastTickTime
 
uint32 _baseInterval
 
bool _locked
 
List _events
 
List _deferredRemovals
 

Detailed Description

A class for managing timed events

Constructor & Destructor Documentation

◆ TimedEventMgr()

Ultima::Ultima4::TimedEventMgr::TimedEventMgr ( int  baseInterval)

Constructs a timed event manager object. Adds a timer callback to the SDL subsystem, which will drive all of the timed events that this object controls.

◆ ~TimedEventMgr()

Ultima::Ultima4::TimedEventMgr::~TimedEventMgr ( )
inline

Destructs a timed event manager object. It removes the callback timer and un-initializes the SDL subsystem if there are no other active TimedEventMgr objects.

Member Function Documentation

◆ poll()

void Ultima::Ultima4::TimedEventMgr::poll ( )

Checks whether the frame time has expired, and if so, triggers a tick

◆ isLocked()

bool Ultima::Ultima4::TimedEventMgr::isLocked ( ) const

Returns true if the event queue is locked (in use)

◆ add()

void Ultima::Ultima4::TimedEventMgr::add ( TimedEvent::Callback  theCallback,
int  interval,
void *  data = nullptr 
)

Adds a timed event to the event queue.

◆ remove()

List::iterator Ultima::Ultima4::TimedEventMgr::remove ( List::iterator  i)

Removes a timed event from the event queue.

◆ tick()

void Ultima::Ultima4::TimedEventMgr::tick ( )

Runs each of the callback functions of the TimedEvents associated with this manager.

◆ reset()

void Ultima::Ultima4::TimedEventMgr::reset ( uint  interval)

Re-initializes the timer manager to a new timer granularityRe-initializes the event manager to a new base interval


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