![]() |
paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
|
#include <will_options.h>
Public Types | |
using | ptr_t = std::shared_ptr< will_options > |
using | const_ptr_t = std::shared_ptr< const will_options > |
using | unique_ptr_t = std::unique_ptr< will_options > |
Static Public Attributes | |
static PAHO_MQTTPP_EXPORT const int | DFLT_QOS |
static PAHO_MQTTPP_EXPORT const bool | DFLT_RETAINED |
Friends | |
class | connect_options |
Holds the set of options that govern the Last Will and Testament feature.
using mqtt::will_options::ptr_t = std::shared_ptr<will_options> |
Smart/shared pointer to an object of this class.
using mqtt::will_options::const_ptr_t = std::shared_ptr<const will_options> |
Smart/shared pointer to a const object of this class.
using mqtt::will_options::unique_ptr_t = std::unique_ptr<will_options> |
Smart/shared pointer to an object of this class.
mqtt::will_options::will_options | ( | ) |
Constructs a new object using the default values.
mqtt::will_options::will_options | ( | string_ref | top, |
const void * | payload, | ||
size_t | payload_len, | ||
int | qos = DFLT_QOS , |
||
bool | retained = DFLT_RETAINED , |
||
const properties & | props = properties() |
||
) |
Sets the "Last Will and Testament" (LWT) for the connection.
top | The LWT message is published to the this topic. |
payload | The message that is published to the Will Topic. |
payload_len | The message size in bytes |
qos | The message Quality of Service. |
retained | Tell the broker to keep the LWT message after send to subscribers. |
props | MQTT v5 properties for the will message. |
mqtt::will_options::will_options | ( | const topic & | top, |
const void * | payload, | ||
size_t | payload_len, | ||
int | qos = DFLT_QOS , |
||
bool | retained = DFLT_RETAINED , |
||
const properties & | props = properties() |
||
) |
Sets the "Last Will and Testament" (LWT) for the connection.
top | The LWT message is published to the this topic. |
payload | The message that is published to the Will Topic. |
payload_len | The message size in bytes. |
qos | The message Quality of Service. |
retained | Tell the broker to keep the LWT message after send to subscribers. |
props | MQTT v5 properties for the will message. |
mqtt::will_options::will_options | ( | string_ref | top, |
binary_ref | payload, | ||
int | qos = DFLT_QOS , |
||
bool | retained = DFLT_RETAINED , |
||
const properties & | props = properties() |
||
) |
Sets the "Last Will and Testament" (LWT) for the connection.
top | The LWT message is published to the this topic. |
payload | The message payload that is published to the Will Topic. |
qos | The message Quality of Service. |
retained | Tell the broker to keep the LWT message after send to subscribers. |
props | MQTT v5 properties for the will message. |
mqtt::will_options::will_options | ( | string_ref | top, |
const string & | payload, | ||
int | qos = DFLT_QOS , |
||
bool | retained = DFLT_QOS , |
||
const properties & | props = properties() |
||
) |
Sets the "Last Will and Testament" (LWT) for the connection.
top | The LWT message is published to the this topic. |
payload | The message payload that is published to the Will Topic, as a string. |
qos | The message Quality of Service. |
retained | Tell the broker to keep the LWT message after send to subscribers. |
props | MQTT v5 properties for the will message. |
mqtt::will_options::will_options | ( | const message & | msg | ) |
Sets the "Last Will and Testament" (LWT) for the connection.
msg | The message that is published to the Will Topic. |
mqtt::will_options::will_options | ( | const will_options & | opt | ) |
Copy constructor for the LWT options.
opt | The other options. |
mqtt::will_options::will_options | ( | will_options && | opt | ) |
Move constructor for the LWT options.
opt | The other options. |
will_options& mqtt::will_options::operator= | ( | const will_options & | opt | ) |
Copy assignment for the LWT options.
opt | The other options. |
will_options& mqtt::will_options::operator= | ( | will_options && | opt | ) |
Move assignment for the LWT options.
opt | The other options. |
|
inline |
Expose the underlying C struct for the unit tests. Gets the LWT message topic name.
|
inline |
Gets the LWT message payload.
|
inline |
Gets the LWT message payload as a string.
|
inline |
Gets the QoS value for the LWT message.
|
inline |
Gets the 'retained' flag for the LWT message.
|
inline |
Gets the LWT message as a message object.
void mqtt::will_options::set_topic | ( | string_ref | top | ) |
Sets the LWT message topic name.
top | The topic where to sent the message |
void mqtt::will_options::set_payload | ( | binary_ref | msg | ) |
Sets the LWT message text.
msg | The LWT message |
|
inline |
Sets the LWT message text.
msg | The LWT message |
|
inline |
Sets the QoS value.
qos | The LWT message QoS |
|
inline |
Sets the retained flag.
retained | Tell the broker to keep the LWT message after send to subscribers. |
|
inline |
Gets the connect properties.
|
inline |
Sets the properties for the connect.
props | The properties to place into the message. |
|
inline |
Moves the properties for the connect.
props | The properties to move into the connect object. |
|
friend |
The connect options has special access
|
static |
The default QoS for the LWT, if unspecified
|
static |
The defalut retained flag for LWT, if unspecified