1 #ifndef PROTON_MESSAGE_HPP 2 #define PROTON_MESSAGE_HPP 26 #include "./internal/export.hpp" 27 #include "./duration.hpp" 28 #include "./timestamp.hpp" 29 #include "./value.hpp" 31 #include "./internal/cached_map.hpp" 32 #include "./internal/pn_unique_ptr.hpp" 34 #include <proton/type_compat.h> 51 class property_map :
public internal::cached_map<std::string, scalar> {};
55 class annotation_map :
public internal::cached_map<annotation_key, value> {};
61 PN_CPP_EXTERN
message(
const message&);
64 PN_CPP_EXTERN message&
operator=(
const message&);
66 #if PN_CPP_HAS_RVALUE_REFERENCES 67 PN_CPP_EXTERN
message(message&&);
71 PN_CPP_EXTERN message&
operator=(message&&);
78 PN_CPP_EXTERN ~message();
84 PN_CPP_EXTERN
void clear();
96 PN_CPP_EXTERN
void user(
const std::string &
user);
99 PN_CPP_EXTERN std::string
user()
const;
103 PN_CPP_EXTERN
void encode(std::vector<char> &bytes)
const;
106 PN_CPP_EXTERN std::vector<char>
encode()
const;
109 PN_CPP_EXTERN
void decode(
const std::vector<char> &bytes);
117 PN_CPP_EXTERN
void to(
const std::string &addr);
120 PN_CPP_EXTERN std::string
to()
const;
124 PN_CPP_EXTERN
void address(
const std::string &addr);
125 PN_CPP_EXTERN std::string address()
const;
129 PN_CPP_EXTERN
void reply_to(
const std::string &addr);
132 PN_CPP_EXTERN std::string
reply_to()
const;
155 PN_CPP_EXTERN
void subject(
const std::string &s);
158 PN_CPP_EXTERN std::string
subject()
const;
193 PN_CPP_EXTERN
bool inferred()
const;
207 PN_CPP_EXTERN
bool durable()
const;
210 PN_CPP_EXTERN
void durable(
bool);
231 PN_CPP_EXTERN uint8_t
priority()
const;
234 PN_CPP_EXTERN
void priority(uint8_t);
267 PN_CPP_EXTERN
void group_id(
const std::string &s);
270 PN_CPP_EXTERN std::string
group_id()
const;
324 pn_message_t *pn_msg()
const;
326 mutable pn_message_t *pn_msg_;
327 mutable internal::value_ref body_;
335 PN_CPP_EXTERN
friend void swap(message&, message&);
336 friend class messaging_adapter;
342 #endif // PROTON_MESSAGE_HPP duration ttl() const
Get the TTL.
An AMQP message.
Definition: message.hpp:47
message_id id() const
Get the message ID.
std::string to() const
Get the destination address.
std::string subject() const
Get the subject.
std::string user() const
Get the user name or ID.
A span of time in milliseconds.
Definition: duration.hpp:36
message_id correlation_id() const
Get the ID for matching related messages.
Experimental - A map of AMQP annotation keys and AMQP values.
Definition: message.hpp:55
void decode(const std::vector< char > &bytes)
Decode from string data into the message.
timestamp expiry_time() const
Get the expiration time.
annotation_map & message_annotations()
Experimental - Get the message annotations map.
annotation_map & delivery_annotations()
Experimental - Get the delivery annotations map.
A received message.
Definition: delivery.hpp:36
Experimental - A map of string keys and AMQP scalar values.
Definition: message.hpp:51
uint32_t delivery_count() const
Get the delivery count.
std::string reply_to_group_id() const
Get the reply-to group ID.
timestamp creation_time() const
Get the creation time.
std::string reply_to() const
Get the address for replies.
A 64-bit timestamp in milliseconds since the Unix epoch.
Definition: timestamp.hpp:32
bool durable() const
Get the durable flag.
A holder for any AMQP value, simple or complex.
Definition: value.hpp:55
message & operator=(const message &)
Copy a message.
void clear()
Clear the message content and properties.
uint8_t priority() const
Get the priority.
bool inferred() const
Get the inferred flag.
std::string content_encoding() const
Get the content encoding of the body.
static const uint8_t default_priority
Default priority assigned to new messages.
Definition: message.hpp:320
int32_t group_sequence() const
Get the group sequence.
std::string group_id() const
Get the message group ID.
property_map & properties()
Experimental - Get the application properties map.
std::vector< char > encode() const
Return encoded message as a byte vector.
bool first_acquirer() const
Get the first acquirer flag.
The main Proton namespace.
Definition: annotation_key.hpp:30
const value & body() const
Get the body.
An AMQP message ID.
Definition: message_id.hpp:44
std::string content_type() const
Get the content type of the body.
message()
Create an empty message.