7#if !defined(ASYNC_MQTT_PACKET_SUBOPTS_HPP)
8#define ASYNC_MQTT_PACKET_SUBOPTS_HPP
13#include <async_mqtt/packet/qos.hpp>
53enum class rap : std::uint8_t
70enum class nl : std::uint8_t
91 constexpr opts() =
delete;
94 constexpr opts(
opts const&) =
default;
95 constexpr opts& operator=(
opts &&) =
default;
96 constexpr opts& operator=(
opts const&) =
default;
102 explicit constexpr opts(std::uint8_t value) : data_(value) { }
212 {
return static_cast<enum
rap>(data_ & 0b00001000); }
220 {
return static_cast<enum
nl>(data_ & 0b00000100); }
228 {
return static_cast<enum
qos>(data_ & 0b00000011); }
235 explicit constexpr operator std::uint8_t()
const {
return data_; }
440 default:
return "invalid_retain_handling";
480 default:
return "invalid_rap";
520 default:
return "invalid_nl";
qos
MQTT QoS.
Definition qos.hpp:35
constexpr char const * nl_to_str(nl v)
stringize nl(no local)
Definition subopts.hpp:516
constexpr char const * retain_handling_to_str(retain_handling v)
stringize retain_handling
Definition subopts.hpp:435
std::ostream & operator<<(std::ostream &o, retain_handling v)
output to the stream
Definition subopts.hpp:458
nl
MQTT NoLocal.
Definition subopts.hpp:71
std::ostream & operator<<(std::ostream &o, rap v)
output to the stream
Definition subopts.hpp:498
rap
MQTT RetainAsPublished.
Definition subopts.hpp:54
retain_handling
MQTT RetainHandling.
Definition subopts.hpp:36
constexpr char const * rap_to_str(rap v)
stringize rap(retain as published)
Definition subopts.hpp:476
std::ostream & operator<<(std::ostream &o, nl v)
output to the stream
Definition subopts.hpp:538
@ no
Subscriber's publish would be delivered to the subscriber itself. Same as MQTT v.3....
@ yes
Subscriber's publish would not be delivered to the subscriber itself.
@ retain
Preserve published Retain delivery on publish by the broker.
@ dont
Retain is set to 0 delivery on publish by the broker. Same as MQTT v.3.1.1.
@ send_only_new_subscription
Only new subscription. Not overwrite.
@ send
Always send. Same as MQTT v.3.1.1.
@ not_send
Always not send.
MQTT SubscribeOptions.
Definition subopts.hpp:90
constexpr opts & operator|=(rap rhs)
Combine opts operator.
Definition subopts.hpp:182
constexpr bool operator<(opts rhs) const
less than operator
Definition subopts.hpp:249
constexpr opts operator|(retain_handling rhs) const
Combine opts operator.
Definition subopts.hpp:140
constexpr opts(qos value)
constructor
Definition subopts.hpp:126
constexpr opts & operator|=(retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:175
constexpr opts operator|(nl lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:351
constexpr opts operator|(retain_handling lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:281
constexpr opts(std::uint8_t value)
constructor
Definition subopts.hpp:102
constexpr opts operator|(rap rhs) const
Combine opts operator.
Definition subopts.hpp:147
constexpr opts operator|(qos rhs) const
Combine opts operator.
Definition subopts.hpp:161
constexpr opts operator|(rap lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:309
constexpr bool operator==(opts rhs) const
equal operator
Definition subopts.hpp:242
constexpr opts operator|(qos lhs, retain_handling rhs)
Combine opts operator.
Definition subopts.hpp:393
constexpr opts & operator|=(opts rhs)
Combine opts operator.
Definition subopts.hpp:168
constexpr opts operator|(nl rhs) const
Combine opts operator.
Definition subopts.hpp:154
constexpr opts & operator|=(nl rhs)
Combine opts operator.
Definition subopts.hpp:189
constexpr opts operator|(rap lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:323
constexpr opts operator|(qos lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:407
constexpr opts operator|(retain_handling lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:295
constexpr opts(rap value)
constructor
Definition subopts.hpp:114
constexpr operator std::uint8_t() const
Get byte image.
Definition subopts.hpp:235
constexpr opts operator|(retain_handling lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:267
constexpr opts & operator|=(qos rhs)
Combine opts operator.
Definition subopts.hpp:196
constexpr opts operator|(opts rhs) const
Combine opts operator.
Definition subopts.hpp:133
constexpr opts(retain_handling value)
constructor
Definition subopts.hpp:108
constexpr retain_handling get_retain_handling() const
Get retain_handling.
Definition subopts.hpp:203
constexpr opts operator|(nl lhs, rap rhs)
Combine opts operator.
Definition subopts.hpp:365
constexpr qos get_qos() const
Get qos.
Definition subopts.hpp:227
constexpr opts operator|(nl lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:379
constexpr rap get_rap() const
Get rap.
Definition subopts.hpp:211
constexpr nl get_nl() const
Get nl.
Definition subopts.hpp:219
constexpr opts operator|(rap lhs, qos rhs)
Combine opts operator.
Definition subopts.hpp:337
constexpr opts operator|(qos lhs, nl rhs)
Combine opts operator.
Definition subopts.hpp:421
constexpr opts(nl value)
constructor
Definition subopts.hpp:120