7#if !defined(ASYNC_MQTT_PACKET_WILL_HPP)
8#define ASYNC_MQTT_PACKET_WILL_HPP
10#include <async_mqtt/buffer.hpp>
12#include <async_mqtt/packet/property_variant.hpp>
13#include <async_mqtt/util/json_like_out.hpp>
32 pub::opts pubopts = {},
35 :topic_{force_move(topic)},
36 message_{force_move(message)},
38 props_(force_move(props))
41 constexpr buffer
const& topic()
const {
44 constexpr buffer& topic() {
47 constexpr buffer
const& message()
const {
50 constexpr buffer& message() {
53 constexpr pub::retain get_retain()
const {
56 constexpr qos get_qos()
const {
59 constexpr properties
const& props()
const {
62 constexpr properties& props() {
67 bool operator==(will
const& lhs, will
const& rhs) {
69 std::tie(lhs.topic_, lhs.message_, lhs.pubopts_, lhs.props_) ==
70 std::tie(rhs.topic_, rhs.message_, rhs.pubopts_, rhs.props_);
74 bool operator<(will
const& lhs, will
const& rhs) {
76 std::tie(lhs.topic_, lhs.message_, lhs.pubopts_, lhs.props_) <
77 std::tie(rhs.topic_, rhs.message_, rhs.pubopts_, rhs.props_);
87inline std::ostream& operator<<(std::ostream& o, will
const& val) {
89 "topic:" << val.topic() <<
"," <<
90 "message:" << json_like_out(val.message()) <<
"," <<
91 "qos:" << val.get_qos() <<
"," <<
92 "retain:" << val.get_retain();
93 if (!val.props().empty()) {
94 o <<
",ps:" << val.props();
qos
MQTT QoS.
Definition qos.hpp:23
constexpr retain get_retain() const
Get retain.
Definition pubopts.hpp:161
constexpr qos get_qos() const
Get qos.
Definition pubopts.hpp:177