Isle
|
[AI] Central registry and dispatcher of asynchronous notifications between MxCore objects. More...
#include <mxnotificationmanager.h>
Public Member Functions | |
MxNotificationManager () | |
[AI] Constructs a new NotificationManager, initializing all state to defaults. More... | |
~MxNotificationManager () override | |
[AI] Destroys the NotificationManager. More... | |
MxResult | Tickle () override |
[AI] Processes and dispatches all queued notifications to their targets. More... | |
virtual MxResult | Create (MxU32 p_frequencyMS, MxBool p_createThread) |
[AI] Initializes the notification manager, setting up queues and optionally registering with the tickle manager. More... | |
void | Register (MxCore *p_listener) |
[AI] Registers a listener object to receive notifications. More... | |
void | Unregister (MxCore *p_listener) |
[AI] Removes a previously registered listener and flushes any pending notifications for it. More... | |
MxResult | Send (MxCore *p_listener, const MxNotificationParam &p_param) |
[AI] Queues a notification to be sent to a specific registered listener. More... | |
MxNotificationPtrList * | GetQueue () |
[AI] Returns a pointer to the current notification queue (for debug/inspection). More... | |
void | SetActive (MxBool p_active) |
[AI] Sets the notification manager active or inactive. More... | |
MxBool | IsEmpty () const |
[AI] Returns whether the notification queue is empty. More... | |
![]() | |
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... | |
[AI] Central registry and dispatcher of asynchronous notifications between MxCore objects.
[AI] Forward declaration for a manager used to send or process notifications throughout the engine.
[AI]
[AI] Manages an internal queue of notifications, a thread lock for concurrency, and the registration of observers (listeners). Responsible for routing queued notifications to the correct object on each tick.
Definition at line 66 of file mxnotificationmanager.h.
MxNotificationManager::MxNotificationManager | ( | ) |
[AI] Constructs a new NotificationManager, initializing all state to defaults.
[AI]
Definition at line 30 of file mxnotificationmanager.cpp.
|
override |
[AI] Destroys the NotificationManager.
Flushes notifications, cleans up memory, and unregisters itself from the tickle manager. [AI]
Definition at line 39 of file mxnotificationmanager.cpp.
[AI] Initializes the notification manager, setting up queues and optionally registering with the tickle manager.
[AI]
p_frequencyMS | The tick frequency (ms) to process notifications. [AI] |
p_createThread | Whether to create an internal thread for processing. [AI] |
Definition at line 50 of file mxnotificationmanager.cpp.
|
inline |
[AI] Returns a pointer to the current notification queue (for debug/inspection).
[AI]
Definition at line 126 of file mxnotificationmanager.h.
|
inline |
[AI] Returns whether the notification queue is empty.
[AI]
Definition at line 138 of file mxnotificationmanager.h.
void MxNotificationManager::Register | ( | MxCore * | p_listener | ) |
[AI] Registers a listener object to receive notifications.
[AI]
p_listener | Pointer to the MxCore-derived listener object to register. |
[AI] Registers the object's ID; only registered listeners may be sent notifications. Thread-safe.
Definition at line 168 of file mxnotificationmanager.cpp.
MxResult MxNotificationManager::Send | ( | MxCore * | p_listener, |
const MxNotificationParam & | p_param | ||
) |
[AI] Queues a notification to be sent to a specific registered listener.
[AI]
p_listener | Target listener object (must be registered) [AI] |
p_param | Notification parameter (will be cloned inside the notification) [AI] |
Definition at line 67 of file mxnotificationmanager.cpp.
|
inline |
[AI] Sets the notification manager active or inactive.
[AI]
p_active | If FALSE, prevents notifications from being queued or dispatched. [AI] |
Definition at line 132 of file mxnotificationmanager.h.
|
overridevirtual |
[AI] Processes and dispatches all queued notifications to their targets.
[AI]
[AI] Called by the tickle loop to flush the notification queue, invoking Notify(param) on each registered target. Thread-safe.
Reimplemented from MxCore.
Definition at line 90 of file mxnotificationmanager.cpp.
void MxNotificationManager::Unregister | ( | MxCore * | p_listener | ) |
[AI] Removes a previously registered listener and flushes any pending notifications for it.
[AI]
p_listener | Pointer to the listener object (to remove by ID). [AI] |
[AI] Also flushes any queued (but undelivered) notifications intended for this object. Thread-safe.
Definition at line 182 of file mxnotificationmanager.cpp.