async_mqtt 9.0.1
Loading...
Searching...
No Matches
async_mqtt::v5::basic_puback_packet< PacketIdBytes > Class Template Reference

MQTT PUBACK packet (v5) More...

#include <v5_puback.hpp>

Public Member Functions

 basic_puback_packet (typename basic_packet_id_type< PacketIdBytes >::type packet_id, puback_reason_code reason_code, properties props)
 constructor
 
 basic_puback_packet (typename basic_packet_id_type< PacketIdBytes >::type packet_id)
 constructor
 
 basic_puback_packet (typename basic_packet_id_type< PacketIdBytes >::type packet_id, puback_reason_code reason_code)
 constructor
 
std::vector< as::const_buffer > const_buffer_sequence () const
 Create const buffer sequence it is for boost asio APIs.
 
std::size_t size () const
 Get packet size.
 
std::size_t num_of_const_buffer_sequence () const
 Get number of element of const_buffer_sequence.
 
basic_packet_id_type< PacketIdBytes >::type packet_id () const
 Get packet_id.
 
puback_reason_code code () const
 Get reason code.
 
properties const & props () const
 Get properties.
 

Static Public Member Functions

static constexpr control_packet_type type ()
 Get MQTT control packet type.
 

Friends

std::ostream & operator<< (std::ostream &o, basic_puback_packet< PacketIdBytes > const &v)
 stream output operator
 

Related Symbols

(Note that these are not member symbols.)

using puback_packet = basic_puback_packet<2>
 Type alias of basic_puback_packet (PacketIdBytes=2).
 
template<std::size_t PacketIdBytes>
bool operator< (basic_puback_packet< PacketIdBytes > const &lhs, basic_puback_packet< PacketIdBytes > const &rhs)
 less than operator
 
template<std::size_t PacketIdBytes>
bool operator== (basic_puback_packet< PacketIdBytes > const &lhs, basic_puback_packet< PacketIdBytes > const &rhs)
 equal operator
 

Detailed Description

template<std::size_t PacketIdBytes>
class async_mqtt::v5::basic_puback_packet< PacketIdBytes >

MQTT PUBACK packet (v5)

Template Parameters
PacketIdBytessize of packet_id

If basic_endpoint::set_auto_pub_response() is called with true, then this packet is automatically sent when PUBLISH (QoS1) v5::basic_publish_packet is received.

When the packet is received, the packet_id is automatically released and become reusable.
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901121

Thread Safety

  • Distinct objects: Safe
  • Shared objects: Unsafe

Requirements

Constructor & Destructor Documentation

◆ basic_puback_packet() [1/3]

template<std::size_t PacketIdBytes>
async_mqtt::v5::basic_puback_packet< PacketIdBytes >::basic_puback_packet ( typename basic_packet_id_type< PacketIdBytes >::type packet_id,
puback_reason_code reason_code,
properties props )
explicit

constructor

Parameters
packet_idMQTT PacketIdentifier that is corresponding to the PUBLISH(QoS1) packet
reason_codePubackReasonCode
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124
propsproperties.
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901125

◆ basic_puback_packet() [2/3]

template<std::size_t PacketIdBytes>
async_mqtt::v5::basic_puback_packet< PacketIdBytes >::basic_puback_packet ( typename basic_packet_id_type< PacketIdBytes >::type packet_id)
explicit

constructor

Parameters
packet_idMQTT PacketIdentifier that is corresponding to the PUBLISH(QoS1) packet

◆ basic_puback_packet() [3/3]

template<std::size_t PacketIdBytes>
async_mqtt::v5::basic_puback_packet< PacketIdBytes >::basic_puback_packet ( typename basic_packet_id_type< PacketIdBytes >::type packet_id,
puback_reason_code reason_code )
explicit

constructor

Parameters
packet_idMQTT PacketIdentifier that is corresponding to the PUBLISH(QoS1) packet
reason_codePubackReasonCode
See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901124

Member Function Documentation

◆ code()

template<std::size_t PacketIdBytes>
puback_reason_code async_mqtt::v5::basic_puback_packet< PacketIdBytes >::code ( ) const

Get reason code.

Returns
reason_code

◆ const_buffer_sequence()

template<std::size_t PacketIdBytes>
std::vector< as::const_buffer > async_mqtt::v5::basic_puback_packet< PacketIdBytes >::const_buffer_sequence ( ) const

Create const buffer sequence it is for boost asio APIs.

Returns
const buffer sequence

◆ num_of_const_buffer_sequence()

template<std::size_t PacketIdBytes>
std::size_t async_mqtt::v5::basic_puback_packet< PacketIdBytes >::num_of_const_buffer_sequence ( ) const

Get number of element of const_buffer_sequence.

Returns
number of element of const_buffer_sequence

◆ packet_id()

template<std::size_t PacketIdBytes>
basic_packet_id_type< PacketIdBytes >::type async_mqtt::v5::basic_puback_packet< PacketIdBytes >::packet_id ( ) const

Get packet_id.

Returns
packet_id

◆ props()

template<std::size_t PacketIdBytes>
properties const & async_mqtt::v5::basic_puback_packet< PacketIdBytes >::props ( ) const

Get properties.

Returns
properties

◆ size()

template<std::size_t PacketIdBytes>
std::size_t async_mqtt::v5::basic_puback_packet< PacketIdBytes >::size ( ) const

Get packet size.

Returns
packet size

◆ type()

template<std::size_t PacketIdBytes>
static constexpr control_packet_type async_mqtt::v5::basic_puback_packet< PacketIdBytes >::type ( )
inlinestaticconstexpr

Get MQTT control packet type.

Returns
control packet type

Friends And Related Symbol Documentation

◆ operator<()

template<std::size_t PacketIdBytes>
bool operator< ( basic_puback_packet< PacketIdBytes > const & lhs,
basic_puback_packet< PacketIdBytes > const & rhs )
related

less than operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs less than the rhs, otherwise false.

Requirements

◆ operator<<

template<std::size_t PacketIdBytes>
std::ostream & operator<< ( std::ostream & o,
basic_puback_packet< PacketIdBytes > const & v )
friend

stream output operator

Parameters
ooutput stream
vtarget
Returns
output stream

◆ operator==()

template<std::size_t PacketIdBytes>
bool operator== ( basic_puback_packet< PacketIdBytes > const & lhs,
basic_puback_packet< PacketIdBytes > const & rhs )
related

equal operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs equal to the rhs, otherwise false.

Requirements


The documentation for this class was generated from the following files: