7#if !defined(ASYNC_MQTT_PACKET_V3_1_1_DISCONNECT_HPP)
8#define ASYNC_MQTT_PACKET_V3_1_1_DISCONNECT_HPP
13#include <boost/numeric/conversion/cast.hpp>
15#include <async_mqtt/buffer_to_packet_variant.hpp>
17#include <async_mqtt/packet/control_packet_type.hpp>
19#include <async_mqtt/util/buffer.hpp>
20#include <async_mqtt/util/move.hpp>
21#include <async_mqtt/util/static_vector.hpp>
22#include <async_mqtt/util/endian_convert.hpp>
30namespace async_mqtt::v3_1_1 {
32namespace as = boost::asio;
95 template <std::
size_t PacketIdBytesArg>
99#if defined(ASYNC_MQTT_UNIT_TEST_FOR_PACKET)
100 friend struct ::ut_packet::v311_disconnect;
101 friend struct ::ut_packet::v311_disconnect_error;
108 static_vector<char, 2> all_;
155#if !defined(ASYNC_MQTT_SEPARATE_COMPILATION)
156#include <async_mqtt/packet/impl/v3_1_1_disconnect.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 DISCONNECT packet (v3.1.1)
Definition v3_1_1_disconnect.hpp:57
std::size_t size() const
Get packet size.
disconnect_packet()
constructor
bool operator<(disconnect_packet const &lhs, disconnect_packet const &rhs)
less than operator
static constexpr std::size_t num_of_const_buffer_sequence()
Get number of element of const_buffer_sequence.
Definition v3_1_1_disconnect.hpp:89
std::vector< as::const_buffer > const_buffer_sequence() const
Create const buffer sequence it is for boost asio APIs.
static constexpr control_packet_type type()
Get MQTT control packet type.
Definition v3_1_1_disconnect.hpp:68
bool operator==(disconnect_packet const &lhs, disconnect_packet const &rhs)
equal operator
std::ostream & operator<<(std::ostream &o, disconnect_packet const &v)
stream output 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
@ disconnect
DISCONNECT(14)