async_mqtt 9.0.1
Loading...
Searching...
No Matches

MQTT will message. More...

#include <will.hpp>

Public Member Functions

template<typename StringViewLikeTopic , typename StringViewLikeMessage , std::enable_if_t< std::is_convertible_v< std::decay_t< StringViewLikeTopic >, std::string_view > &&std::is_convertible_v< std::decay_t< StringViewLikeMessage >, std::string_view >, std::nullptr_t > = nullptr>
 will (StringViewLikeTopic &&topic, StringViewLikeMessage &&message, pub::opts pubopts={}, properties props={})
 constructor
 
std::string topic () const
 Get topic.
 
buffer const & topic_as_buffer () const
 Get topic as a buffer.
 
buffertopic_as_buffer ()
 Get topic as a buffer.
 
std::string message () const
 Get message.
 
buffer const & message_as_buffer () const
 Get message as a buffer.
 
buffermessage_as_buffer ()
 Get message as a buffer.
 
constexpr pub::retain get_retain () const
 Get retain.
 
constexpr qos get_qos () const
 Get QoS.
 
constexpr properties const & props () const
 Get properties.
 
constexpr propertiesprops ()
 Get properties.
 

Friends

bool operator== (will const &lhs, will const &rhs)
 equal operator
 
bool operator< (will const &lhs, will const &rhs)
 less than operator
 

Detailed Description

MQTT will message.

Thread Safety

  • Distinct objects: Safe
  • Shared objects: Unsafe

Requirements

Constructor & Destructor Documentation

◆ will()

template<typename StringViewLikeTopic , typename StringViewLikeMessage , std::enable_if_t< std::is_convertible_v< std::decay_t< StringViewLikeTopic >, std::string_view > &&std::is_convertible_v< std::decay_t< StringViewLikeMessage >, std::string_view >, std::nullptr_t > = nullptr>
async_mqtt::will::will ( StringViewLikeTopic && topic,
StringViewLikeMessage && message,
pub::opts pubopts = {},
properties props = {} )
inlineexplicit

constructor

Parameters
topicA topic name to publish as a will
messageThe contents to publish as a will
puboptsQos and retain flag
propswill properties

Member Function Documentation

◆ get_qos()

qos async_mqtt::will::get_qos ( ) const
inlineconstexpr

Get QoS.

Returns
QoS

◆ get_retain()

pub::retain async_mqtt::will::get_retain ( ) const
inlineconstexpr

Get retain.

Returns
retain

◆ message()

std::string async_mqtt::will::message ( ) const
inline

Get message.

Returns
message

◆ message_as_buffer() [1/2]

buffer & async_mqtt::will::message_as_buffer ( )
inline

Get message as a buffer.

Returns
message

◆ message_as_buffer() [2/2]

buffer const & async_mqtt::will::message_as_buffer ( ) const
inline

Get message as a buffer.

Returns
message

◆ props() [1/2]

properties & async_mqtt::will::props ( )
inlineconstexpr

Get properties.

Returns
properties

◆ props() [2/2]

properties const & async_mqtt::will::props ( ) const
inlineconstexpr

Get properties.

Returns
properties

◆ topic()

std::string async_mqtt::will::topic ( ) const
inline

Get topic.

Returns
topic

◆ topic_as_buffer() [1/2]

buffer & async_mqtt::will::topic_as_buffer ( )
inline

Get topic as a buffer.

Returns
topic

◆ topic_as_buffer() [2/2]

buffer const & async_mqtt::will::topic_as_buffer ( ) const
inline

Get topic as a buffer.

Returns
topic

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( will const & lhs,
will const & rhs )
friend

less than operator

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

◆ operator==

bool operator== ( will const & lhs,
will const & rhs )
friend

equal operator

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

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