1#ifndef PROTON_MESSAGE_HPP
2#define PROTON_MESSAGE_HPP
26#include "./internal/export.hpp"
32#include <proton/type_compat.h>
93 PN_CPP_EXTERN
void user(
const std::string&);
96 PN_CPP_EXTERN std::string
user()
const;
100 PN_CPP_EXTERN
void encode(std::vector<char>&)
const;
103 PN_CPP_EXTERN std::vector<char>
encode()
const;
106 PN_CPP_EXTERN
void decode(
const std::vector<char>&);
114 PN_CPP_EXTERN
void to(
const std::string&);
117 PN_CPP_EXTERN std::string
to()
const;
121 PN_CPP_EXTERN
void address(
const std::string&);
122 PN_CPP_EXTERN std::string address()
const;
152 PN_CPP_EXTERN
void subject(
const std::string&);
322 pn_message_t* pn_msg()
const;
323 struct impl& impl()
const;
325 mutable pn_message_t* pn_msg_;
A span of time in milliseconds.
Definition duration.hpp:39
A collection of key-value pairs.
Definition map.hpp:69
An AMQP message ID.
Definition message_id.hpp:47
An AMQP message.
Definition message.hpp:48
void encode(std::vector< char > &) const
Encode entire message into a byte vector, growing it if necessary.
message & operator=(message &&)
Move a message.
map< std::string, scalar > property_map
A map of string keys and AMQP scalar values.
Definition message.hpp:51
bool inferred() const
Get the inferred flag.
void user(const std::string &)
Set the user name or ID.
void inferred(bool)
Set the inferred flag.
timestamp creation_time() const
Get the creation time.
static const uint8_t default_priority
Default priority assigned to new messages.
Definition message.hpp:314
std::vector< char > encode() const
Return encoded message as a byte vector.
void group_sequence(int32_t)
Set the group sequence for a message.
void to(const std::string &)
Set the destination address.
void subject(const std::string &)
Set the subject.
map< annotation_key, value > annotation_map
A map of AMQP annotation keys and AMQP values.
Definition message.hpp:54
void reply_to(const std::string &)
Set the address for replies.
void expiry_time(timestamp)
Set the expiration time.
const annotation_map & delivery_annotations() const
Examine the delivery annotations map.
void content_encoding(const std::string &)
Set the content encoding of the body.
void creation_time(timestamp)
Set the creation time.
void decode(const std::vector< char > &)
Decode from string data into the message.
bool durable() const
Get the durable flag.
message(const message &)
Copy a message.
void ttl(duration)
Set the TTL.
std::string group_id() const
Get the message group ID.
bool first_acquirer() const
Get the first acquirer flag.
void first_acquirer(bool)
Set the first acquirer flag.
void priority(uint8_t)
Set the priority.
const annotation_map & message_annotations() const
Examine the message annotations map.
timestamp expiry_time() const
Get the expiration time.
duration ttl() const
Get the TTL.
std::string to() const
Get the destination address.
void reply_to_group_id(const std::string &)
Set the reply-to group ID.
std::string subject() const
Get the subject.
void id(const message_id &)
Set the message ID.
annotation_map & delivery_annotations()
Get the delivery annotations map.
void durable(bool)
Set the durable flag.
std::string user() const
Get the user name or ID.
std::string content_type() const
Get the content type of the body.
std::string reply_to_group_id() const
Get the reply-to group ID.
message & operator=(const message &)
Copy a message.
property_map & properties()
Get the application properties map.
message(const value &x)
Create a message with its body set from any value that can be converted to a proton::value.
void delivery_count(uint32_t)
Get the delivery count.
std::string content_encoding() const
Get the content encoding of the body.
uint8_t priority() const
Get the priority.
uint32_t delivery_count() const
Get the delivery count.
message()
Create an empty message.
const property_map & properties() const
Examine the application properties map.
void group_id(const std::string &)
Set the message group ID.
message(message &&)
Move a message.
void clear()
Clear the message content and properties.
annotation_map & message_annotations()
Get the message annotations map.
void correlation_id(const message_id &)
Set the ID for matching related messages.
const value & body() const
Get the body.
value & body()
Get a reference to the body that can be modified in place.
message_id id() const
Get the message ID.
friend std::ostream & operator<<(std::ostream &, const message &)
Human readable string representation.
void body(const value &x)
Set the body. Equivalent to body() = x.
void content_type(const std::string &)
Set the content type of the body.
message_id correlation_id() const
Get the ID for matching related messages.
int32_t group_sequence() const
Get the group sequence.
std::string reply_to() const
Get the address for replies.
A 64-bit timestamp in milliseconds since the Unix epoch.
Definition timestamp.hpp:35
A holder for any AMQP value, simple or complex.
Definition value.hpp:57
A span of time in milliseconds.
A collection of key-value pairs.
The main Proton namespace.
Definition annotation_key.hpp:33
std::string to_string(const message &)
Human readable string representation.
void swap(map< K, T > &, map< K, T > &)
Swap proton::map instances.
A 64-bit timestamp in milliseconds since the Unix epoch.
A holder for any AMQP value, simple or complex.