26#ifndef __mqtt_will_options_h
27#define __mqtt_will_options_h
62 MQTTAsync_willOptions opts_;
94 return sr ? sr.
to_string().c_str() :
nullptr;
99 using ptr_t = std::shared_ptr<will_options>;
189 #if defined(UNIT_TESTS)
190 const MQTTAsync_willOptions& c_struct()
const {
return opts_; }
243 void set_qos(
const int qos) { opts_.qos = qos; }
const blob & to_string() const
Definition buffer_ref.h:251
Definition connect_options.h:49
static ptr_t create(string_ref topic, const void *payload, size_t len, int qos, bool retained, const properties &props=properties())
Definition message.h:168
Definition properties.h:256
Definition will_options.h:50
will_options & operator=(const will_options &opt)
static PAHO_MQTTPP_EXPORT const int DFLT_QOS
Definition will_options.h:53
void set_payload(binary_ref msg)
will_options(string_ref top, binary_ref payload, int qos=DFLT_QOS, bool retained=DFLT_RETAINED, const properties &props=properties())
const binary_ref & get_payload() const
Definition will_options.h:201
void set_qos(const int qos)
Definition will_options.h:243
bool is_retained() const
Definition will_options.h:216
will_options(const message &msg)
void set_retained(bool retained)
Definition will_options.h:249
const properties & get_properties() const
Definition will_options.h:254
will_options(const topic &top, const void *payload, size_t payload_len, int qos=DFLT_QOS, bool retained=DFLT_RETAINED, const properties &props=properties())
void set_topic(string_ref top)
void set_payload(string msg)
Definition will_options.h:238
const_message_ptr get_message() const
Definition will_options.h:221
will_options(will_options &&opt)
will_options(string_ref top, const string &payload, int qos=DFLT_QOS, bool retained=DFLT_QOS, const properties &props=properties())
will_options & operator=(will_options &&opt)
string get_payload_str() const
Definition will_options.h:206
void set_properties(const properties &props)
Definition will_options.h:259
string get_topic() const
Definition will_options.h:196
static PAHO_MQTTPP_EXPORT const bool DFLT_RETAINED
Definition will_options.h:55
int get_qos() const
Definition will_options.h:211
will_options(string_ref top, const void *payload, size_t payload_len, int qos=DFLT_QOS, bool retained=DFLT_RETAINED, const properties &props=properties())
std::shared_ptr< will_options > ptr_t
Definition will_options.h:99
will_options(const will_options &opt)
std::shared_ptr< const will_options > const_ptr_t
Definition will_options.h:101
std::unique_ptr< will_options > unique_ptr_t
Definition will_options.h:103
void set_properties(properties &&props)
Definition will_options.h:264
#define PAHO_MQTTPP_EXPORT
Definition export.h:40
Definition async_client.h:49
will_options::const_ptr_t const_will_options_ptr
Definition will_options.h:271
buffer_ref< char > binary_ref
Definition buffer_ref.h:298
bool to_bool(int n)
Definition types.h:161
message::const_ptr_t const_message_ptr
Definition message.h:368
std::string string
Definition types.h:40
will_options::ptr_t will_options_ptr
Definition will_options.h:268
int to_int(bool b)
Definition types.h:167
will_options::unique_ptr_t will_options_unique_ptr
Definition will_options.h:274