24 #ifndef __mqtt_delivery_token_h
25 #define __mqtt_delivery_token_h
27 #include "MQTTAsync.h"
44 const_message_ptr msg_;
53 void set_message(const_message_ptr msg) { msg_ = msg; }
57 using ptr_t = std::shared_ptr<delivery_token>;
74 :
token(cli, msg->get_topic()), msg_(std::move(msg)) {}
87 :
token(cli, msg->get_topic(), userContext, cb), msg_(std::move(msg)) {}
93 return std::make_shared<delivery_token>(cli);
101 return std::make_shared<delivery_token>(cli, msg);
115 return std::make_shared<delivery_token>(cli, msg, userContext, cb);
134 #endif // __mqtt_delivery_token_h
static ptr_t create(iasync_client &cli)
Creates an empty delivery token connected to a particular client.
Definition: delivery_token.h:92
Lightweight client for talking to an MQTT server using non-blocking methods that allow an operation t...
Definition: async_client.h:60
Provides a mechanism for tracking the completion of an asynchronous action.
Definition: iaction_listener.h:48
delivery_token(iasync_client &cli, const_message_ptr msg)
Creates a delivery token connected to a particular client.
Definition: delivery_token.h:73
Declaration of MQTT message class.
static ptr_t create(iasync_client &cli, const_message_ptr msg)
Creates a delivery token connected to a particular client.
Definition: delivery_token.h:100
std::weak_ptr< delivery_token > weak_ptr_t
Weak pointer to an object of this class.
Definition: delivery_token.h:61
Enables an application to communicate with an MQTT server using non-blocking methods.
Definition: iasync_client.h:57
static ptr_t create(iasync_client &cli, const_message_ptr msg, void *userContext, iaction_listener &cb)
Creates a delivery token connected to a particular client.
Definition: delivery_token.h:113
virtual const_message_ptr get_message() const
Gets the message associated with this token.
Definition: delivery_token.h:121
std::shared_ptr< delivery_token > ptr_t
Smart/shared pointer to an object of this class.
Definition: delivery_token.h:57
Provides a mechanism for tracking the completion of an asynchronous action.
Definition: token.h:49
delivery_token(iasync_client &cli, const_message_ptr msg, void *userContext, iaction_listener &cb)
Creates a delivery token connected to a particular client.
Definition: delivery_token.h:85
delivery_token(iasync_client &cli)
Creates an empty delivery token connected to a particular client.
Definition: delivery_token.h:67
std::shared_ptr< delivery_token > const_ptr_t
Smart/shared pointer to a const object of this class.
Definition: delivery_token.h:59
Declaration of MQTT token class.
Provides a mechanism to track the delivery progress of a message.
Definition: delivery_token.h:41