Simulator::ScheduledTaskListener class

A message listener that, listening to Update messages, executes the given task after a certain time has passed and (optionally) repetaing it periodically.

Mostly of internal use, average developer does not need this class.

Base classes

class App::DefaultMessageListener
A class that inherits from App::IMessageListener and defines an implementation for the AddRef() and Release() metods.

Constructors, destructors, conversion operators

ScheduledTaskListener(App::VoidFunction_T function, float scheduleTime, float repeatRate = 0.0f)

Public functions

auto StartClock() -> void
auto HasExecuted() -> bool
Returns true if the task has already been executed.
auto HandleMessage(uint32_t messageID, void* msg) -> bool override
Called every time a message is received.

Protected variables

cGonzagoTimer mClock
App::VoidFunction_T mFunction
float mScheduleTime
float mRepeatRate
float mbFirstTime
bool mbHasExecuted

Function documentation

bool Simulator::ScheduledTaskListener::HandleMessage(uint32_t messageID, void* msg) override

Called every time a message is received.

Parameters
messageID The ID of the message received.
msg The data of the message received, it might be nullptr.
Returns Whether the message was handled or not.

Only the messages with an ID this listener signed up for will call this event.