|
sdi_toolBox
|
#include <message.h>
Base class for all messages dispatched through the event bus.
Every message circulating in the event bus system must derive from this class. It carries a unique message type identifier (MessageTypeID) used by the Bus to route the message to the appropriate subscribers, and a timestamp that is updated when the message is posted to the bus.
Public Member Functions | |
Construction & Destruction | |
| Message ()=delete | |
| Default constructor - deleted. | |
| virtual | ~Message ()=default |
| Default destructor. | |
| Message (const Message &obj)=delete | |
| Copy constructor - deleted. | |
| Message (Message &&obj) noexcept=delete | |
| Move constructor - deleted. | |
| Message & | operator= (const Message &obj)=delete |
| Copy assignment operator - deleted. | |
| Message & | operator= (Message &&obj) noexcept=delete |
| Move assignment operator - deleted. | |
| Message (MessageTypeID messageTypeID) | |
| Construct a message with the given type identifier. | |
Accessors | |
| MessageTypeID | getMessageTypeID () const |
| Get the unique type identifier of this message. | |
| TimePoint | getTimestamp () const |
| Get the timestamp of when this message was posted to the bus. | |
Friends | |
| class | Bus |
| Allow the Bus class to access private members. | |
|
delete |
Default constructor - deleted.
A MessageTypeID must always be provided at construction time.
|
virtualdefault |
Default destructor.
|
inlineexplicit |
Copy assignment operator - deleted.
Message is non-copyable.
Move assignment operator - deleted.
Message is non-movable.
|
inline |
Get the unique type identifier of this message.
|
inline |
Get the timestamp of when this message was posted to the bus.
The timestamp is recorded by the Bus when Bus::post() is called. It is left at its default-constructed (zero) value if the message has not yet been posted.