![]() |
paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
|
#include <response_options.h>
Public Member Functions | |
response_options (int mqttVersion=MQTTVERSION_DEFAULT) | |
response_options (const token_ptr &tok, int mqttVersion=MQTTVERSION_DEFAULT) | |
response_options (const response_options &other) | |
response_options & | operator= (const response_options &rhs) |
void | set_mqtt_version (int mqttVersion) |
void | set_token (const token_ptr &tok) |
void | set_properties (const properties &props) |
void | set_properties (properties &&props) |
void | set_subscribe_options (const subscribe_options &opts) |
void | set_subscribe_options (const std::vector< subscribe_options > &opts) |
Friends | |
class | async_client |
The response options for various asynchronous calls.
This is an internal data structure, only used within the library. Therefore it is not totally fleshed out, but rather only exposes the functionality currently required by the library.
Note, too, in the C lib, this became a place to add MQTT v5 options for the outgoing calls without breaking the API, so is also referred to as the "call options".
|
explicit |
Create an empty response object.
mqttVersion | The MQTT version for the response. |
mqtt::response_options::response_options | ( | const token_ptr & | tok, |
int | mqttVersion = MQTTVERSION_DEFAULT ) |
Creates a response object with the specified callbacks.
tok | A token to be used as the context. |
mqttVersion | The MQTT version for the response. |
mqtt::response_options::response_options | ( | const response_options & | other | ) |
Copy constructor.
other | The other options to copy to this one. |
response_options & mqtt::response_options::operator= | ( | const response_options & | rhs | ) |
Copy operator.
rhs | The other options to copy to this one. |
void mqtt::response_options::set_mqtt_version | ( | int | mqttVersion | ) |
Expose the underlying C struct for the unit tests. Sets the MQTT protocol version used for the response. This sets up proper callbacks for MQTT v5 or versions prior to that.
mqttVersion | The MQTT version used by the connection. |
void mqtt::response_options::set_token | ( | const token_ptr & | tok | ) |
Sets the callback context to a generic token.
tok | The token to be used as the callback context. |
|
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. |
void mqtt::response_options::set_subscribe_options | ( | const subscribe_options & | opts | ) |
Sets the options for a single topic subscription.
opts | The subscribe options. |
void mqtt::response_options::set_subscribe_options | ( | const std::vector< subscribe_options > & | opts | ) |
Sets the options for a multi-topic subscription.
opts | A vector of the subscribe options. |
|
friend |
The client has special access