MessageArguments is the base class for arguments passed in messages. More...
#include <kanzi/core.ui/message/message_arguments.hpp>
Classes | |
struct | ArgumentEntry |
Linked list entry containing arguments type and value. More... | |
Public Member Functions | |
bool | getAbstractArgument (AbstractPropertyType argumentType, Variant &variant) const |
Returns the value of an argument using AbstractPropertyType. More... | |
template<typename TDataType > | |
TDataType | getArgument (const PropertyType< TDataType > &argumentType) const |
Returns the value of an argument. More... | |
detail::MessageDispatcher * | getDispatcher () const |
Returns the message dispatcher that dispatches a message. More... | |
template<typename TDataType > | |
optional< TDataType > | getOptionalArgument (const PropertyType< TDataType > &argumentType) const |
Returns the value of an argument. More... | |
shared_ptr< Node > | getSource () const |
Returns the source node for a message. More... | |
TimePoint | getTimestamp () const |
Returns the timestamp of a message. More... | |
AbstractMessageType | getType () const |
Returns the message type of these message arguments as an AbstractMessageType instance. More... | |
bool | isFrom (const Node &source) const |
Returns whether a node is the source node of a message. More... | |
bool | isHandled () const |
Returns whether the message is handled. More... | |
bool | isValid () const |
Returns whether a message is valid. More... | |
MessageArguments ()=default | |
Constructor. More... | |
MessageArguments (const MessageArguments &)=delete | |
Deleted copy. More... | |
MessageArguments & | operator= (const MessageArguments &)=delete |
Deleted assignment. More... | |
void | setAbstractArgument (AbstractPropertyType argumentType, const Variant &variant) |
Sets the value of an argument using AbstractPropertyType. More... | |
template<typename TDataType > | |
void | setArgument (const PropertyType< TDataType > &argumentType, typename PropertyType< TDataType >::DataType value) |
Sets the value of an argument. More... | |
void | setDispatcher (detail::MessageDispatcher *dispatcher) |
Sets a dispatcher for a message. More... | |
void | setHandled (bool handled) |
Sets the handling status for a message. More... | |
void | setSource (Node *source) |
Sets the source node that dispatches a message. More... | |
void | setTimestamp (TimePoint timestamp) |
Sets the timestamp of a message. More... | |
void | setType (AbstractMessageType type) |
Sets the type of a message. More... | |
void | setValid (bool valid) |
Sets the validity of a message. More... | |
~MessageArguments () | |
Destructor. More... | |
Static Public Member Functions | |
static size_t | getArgumentAllocatorPoolSize () |
Gets the current size of memory pool of argument entries. More... | |
static const Metaclass * | getStaticMetaclass () |
Initializes and returns static metadata of base MessageArguments class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Initializes and returns the Kanzi Studio editor information. More... | |
MessageArguments is the base class for arguments passed in messages.
An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.
While MessageArguments is a base class where you can inherit your own specialized arguments, MessageType is a templated class which takes message argument type as its template parameter. In practice this means that each MessageType is linked with a certain MessageArguments type. You can derive your own arguments class or use the MessageArguments base class. Note that MessageArguments as a base class carries only the basic message information, such as the timestamp and source of the message. To dispatch any other data with your messages, inherit your own message arguments class.
You can link a message type with only one type of message arguments, but you can use a certain type of message arguments with multiple message types. See MessageType.
|
explicitdefault |
Constructor.
kanzi::MessageArguments::~MessageArguments | ( | ) |
Destructor.
|
delete |
Deleted copy.
|
delete |
Deleted assignment.
|
inline |
Returns the value of an argument.
argumentType | The PropertyType argument whose value to fetch. |
|
inline |
Returns the value of an argument.
argumentType | The PropertyType argument whose value to fetch. |
bool kanzi::MessageArguments::getAbstractArgument | ( | AbstractPropertyType | argumentType, |
Variant & | variant | ||
) | const |
Returns the value of an argument using AbstractPropertyType.
argumentType | The AbstractPropertyType argument whose value to get. |
variant | The variant where to store the message argument value. |
|
inline |
Sets the value of an argument.
argumentType | The PropertyType argument whose value to set. |
value | The value to set for the argument. |
void kanzi::MessageArguments::setAbstractArgument | ( | AbstractPropertyType | argumentType, |
const Variant & | variant | ||
) |
Sets the value of an argument using AbstractPropertyType.
argumentType | The AbstractPropertyType argument whose value to set. |
variant | The variant whose value to store to the message argument value. |
|
inline |
Returns whether a node is the source node of a message.
source | The node to check. |
shared_ptr<Node> kanzi::MessageArguments::getSource | ( | ) | const |
Returns the source node for a message.
|
inline |
Sets the handling status for a message.
handled | The new handling status. |
|
inline |
Returns whether the message is handled.
|
inline |
Returns the timestamp of a message.
|
inline |
Returns the message dispatcher that dispatches a message.
|
inline |
Returns the message type of these message arguments as an AbstractMessageType instance.
|
inline |
Sets the source node that dispatches a message.
source | The source of the message. |
|
inline |
Sets the timestamp of a message.
timestamp | The timestamp of the message. |
|
inline |
Sets the validity of a message.
valid | The validity of the message. |
|
inline |
Returns whether a message is valid.
|
inline |
Sets a dispatcher for a message.
dispatcher | Message dispatcher that dispatches the message. |
|
inline |
Sets the type of a message.
type | The type of the message. |
|
static |
Gets the current size of memory pool of argument entries.
|
static |
Initializes and returns static metadata of base MessageArguments class.
|
inlinestatic |
Initializes and returns the Kanzi Studio editor information.