Apama
9.12.0.5
|
A container for an payload and associated metadata. More...
#include <sag_connectivity_cpp.hpp>
Inherits sag_underlying_message_t.
Public Types | |
typedef com::softwareag::connectivity::metadata_t | metadata_t |
The type of a message metadata. More... | |
typedef data_t | payload_t |
The type of a message payload. More... | |
Public Member Functions | |
Message () | |
Construct an empty message. More... | |
Message (payload_t &&_payload) | |
Construct a message from a payload. More... | |
Message (payload_t &&_payload, metadata_t &&_metadata) | |
Construct a message from a payload and metadata. More... | |
~Message () | |
Free the underlying payload and metadata. More... | |
Message (Message &&other) | |
Move constructor from another message. More... | |
Message & | operator= (Message &&other) |
Move assignment from another message. More... | |
const payload_t & | getPayload () const |
Return a reference to the payload. More... | |
const metadata_t & | getMetadata () const |
Return a reference to the metadata. More... | |
payload_t & | getPayload () |
Return a reference to the payload. More... | |
metadata_t & | getMetadata () |
Return a reference to the metadata. More... | |
void | setPayload (payload_t &&_payload) |
Set the payload. More... | |
void | setMetadata (metadata_t &&_metadata) |
Set the metadata. More... | |
void | swap (Message &&other) |
Swap the contents of this message with another. More... | |
Message | copy () const |
Return a deep copy of this message, payload and metadata. More... | |
Message & | putMetadataValue (const char *key, const char *value) |
Sets a value in the metadata. More... | |
Message & | putMetadataValue (data_t &&key, data_t &&value) |
Sets a value in the metadata. More... | |
Message & | putMetadataValue (const std::string &key, const std::string &value) |
Sets a value in the metadata. More... | |
Static Public Member Functions | |
static const char * | HOST_MESSAGE_TYPE () |
Returns the metadata key used by the host for identifying the type of the message - "sag.type". More... | |
static const char * | CHANNEL () |
Returns the metadata key used by the host for identifying the channel of the message - "sag.channel". More... | |
A container for an payload and associated metadata.
This class is not thread-safe, so users are required to ensure that each instance of Message is only accessed by the codec or transport plug-in that currently owns it, and that only one thread is accessing it at any one time.
typedef com::softwareag::connectivity::metadata_t com::softwareag::connectivity::Message::metadata_t |
The type of a message metadata.
The type of a message payload.
com::softwareag::connectivity::Message::Message | ( | ) |
Construct an empty message.
|
explicit |
Construct a message from a payload.
This is a move constructor so the the argument will be left in an empty state. If you do not want this .copy() otherwise use std::move()
com::softwareag::connectivity::Message::Message | ( | payload_t && | _payload, |
metadata_t && | _metadata | ||
) |
Construct a message from a payload and metadata.
This is a move constructor so the the argument will be left in an empty state. If you do not want this use .copy() otherwise use std::move()
com::softwareag::connectivity::Message::~Message | ( | ) |
Free the underlying payload and metadata.
com::softwareag::connectivity::Message::Message | ( | Message && | other | ) |
Move constructor from another message.
The argument will be left in an empty state. If you do not want this use .copy() otherwise use std::move().
|
inlinestatic |
Returns the metadata key used by the host for identifying the channel of the message - "sag.channel".
|
inline |
Return a deep copy of this message, payload and metadata.
const metadata_t& com::softwareag::connectivity::Message::getMetadata | ( | ) | const |
Return a reference to the metadata.
|
inline |
Return a reference to the metadata.
const payload_t& com::softwareag::connectivity::Message::getPayload | ( | ) | const |
Return a reference to the payload.
|
inline |
Return a reference to the payload.
|
inlinestatic |
Returns the metadata key used by the host for identifying the type of the message - "sag.type".
Move assignment from another message.
The argument will be left in an empty state and our old contents freed. If you do not want this use .copy() otherwise use std::move().
Message& com::softwareag::connectivity::Message::putMetadataValue | ( | const char * | key, |
const char * | value | ||
) |
Sets a value in the metadata.
Note this overwrites a previous value if it exists, unlike the insert method on metadata_t.
|
inline |
Sets a value in the metadata.
Note this overwrites a previous value if it exists, unlike the insert method on metadata_t.
void com::softwareag::connectivity::Message::setMetadata | ( | metadata_t && | _metadata | ) |
Set the metadata.
This is a move operation so the argument will be left in an empty state and the old metadata freed If you do not want this .copy() otherwise use std::move()
void com::softwareag::connectivity::Message::setPayload | ( | payload_t && | _payload | ) |
Set the payload.
This is a move operation so the argument will be left in an empty state and the old payload freed If you do not want this .copy() otherwise use std::move()
void com::softwareag::connectivity::Message::swap | ( | Message && | other | ) |
Swap the contents of this message with another.