AbstractMessageType is a homogeneous message type handle to an existing message type. More...
#include <kanzi/core/message/abstract_message_type.hpp>
Public Types | |
| using | ArgumentsType = MessageArguments |
| Alias for associated message arguments class. More... | |
| using | FunctionType = function< void(MessageArguments &)> |
| Alias for compatible handler functions. More... | |
Public Member Functions | |
| AbstractMessageType ()=default | |
| Constructor. More... | |
| AbstractMessageType (string_view name) | |
| Constructor. More... | |
| AbstractMessageType (const AbstractMessageTypeDescriptor *descriptor) | |
| Constructor. More... | |
| const AbstractMessageTypeDescriptor * | get () const |
| Gets the AbstractMessageTypeDescriptor of the AbstractMessageType. More... | |
| const Metaclass * | getArgumentsMetaclass () const |
| Gets the metaclass of the message arguments associated with a message type. More... | |
| PropertyTypeEditorInfoSharedPtr | getEditorInfo () const |
| Gets the editor information for a message type. More... | |
| string | getName () const |
| Gets the fully qualified name of a message type in the form "Class.MessageType". More... | |
| MessageRouting | getRouting () const |
| Gets the message routing of a message type. More... | |
| operator bool () const | |
Friends | |
| template<typename T > | |
| class | DynamicMessageType |
| template<typename T > | |
| class | MessageType |
| bool | operator!= (const AbstractMessageType &left, const AbstractMessageType &right) |
| bool | operator< (const AbstractMessageType &left, const AbstractMessageType &right) |
| bool | operator== (const AbstractMessageType &left, const AbstractMessageType &right) |
AbstractMessageType is a homogeneous message type handle to an existing message type.
You can use AbstractMessageType to operate on message types when a message type and its arguments type are unknown or irrelevant. It is usually more convenient to pass AbstractMessageType as a function argument instead of specifying the exact message type with certain message arguments. MessageType has a converting operator to AbstractMessageType. This enables you to pass MessageType directly to functions taking AbstractMessageType argument.
You can query generic non-message arguments specific message type information from an instance of an AbstractMessageType. You can also dispatch messages from a node with an instance of AbstractMessageType. To add message handlers of specific type, you must construct a DynamicMessageType.
To construct an AbstractMessageType with a fully qualified message type name:
To dispatch a message using the created AbstractMessageType:
Alias for associated message arguments class.
| using kanzi::AbstractMessageType::FunctionType = function<void(MessageArguments&)> |
Alias for compatible handler functions.
|
explicitdefault |
Constructor.
Creates an empty AbstractMessageType instance.
|
inlineexplicit |
Constructor.
Creates an AbstractMessageType instance referring to an existing message type with the given name. If a message type with the given name does not already exist in the Kanzi message system, the created AbstractMessageType instance is empty.
| name | Fully qualified name of the message type. |
|
inlineexplicit |
Constructor.
Creates an AbstractMessageType instance referring to the given descriptor. If passed descriptor is null, the created AbstractMessageType instance is empty.
| descriptor | The descriptor for the message type. |
|
inline |
Gets the AbstractMessageTypeDescriptor of the AbstractMessageType.
|
inline |
Gets the editor information for a message type.
|
inline |
Gets the fully qualified name of a message type in the form "Class.MessageType".
|
inline |
Gets the message routing of a message type.
|
inline |
Gets the metaclass of the message arguments associated with a message type.
|
inlineexplicit |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |