Isle
Loading...
Searching...
No Matches
MxTickleManager Class Reference

[AI] Manages ticking ("tickling") a set of MxCore objects at specified intervals. More...

#include <mxticklemanager.h>

Inheritance diagram for MxTickleManager:
Collaboration diagram for MxTickleManager:

Public Member Functions

 MxTickleManager ()
 [AI] Constructs an empty tickle manager. More...
 
 ~MxTickleManager () override
 [AI] Destroys the tickle manager, unregistering and freeing all clients. More...
 
MxResult Tickle () override
 [AI] Iterates over registered clients and invokes their Tickle() methods as needed. More...
 
virtual void RegisterClient (MxCore *p_client, MxTime p_interval)
 [AI] Registers an MxCore object to receive periodic tickles. More...
 
virtual void UnregisterClient (MxCore *p_client)
 [AI] Unregisters (marks for destruction) a previously registered client. More...
 
virtual void SetClientTickleInterval (MxCore *p_client, MxTime p_interval)
 [AI] Changes the tickle interval of an already registered client. More...
 
virtual MxTime GetClientTickleInterval (MxCore *p_client)
 [AI] Looks up the tickle interval of a registered client. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Detailed Description

[AI] Manages ticking ("tickling") a set of MxCore objects at specified intervals.

[AI] Forward declaration for the tickle manager, which schedules periodic updates on registered clients.

MxTickleManager maintains a list of MxTickleClient entries—each representing a client object and its tickle interval. On each Tickle() call, the manager updates all registered clients, invoking their Tickle() method as needed (if the interval has elapsed). Used throughout the engine to provide periodic updates for animation, streaming, and other time-dependent logic.

[AI] Intended to be used as a centralized update/ticking system for polymorphic objects, decoupling specific object update logic from the main game/application loop.

Definition at line 90 of file mxticklemanager.h.

Constructor & Destructor Documentation

◆ MxTickleManager()

MxTickleManager::MxTickleManager ( )
inline

[AI] Constructs an empty tickle manager.

[AI]

Definition at line 95 of file mxticklemanager.h.

◆ ~MxTickleManager()

MxTickleManager::~MxTickleManager ( )
override

[AI] Destroys the tickle manager, unregistering and freeing all clients.

[AI] Calls delete on every registered MxTickleClient. [AI]

Definition at line 25 of file mxticklemanager.cpp.

Member Function Documentation

◆ GetClientTickleInterval()

MxTime MxTickleManager::GetClientTickleInterval ( MxCore p_client)
virtual

[AI] Looks up the tickle interval of a registered client.

Parameters
p_clientThe object to query. [AI]
Returns
The interval in ms, or TICKLE_MANAGER_NOT_FOUND if not found. [AI]

Definition at line 109 of file mxticklemanager.cpp.

◆ RegisterClient()

void MxTickleManager::RegisterClient ( MxCore p_client,
MxTime  p_interval 
)
virtual

[AI] Registers an MxCore object to receive periodic tickles.

Parameters
p_clientObject to manage. [AI]
p_intervalTime in ms between tickles. [AI]

[AI] If the client is not already registered, adds it to the list. [AI]

Definition at line 67 of file mxticklemanager.cpp.

◆ SetClientTickleInterval()

void MxTickleManager::SetClientTickleInterval ( MxCore p_client,
MxTime  p_interval 
)
virtual

[AI] Changes the tickle interval of an already registered client.

Parameters
p_clientObject to update. [AI]
p_intervalNew interval in ms. [AI]

[AI] Only updates if client is not marked for destruction. [AI]

Definition at line 96 of file mxticklemanager.cpp.

◆ Tickle()

MxResult MxTickleManager::Tickle ( )
overridevirtual

[AI] Iterates over registered clients and invokes their Tickle() methods as needed.

[AI] For each client whose tickle interval has elapsed, MxTickleManager calls their Tickle() method and updates their last-tickled timestamp. Clients flagged for destruction are dropped.

Returns
SUCCESS if the tickle pass completes. [AI]

Reimplemented from MxCore.

Definition at line 36 of file mxticklemanager.cpp.

◆ UnregisterClient()

void MxTickleManager::UnregisterClient ( MxCore p_client)
virtual

[AI] Unregisters (marks for destruction) a previously registered client.

Parameters
p_clientObject to remove. [AI]

[AI] Sets a destruction flag on the tickle client entry, causing it to be deleted on the next tickle pass.

Definition at line 80 of file mxticklemanager.cpp.


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