![]() |
paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
|
#include <delivery_token.h>
Public Types | |
using | ptr_t = std::shared_ptr<delivery_token> |
using | const_ptr_t = std::shared_ptr<delivery_token> |
using | weak_ptr_t = std::weak_ptr<delivery_token> |
![]() | |
enum | Type { CONNECT , SUBSCRIBE , PUBLISH , UNSUBSCRIBE , DISCONNECT } |
using | ptr_t = std::shared_ptr<token> |
using | const_ptr_t = std::shared_ptr<const token> |
using | weak_ptr_t = std::weak_ptr<token> |
Public Member Functions | |
delivery_token (iasync_client &cli) | |
delivery_token (iasync_client &cli, const_message_ptr msg) | |
delivery_token (iasync_client &cli, const_message_ptr msg, void *userContext, iaction_listener &cb) | |
virtual const_message_ptr | get_message () const |
![]() | |
token (Type typ, iasync_client &cli) | |
token (Type typ, iasync_client &cli, void *userContext, iaction_listener &cb) | |
token (Type typ, iasync_client &cli, const string &topic) | |
token (Type typ, iasync_client &cli, const string &topic, void *userContext, iaction_listener &cb) | |
token (Type typ, iasync_client &cli, const_string_collection_ptr topics) | |
token (Type typ, iasync_client &cli, const_string_collection_ptr topics, void *userContext, iaction_listener &cb) | |
token (Type typ, iasync_client &cli, MQTTAsync_token tok) | |
virtual | ~token () |
Type | get_type () const |
virtual iaction_listener * | get_action_callback () const |
virtual iasync_client * | get_client () const |
virtual int | get_message_id () const |
virtual const_string_collection_ptr | get_topics () const |
virtual void * | get_user_context () const |
virtual bool | is_complete () const |
virtual int | get_return_code () const |
virtual void | set_action_callback (iaction_listener &listener) |
virtual void | set_user_context (void *userContext) |
void | set_num_expected (size_t n) |
ReasonCode | get_reason_code () const |
virtual void | wait () |
virtual bool | try_wait () |
virtual bool | wait_for (long timeout) |
template<class Rep , class Period > | |
bool | wait_for (const std::chrono::duration< Rep, Period > &relTime) |
template<class Clock , class Duration > | |
bool | wait_until (const std::chrono::time_point< Clock, Duration > &absTime) |
connect_response | get_connect_response () const |
subscribe_response | get_subscribe_response () const |
unsubscribe_response | get_unsubscribe_response () const |
Static Public Member Functions | |
static ptr_t | create (iasync_client &cli) |
static ptr_t | create (iasync_client &cli, const_message_ptr msg) |
static ptr_t | create (iasync_client &cli, const_message_ptr msg, void *userContext, iaction_listener &cb) |
![]() | |
static ptr_t | create (Type typ, iasync_client &cli) |
static ptr_t | create (Type typ, iasync_client &cli, void *userContext, iaction_listener &cb) |
static ptr_t | create (Type typ, iasync_client &cli, const string &topic) |
static ptr_t | create (Type typ, iasync_client &cli, const string &topic, void *userContext, iaction_listener &cb) |
static ptr_t | create (Type typ, iasync_client &cli, const_string_collection_ptr topics) |
static ptr_t | create (Type typ, iasync_client &cli, const_string_collection_ptr topics, void *userContext, iaction_listener &cb) |
Friends | |
class | async_client |
Provides a mechanism to track the delivery progress of a message. Used to track the the delivery progress of a message when a publish is executed in a non-blocking manner (run in the background) action.
using mqtt::delivery_token::ptr_t = std::shared_ptr<delivery_token> |
Smart/shared pointer to an object of this class
using mqtt::delivery_token::const_ptr_t = std::shared_ptr<delivery_token> |
Smart/shared pointer to a const object of this class
using mqtt::delivery_token::weak_ptr_t = std::weak_ptr<delivery_token> |
Weak pointer to an object of this class
|
inline |
Creates an empty delivery token connected to a particular client.
cli | The asynchronous client object. |
|
inline |
Creates a delivery token connected to a particular client.
cli | The asynchronous client object. |
msg | The message being tracked. |
|
inline |
Creates a delivery token connected to a particular client.
cli | The asynchronous client object. |
msg | The message data. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | callback optional listener that will be notified when message delivery has completed to the requested quality of service |
|
inlinestatic |
Creates an empty delivery token connected to a particular client.
cli | The asynchronous client object. |
|
inlinestatic |
Creates a delivery token connected to a particular client.
cli | The asynchronous client object. |
msg | The message data. |
|
inlinestatic |
Creates a delivery token connected to a particular client.
cli | The asynchronous client object. |
msg | The message data. |
userContext | optional object used to pass context to the callback. Use nullptr if not required. |
cb | callback optional listener that will be notified when message delivery has completed to the requested quality of service |
|
inlinevirtual |
Gets the message associated with this token.
|
friend |
Client has special access.