async_mqtt 5.0.0
Loading...
Searching...
No Matches
topic_subopts.hpp
1// Copyright Takatoshi Kondo 2022
2//
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#if !defined(ASYNC_MQTT_PACKET_TOPIC_SUBOPTS_HPP)
8#define ASYNC_MQTT_PACKET_TOPIC_SUBOPTS_HPP
9
10#include <async_mqtt/packet/topic_sharename.hpp>
12
13namespace async_mqtt {
14
19public:
20
29 ): topic_sharename_{force_move(all_topic)},
30 opts_{opts}
31 {
32 }
33
38 buffer const& topic() const {
39 return topic_sharename_.topic();
40 }
41
46 buffer const& sharename() const {
47 return topic_sharename_.sharename();
48 }
49
56 buffer const& all_topic() const {
57 return topic_sharename_.all_topic();
58 }
59
64 sub::opts const& opts() const { // return reference in mandatory
65 return opts_;
66 }
67
73 operator bool() const {
74 return static_cast<bool>(topic_sharename_);
75 }
76
80 friend
82 return
83 std::tie(lhs.topic_sharename_, lhs.opts_) <
84 std::tie(rhs.topic_sharename_, rhs.opts_);
85 }
86
90 friend
92 return
93 std::tie(lhs.topic_sharename_, lhs.opts_) ==
94 std::tie(rhs.topic_sharename_, rhs.opts_);
95 }
96
97private:
98 topic_sharename topic_sharename_;
99 sub::opts opts_;
100};
101
102} // namespace async_mqtt
103
104#endif // ASYNC_MQTT_PACKET_TOPIC_SUBOPTS_HPP
Definition packet_variant.hpp:49
buffer that has string_view interface This class provides string_view interface. This class hold stri...
Definition buffer.hpp:30
topic and sharename
Definition topic_sharename.hpp:19
buffer const & sharename() const
Get sharename.
Definition topic_sharename.hpp:58
buffer const & all_topic() const
Get all_topic.
Definition topic_sharename.hpp:68
buffer const & topic() const
Get topic.
Definition topic_sharename.hpp:50
subsscription entry
Definition topic_subopts.hpp:18
friend bool operator<(topic_subopts const &lhs, topic_subopts const &rhs)
less than operator
Definition topic_subopts.hpp:81
buffer const & all_topic() const
Get all_topic.
Definition topic_subopts.hpp:56
topic_subopts(buffer all_topic, sub::opts opts)
constructor
Definition topic_subopts.hpp:26
friend bool operator==(topic_subopts const &lhs, topic_subopts const &rhs)
equal operator
Definition topic_subopts.hpp:91
buffer const & sharename() const
Get sharename.
Definition topic_subopts.hpp:46
sub::opts const & opts() const
Get subscribe options.
Definition topic_subopts.hpp:64
buffer const & topic() const
Get topic.
Definition topic_subopts.hpp:38
MQTT SubscribeOptions.
Definition subopts.hpp:60