7#if !defined(ASYNC_MQTT_PACKET_V5_UNSUBSCRIBE_HPP)
8#define ASYNC_MQTT_PACKET_V5_UNSUBSCRIBE_HPP
11#include <async_mqtt/buffer_to_packet_variant.hpp>
12#include <async_mqtt/error.hpp>
14#include <async_mqtt/packet/control_packet_type.hpp>
15#include <async_mqtt/packet/packet_id_type.hpp>
16#include <async_mqtt/packet/topic_sharename.hpp>
17#include <async_mqtt/packet/property_variant.hpp>
19#include <async_mqtt/util/buffer.hpp>
20#include <async_mqtt/util/static_vector.hpp>
32namespace async_mqtt::v5 {
34namespace as = boost::asio;
53template <std::
size_t PacketIdBytes>
67 std::vector<topic_sharename> params,
108 std::vector<topic_sharename>
const&
entries()
const;
118 template <std::
size_t PacketIdBytesArg>
122#if defined(ASYNC_MQTT_UNIT_TEST_FOR_PACKET)
123 friend struct ::ut_packet::v5_unsubscribe;
124 friend struct ::ut_packet::v5_unsubscribe_pid4;
125 friend struct ::ut_packet::v5_unsubscribe_error;
132 std::uint8_t fixed_header_;
133 std::vector<static_vector<char, 2>> topic_length_buf_entries_;
134 std::vector<topic_sharename> entries_;
135 static_vector<char, PacketIdBytes> packet_id_ = static_vector<char, PacketIdBytes>(PacketIdBytes);
136 std::size_t remaining_length_;
137 static_vector<char, 4> remaining_length_buf_;
139 std::size_t property_length_ = 0;
140 static_vector<char, 4> property_length_buf_;
156template <std::
size_t PacketIdBytes>
171template <std::
size_t PacketIdBytes>
186template <std::
size_t PacketIdBytes>
203#if !defined(ASYNC_MQTT_SEPARATE_COMPILATION)
204#include <async_mqtt/packet/impl/v5_unsubscribe.ipp>
The varaint type of all packets and system_error.
Definition packet_variant_fwd.hpp:37
buffer that has string_view interface and shared ownership This class is only for advanced usecase su...
Definition buffer.hpp:46
MQTT UNSUBSCRIBE packet (v5)
Definition v5_unsubscribe.hpp:54
basic_unsubscribe_packet(typename basic_packet_id_type< PacketIdBytes >::type packet_id, std::vector< topic_sharename > params, properties props={})
constructor
std::vector< as::const_buffer > const_buffer_sequence() const
Create const buffer sequence it is for boost asio APIs.
std::size_t num_of_const_buffer_sequence() const
Get number of element of const_buffer_sequence.
std::size_t size() const
Get packet size.
basic_packet_id_type< PacketIdBytes >::type packet_id() const
Get packet_id.
std::ostream & operator<<(std::ostream &o, basic_unsubscribe_packet< PacketIdBytes > const &v)
stream output operator
bool operator==(basic_unsubscribe_packet< PacketIdBytes > const &lhs, basic_unsubscribe_packet< PacketIdBytes > const &rhs)
equal operator
properties const & props() const
Get properties.
static constexpr control_packet_type type()
Get MQTT control packet type.
Definition v5_unsubscribe.hpp:75
std::vector< topic_sharename > const & entries() const
Get entries.
bool operator<(basic_unsubscribe_packet< PacketIdBytes > const &lhs, basic_unsubscribe_packet< PacketIdBytes > const &rhs)
less than operator
sys::error_code error_code
sys is a namespace alias of boost::sytem.
Definition error.hpp:56
protocol_version
MQTT protocol version.
Definition protocol_version.hpp:29
basic_packet_variant< PacketIdBytes > buffer_to_basic_packet_variant(buffer buf, protocol_version ver, error_code &ec)
create basic_packet_variant from the buffer
control_packet_type
MQTT control packet type.
Definition control_packet_type.hpp:26
@ unsubscribe
UNSUBSCRIBE(10)
std::vector< property_variant > properties
property variant collection type
Definition property_variant.hpp:224
packet idenfitifer type class template
Definition packet_id_type.hpp:25