Class used to forward messages to receivers This class is used to forward a message to receivers. A message will only be forwared to registered receivers. Receivers will only get messages from the senders and message types they want to be notified.
More...
#include "aMessenger.h"
|
| aMessenger () |
| Default constructor.
|
|
virtual | ~aMessenger () |
| Deconstructor.
|
|
void | sendMessage (UID _senderId, eventType _event, int _info1=0, int _info2=0) |
| Will forward the message to all registered receivers The sender id will be compared with the registered receivers in the receivers map. If a receivers was found, the message Type will be compared with the registered message types at the found receivers. If also the message type was found, the message will be forwareded to all receivers in the vector at the registered message type map entry.
|
|
void | registerUidReceiver (UID _senderId, aNotifier *_notifier) |
| Will register a receiver for a the specified sender If a message is received by this object, only receivers with the matching sender UID.
|
|
void | registerEventTypeReceiver (eventType _eventType, aNotifier *_notifier) |
| Will register a receiver for a specified sender.
|
|
void | registerNotifierForAllMessages (aNotifier *_notifier) |
| Will register a receiver for every single message send.
|
|
int | uidNotifierCount (UID _senderUID) |
| Will return the count of registered notifiers for a specific sender.
|
|
int | eventNotifierCount (eventType _event) |
| Will return the count of registered notifiers for a specific sender.
|
|
void | clearAll (void) |
| Will remove all notifiers from the messaging system.
|
|
void | enable (void) |
| Will enable the messenger.
|
|
void | disable (void) |
| Will disable the messenger.
|
|
void | setEnabled (bool _enabled) |
| Will set the messengers enabled state.
|
|
bool | isEnabled (void) const |
| Will return the current enabled state of the messenger.
|
|
Class used to forward messages to receivers This class is used to forward a message to receivers. A message will only be forwared to registered receivers. Receivers will only get messages from the senders and message types they want to be notified.
◆ aMessenger()
ak::aMessenger::aMessenger |
( |
| ) |
|
◆ ~aMessenger()
ak::aMessenger::~aMessenger |
( |
| ) |
|
|
virtual |
◆ clearAll()
void ak::aMessenger::clearAll |
( |
void | | ) |
|
Will remove all notifiers from the messaging system.
◆ disable()
void ak::aMessenger::disable |
( |
void | | ) |
|
|
inline |
Will disable the messenger.
◆ enable()
void ak::aMessenger::enable |
( |
void | | ) |
|
|
inline |
Will enable the messenger.
◆ eventNotifierCount()
int ak::aMessenger::eventNotifierCount |
( |
eventType | _event | ) |
|
Will return the count of registered notifiers for a specific sender.
- Parameters
-
◆ isEnabled()
bool ak::aMessenger::isEnabled |
( |
void | | ) |
const |
|
inline |
Will return the current enabled state of the messenger.
◆ registerEventTypeReceiver()
void ak::aMessenger::registerEventTypeReceiver |
( |
eventType | _eventType, |
|
|
aNotifier * | _notifier ) |
Will register a receiver for a specified sender.
- Parameters
-
_eventType | The event type for what to register this receiver |
_notifier | The notifier to register |
◆ registerNotifierForAllMessages()
void ak::aMessenger::registerNotifierForAllMessages |
( |
aNotifier * | _notifier | ) |
|
Will register a receiver for every single message send.
- Parameters
-
_notifier | The notifier to register |
◆ registerUidReceiver()
void ak::aMessenger::registerUidReceiver |
( |
UID | _senderId, |
|
|
aNotifier * | _notifier ) |
Will register a receiver for a the specified sender If a message is received by this object, only receivers with the matching sender UID.
- Parameters
-
_senderId | The id of the sender the notifier wants to receive the message from |
_messageType | The type of the message which the notifier wants to receive |
_notifier | The notifier which is receiving the message |
◆ sendMessage()
void ak::aMessenger::sendMessage |
( |
UID | _senderId, |
|
|
eventType | _event, |
|
|
int | _info1 = 0, |
|
|
int | _info2 = 0 ) |
Will forward the message to all registered receivers The sender id will be compared with the registered receivers in the receivers map. If a receivers was found, the message Type will be compared with the registered message types at the found receivers. If also the message type was found, the message will be forwareded to all receivers in the vector at the registered message type map entry.
- Parameters
-
_senderId | The id of the object the message is coming from |
_messageType | The type of the message which is transmitted |
_message | The message to be transmitted |
_info1 | The massage info 1 |
_info2 | The message info 2 |
◆ setEnabled()
void ak::aMessenger::setEnabled |
( |
bool | _enabled | ) |
|
|
inline |
Will set the messengers enabled state.
- Parameters
-
_enabled | The enabled state to set |
◆ uidNotifierCount()
int ak::aMessenger::uidNotifierCount |
( |
UID | _senderUID | ) |
|
Will return the count of registered notifiers for a specific sender.
- Parameters
-
The documentation for this class was generated from the following files: