![]() |
FormIt C++ API
v23.0.0 (2023.0.0)
|
FormIt::MessageListener class.
#include <FormItMessaging.h>
Public Types | |
using | MessageStruct = FormIt::MessageStruct |
using | MessagePayloadStruct = FormIt::MessagePayloadStruct |
using | MessageHandlerFunc = 1::function< void(MessageStruct const &message, MessagePayloadStruct const &)> |
Public Member Functions | |
MessageListener (int priority=0) | |
Constructor also sets the listener priority. More... | |
virtual | ~MessageListener () |
The destructor unsubscribes this listener from all messages in the broadcaster. More... | |
virtual void | ReceiveMessage (MessageStruct const &message, MessagePayloadStruct const &payload) |
The purpose of this class. More... | |
void | ReceiveAllMessages (MessageStruct const &message, MessagePayloadStruct const &payload) |
void | Subscribe (MessageStruct const &message) |
Convenience method for calling in to the MessageBroadcaster from within the Listener. More... | |
void | Subscribe (MessageStruct const &message, MessageHandlerFunc const &func) |
Convenience method for calling in to the MessageBroadcaster from within the Listener. More... | |
void | Subscribe (1::string const &message, MessageHandlerFunc const &func) |
Convenience method for calling in to the MessageBroadcaster from within the Listener. More... | |
void | Subscribe (1::string const &message) |
void | SubscribeAllMessages (MessageHandlerFunc const &func) |
void | Unsubscribe (1::string const &message) |
Convenience method for calling in to the MessageBroadcaster from within the Listener. More... | |
int | ListenerPriority () const |
Gets the listener priority. More... | |
using FormIt::MessageListener::MessageHandlerFunc = 1::function<void(MessageStruct const &message, MessagePayloadStruct const &)> |
|
inline |
Constructor also sets the listener priority.
Listeners are called lowest number to highest, so lowest number wins. Priority needs to be set before Subscribe, as Subscribe sorts by priority
|
inlinevirtual |
The destructor unsubscribes this listener from all messages in the broadcaster.
|
inline |
Gets the listener priority.
Listeners are called lowest number to highest, so lowest number wins.
|
inline |
|
inlinevirtual |
The purpose of this class.
|
inline |
Convenience method for calling in to the MessageBroadcaster from within the Listener.
|
inline |
Convenience method for calling in to the MessageBroadcaster from within the Listener.
|
inline |
Convenience method for calling in to the MessageBroadcaster from within the Listener.
|
inline |
|
inline |
|
inline |
Convenience method for calling in to the MessageBroadcaster from within the Listener.