7#if !defined(ASYNC_MQTT_PACKET_SUBOPTS_HPP)
8#define ASYNC_MQTT_PACKET_SUBOPTS_HPP
38enum class rap : std::uint8_t
49enum class nl : std::uint8_t
61 constexpr opts() =
delete;
64 constexpr opts(
opts const&) =
default;
65 constexpr opts& operator=(
opts &&) =
default;
66 constexpr opts& operator=(
opts const&) =
default;
154 {
return static_cast<enum rap>(data_ & 0b00001000); }
162 {
return static_cast<enum nl>(data_ & 0b00000100); }
170 {
return static_cast<enum qos>(data_ & 0b00000011); }
177 explicit constexpr operator std::uint8_t()
const {
return data_; }
263 case retain_handling::send:
return "send";
264 case retain_handling::send_only_new_subscription:
return "send_only_new_subscription";
265 case retain_handling::not_send:
return "not_send";
266 default:
return "invalid_retain_handling";
277 os << retain_handling_to_str(val);
287 case rap::dont:
return "dont";
288 case rap::retain:
return "retain";
289 default:
return "invalid_rap";
300 os << rap_to_str(val);
310 case nl::no:
return "no";
311 case nl::yes:
return "yes";
312 default:
return "invalid_nl";
323 os << nl_to_str(val);
Definition packet_variant.hpp:49
qos
MQTT QoS.
Definition qos.hpp:23
MQTT SubscribeOptions.
Definition subopts.hpp:60
constexpr opts & operator|=(rap rhs)
Combine opts operator.
Definition subopts.hpp:130
constexpr char const * nl_to_str(nl v)
stringize nl
Definition subopts.hpp:308
constexpr char const * retain_handling_to_str(retain_handling v)
stringize retain_handling
Definition subopts.hpp:261
constexpr bool operator<(opts rhs) const
less than operator
Definition subopts.hpp:187
constexpr opts operator|(retain_handling rhs) const
Combine opts operator.
Definition subopts.hpp:105
constexpr opts(qos value)
constructor
Definition subopts.hpp:96
constexpr opts & operator|=(retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:126
constexpr opts operator|(nl lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:229
std::ostream & operator<<(std::ostream &os, nl val)
output to the stream nl
Definition subopts.hpp:321
constexpr opts operator|(retain_handling lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:202
constexpr opts(std::uint8_t value)
constructor
Definition subopts.hpp:72
std::ostream & operator<<(std::ostream &os, rap val)
output to the stream rap
Definition subopts.hpp:298
constexpr opts operator|(rap rhs) const
Combine opts operator.
Definition subopts.hpp:109
constexpr opts operator|(qos rhs) const
Combine opts operator.
Definition subopts.hpp:117
constexpr opts operator|(rap lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:213
constexpr bool operator==(opts rhs) const
equal operator
Definition subopts.hpp:182
constexpr opts operator|(qos lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:245
constexpr opts & operator|=(opts rhs)
Combine opts operator.
Definition subopts.hpp:122
constexpr opts operator|(nl rhs) const
Combine opts operator.
Definition subopts.hpp:113
constexpr opts & operator|=(nl rhs)
Combine opts operator.
Definition subopts.hpp:134
std::ostream & operator<<(std::ostream &os, retain_handling val)
output to the stream retain_handling
Definition subopts.hpp:275
constexpr opts operator|(rap lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:218
constexpr opts operator|(qos lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:250
constexpr opts operator|(retain_handling lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:207
constexpr opts(rap value)
constructor
Definition subopts.hpp:84
constexpr operator std::uint8_t() const
Get byte image.
Definition subopts.hpp:177
constexpr opts operator|(retain_handling lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:197
constexpr opts & operator|=(qos rhs)
Combine opts operator.
Definition subopts.hpp:138
constexpr char const * rap_to_str(rap v)
stringize rap
Definition subopts.hpp:285
constexpr opts operator|(opts rhs) const
Combine opts operator.
Definition subopts.hpp:101
constexpr opts(retain_handling value)
constructor
Definition subopts.hpp:78
constexpr retain_handling get_retain_handling() const
Get retain_handling.
Definition subopts.hpp:145
constexpr opts operator|(nl lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:234
constexpr qos get_qos() const
Get qos.
Definition subopts.hpp:169
constexpr opts operator|(nl lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:239
constexpr rap get_rap() const
Get rap.
Definition subopts.hpp:153
constexpr nl get_nl() const
Get nl.
Definition subopts.hpp:161
constexpr opts operator|(rap lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:223
constexpr opts operator|(qos lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:255
constexpr opts(nl value)
constructor
Definition subopts.hpp:90
nl
MQTT NoLocal.
Definition subopts.hpp:50
rap
MQTT RetainAsPublished.
Definition subopts.hpp:39
@ dont
Retain is set to 0 delivery on publish by the broker. Same as MQTT v.3.1.1.
retain_handling
MQTT RetainHandling.
Definition subopts.hpp:27
@ send_only_new_subscription
Only new subscription. Not overwrite.
@ send
Always send. Same as MQTT v.3.1.1.
@ not_send
Always not send.