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

MxEventManager is a subclass of MxMediaManager responsible for managing timed event delivery, either via cooperative thread or tickle-based mechanism. More...

#include <mxeventmanager.h>

Inheritance diagram for MxEventManager:
Collaboration diagram for MxEventManager:

Public Member Functions

 MxEventManager ()
 Constructor for MxEventManager. More...
 
 ~MxEventManager () override
 Destructor for MxEventManager. More...
 
void Destroy () override
 Tears down the event manager and releases resources/thread/registration. More...
 
virtual MxResult Create (MxU32 p_frequencyMS, MxBool p_createThread)
 Initializes the MxEventManager to periodically handle events using a thread or registration with the tickle manager. More...
 
- Public Member Functions inherited from MxMediaManager
 MxMediaManager ()
 [AI] Constructor. More...
 
 ~MxMediaManager () override
 [AI] Destructor. More...
 
MxResult Tickle () override
 [AI] Called by the tickle manager to step through and update all presenters, and process their output data. More...
 
virtual MxResult Create ()
 [AI] Allocates and initializes the internal presenter list for this manager, ensuring thread safety. More...
 
virtual void Destroy ()
 [AI] Destroys all registered presenters and resets the internal state, ensuring safe resource disposal. More...
 
virtual void RegisterPresenter (MxPresenter &p_presenter)
 [AI] Register a new presenter for tickle management and playback coordination. More...
 
virtual void UnregisterPresenter (MxPresenter &p_presenter)
 [AI] Remove a presenter from tickle and managed output lists. More...
 
virtual void StopPresenters ()
 [AI] Stops/ends the action on all registered presenters, typically halting all playback and output. More...
 
MxResult Init ()
 [AI] Initializes all internal members to their default values. 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...
 

Additional Inherited Members

- Protected Attributes inherited from MxMediaManager
MxPresenterListm_presenters
 [AI] Pointer to list of currently registered (active) presenters. More...
 
MxThreadm_thread
 [AI] Optional pointer to a worker thread used for media dispatch/IO (if multi-threaded operation is used, otherwise NULL). More...
 
MxCriticalSection m_criticalSection
 [AI] Critical section object used for guarding access to the presenter list and internal members for thread safety. More...
 

Detailed Description

MxEventManager is a subclass of MxMediaManager responsible for managing timed event delivery, either via cooperative thread or tickle-based mechanism.

[AI] Forward declaration for the global event manager responsible for in-game event queueing and dispatch.

[AI]

[AI] MxEventManager coordinates the delivery of "tickles" (periodic updates) to its clients. It supports both threaded and non-threaded operation modes. When in threaded mode, it creates a dedicated MxTickleThread to drive regular tickles at the specified frequency. In non-threaded mode, it registers itself with the global MxTickleManager for update calls. MxEventManager provides initialization, teardown, and resource-control logic, aiming to abstract event (tick) management for the application subsystems, usually presenting media or handling real-time updates. [AI]

Definition at line 14 of file mxeventmanager.h.

Constructor & Destructor Documentation

◆ MxEventManager()

MxEventManager::MxEventManager ( )

Constructor for MxEventManager.

[AI]

[AI] Initializes the event manager, setting up internal state and preparing for possible event handling logic. The Init() function is called during construction. [AI]

Definition at line 9 of file mxeventmanager.cpp.

◆ ~MxEventManager()

MxEventManager::~MxEventManager ( )
override

Destructor for MxEventManager.

[AI]

[AI] Cleans up any allocated resources or threads and deregisters itself from tickle management if necessary. Calls Destroy(TRUE). [AI]

Definition at line 15 of file mxeventmanager.cpp.

Member Function Documentation

◆ Create()

MxResult MxEventManager::Create ( MxU32  p_frequencyMS,
MxBool  p_createThread 
)
virtual

Initializes the MxEventManager to periodically handle events using a thread or registration with the tickle manager.

[AI]

Parameters
p_frequencyMSFrequency, in milliseconds, at which to issue tickles/updates. [AI]
p_createThreadIf TRUE, creates a dedicated thread for event ticks. If FALSE, registers with tickle manager to be tickled at specified frequency. [AI]
Returns
Returns SUCCESS or FAILURE, depending on resource allocation success and thread or registration initialization. [AI]

[AI] If p_createThread is TRUE, locks the critical section and begins a new MxTickleThread instance to handle tickling. If FALSE, registers this instance as a client with the singleton tickle manager. Destroys instance if initialization fails. [AI]

Definition at line 43 of file mxeventmanager.cpp.

◆ Destroy()

void MxEventManager::Destroy ( )
overridevirtual

Tears down the event manager and releases resources/thread/registration.

[AI]

[AI] Calls the internal Destroy(FALSE) routine, which will properly release the tickle thread, deregister from the tickle manager, and destroy base class objects if not from the destructor context. [AI]

Reimplemented from MxMediaManager.

Definition at line 79 of file mxeventmanager.cpp.


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