15 #ifndef _DATAT_BITS_INCLUDE_TAG
16 #error Must only be included from sag_connectivity_cpp.hpp, use that instead
27 class Message:
protected sag_underlying_message_t
41 explicit Message(payload_t &&_payload);
46 Message(payload_t &&_payload, metadata_t &&_metadata);
50 Message(payload_t &&_payload, map_t &&_metadata);
67 swap(std::move(other));
75 const metadata_t &
getMetadata()
const {
return reinterpret_cast<const metadata_t&
>(metadata); }
78 payload_t &
getPayload() {
return static_cast<payload_t&
>(payload); }
82 metadata_t &
getMetadata() {
return reinterpret_cast<metadata_t&
>(metadata); }
86 const map_t &
getMetadataMap()
const {
return static_cast<const map_t&
>(metadata); }
117 return "sag.channel";
134 return "sag.control.type";
153 return "sag.messageId";
166 return "sag.requestId";
210 return "AckRequired";
Message copy() const
Return a deep copy of this message, payload and metadata.
Definition: message.hpp:105
void setPayload(payload_t &&_payload)
Set the payload.
A container for an payload and associated metadata.
Definition: message.hpp:27
static const char * CONTROL_TYPE_ACK_UPTO()
Name of the AckUpTo control message, a towards-transport control message in response to AckRequired...
Definition: message.hpp:224
Message & putMetadataValue(const char *key, const char *value)
Sets a value in the metadata.
payload_t & getPayload()
Return a reference to the payload.
Definition: message.hpp:78
const map_t & getMetadataMap() const
Return a view on the metadata which can contain non-string values.
Definition: message.hpp:86
~Message()
Free the underlying payload and metadata.
const payload_t & getPayload() const
Return a reference to the payload.
void setMetadata(metadata_t &&_metadata)
Set the metadata as metadata_t.
static const char * CONTROL_TYPE()
The metadata key indicating that a message is a control message, and what its type is...
Definition: message.hpp:133
A map class which implements many of the functions on std::map.
Definition: sag_connectivity_cpp.hpp:37
Message & operator=(Message &&other)
Move assignment from another message.
Definition: message.hpp:63
static const char * CHANNEL()
Returns the metadata key used by the host for identifying the channel of the message - "sag...
Definition: message.hpp:116
Message()
Construct an empty message.
Message & putMetadataValue(const std::string &key, const std::string &value)
Sets a value in the metadata.
Definition: message.hpp:246
com::softwareag::connectivity::metadata_t metadata_t
The type of a message metadata.
Definition: message.hpp:31
data_t payload_t
The type of a message payload.
Definition: message.hpp:34
static const char * MESSAGE_ID()
The metadata key used for unique identification of towards-host messages.
Definition: message.hpp:152
map_t & getMetadataMap()
Return a view on the metadata which can contain non-string values.
Definition: message.hpp:84
A variant type which can be one of the following:
Definition: data_t.hpp:42
static const char * CONTROL_TYPE_FLUSH()
Name of the Flush control message, a towards-transport control message.
Definition: message.hpp:180
void swap(Message &&other)
Swap the contents of this message with another.
static const char * REQUEST_ID()
The metadata key used for unique identification of towards-transport control messages, with a value of type int64_t.
Definition: message.hpp:165
static const char * HOST_MESSAGE_TYPE()
Returns the metadata key used by the host for identifying the type of the message - "sag...
Definition: message.hpp:111
const metadata_t & getMetadata() const
Definition: message.hpp:75
static const char * CONTROL_TYPE_FLUSH_ACK()
Name of the FlushAck control message, a towards-host control message in response to Flush...
Definition: message.hpp:194
static const char * CONTROL_TYPE_ACK_REQUIRED()
Name of the AckRequired control message, a towards-host control message.
Definition: message.hpp:209
metadata_t & getMetadata()
Definition: message.hpp:82