19 m_param = p_param.
Clone();
55 if (m_queue ==
NULL) {
75 MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->
GetId());
76 if (it == m_listenerIds.end()) {
82 m_queue->push_back(notif);
93 if (m_sendList ==
NULL) {
105 while (m_sendList->size() != 0) {
107 m_sendList->pop_front();
119void MxNotificationManager::FlushPending(
MxCore* p_listener)
128 if (m_sendList !=
NULL) {
129 MxNotificationPtrList::iterator it = m_sendList->begin();
130 while (it != m_sendList->end()) {
135 m_sendList->erase(it++);
136 pending.push_back(notif);
144 MxNotificationPtrList::iterator it = m_queue->begin();
145 while (it != m_queue->end()) {
149 m_queue->erase(it++);
150 pending.push_back(notif);
159 while (pending.size() != 0) {
160 notif = pending.front();
172 MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->
GetId());
173 if (it != m_listenerIds.end()) {
177 m_listenerIds.push_back(p_listener->
GetId());
186 MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->
GetId());
188 if (it != m_listenerIds.end()) {
189 m_listenerIds.erase(it);
190 FlushPending(p_listener);
[AI] Base virtual class for all Mindscape engine (Mx) objects.
virtual MxLong Notify(MxParam &p_param)
[AI] Virtual callback notification mechanism.
MxU32 GetId()
[AI] Gets the unique (per-process) id assigned to this object instance.
[AI] Central registry and dispatcher of asynchronous notifications between MxCore objects.
MxNotificationManager()
[AI] Constructs a new NotificationManager, initializing all state to defaults.
MxResult Tickle() override
[AI] Processes and dispatches all queued notifications to their targets.
~MxNotificationManager() override
[AI] Destroys the NotificationManager.
void Unregister(MxCore *p_listener)
[AI] Removes a previously registered listener and flushes any pending notifications for it.
void Register(MxCore *p_listener)
[AI] Registers a listener object to receive notifications.
MxResult Send(MxCore *p_listener, const MxNotificationParam &p_param)
[AI] Queues a notification to be sent to a specific registered listener.
virtual MxResult Create(MxU32 p_frequencyMS, MxBool p_createThread)
[AI] Initializes the notification manager, setting up queues and optionally registering with the tick...
[AI] Parameter object representing a single notification or event, carrying an identifier and sender ...
MxCore * GetSender() const
[AI] Retrieves the sender pointer associated with this notification.
virtual MxNotificationParam * Clone() const
[AI] Creates a copy of this notification parameter object on the heap.
[AI] List of notification pointers used to queue notifications for delivery.
[AI] Carries a notification to be sent to a target MxCore object.
MxCore * GetTarget()
[AI] Returns the target of this notification.
MxNotification(MxCore *p_target, const MxNotificationParam &p_param)
[AI] Constructor for MxNotification.
~MxNotification()
[AI] Destructor for MxNotification.
MxNotificationParam * GetParam()
[AI] Returns the notification parameter (cloned by the notification).
virtual void UnregisterClient(MxCore *p_client)
[AI] Unregisters (marks for destruction) a previously registered client.
virtual void RegisterClient(MxCore *p_client, MxTime p_interval)
[AI] Registers an MxCore object to receive periodic tickles.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
MxTickleManager * TickleManager()
[AI] Provides access to the global tickle manager.