paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
Loading...
Searching...
No Matches
Public Member Functions | Friends
mqtt::response_options Class Reference

#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_optionsoperator= (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
 

Detailed Description

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".

Constructor & Destructor Documentation

◆ response_options() [1/3]

mqtt::response_options::response_options ( int mqttVersion = MQTTVERSION_DEFAULT)
explicit

Create an empty response object.

Parameters
mqttVersionThe MQTT version for the response.

◆ response_options() [2/3]

mqtt::response_options::response_options ( const token_ptr & tok,
int mqttVersion = MQTTVERSION_DEFAULT )

Creates a response object with the specified callbacks.

Parameters
tokA token to be used as the context.
mqttVersionThe MQTT version for the response.

◆ response_options() [3/3]

mqtt::response_options::response_options ( const response_options & other)

Copy constructor.

Parameters
otherThe other options to copy to this one.

Member Function Documentation

◆ operator=()

response_options & mqtt::response_options::operator= ( const response_options & rhs)

Copy operator.

Parameters
rhsThe other options to copy to this one.

◆ set_mqtt_version()

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.

Parameters
mqttVersionThe MQTT version used by the connection.

◆ set_token()

void mqtt::response_options::set_token ( const token_ptr & tok)

Sets the callback context to a generic token.

Parameters
tokThe token to be used as the callback context.

◆ set_properties() [1/2]

void mqtt::response_options::set_properties ( const properties & props)
inline

Sets the properties for the connect.

Parameters
propsThe properties to place into the message.

◆ set_properties() [2/2]

void mqtt::response_options::set_properties ( properties && props)
inline

Moves the properties for the connect.

Parameters
propsThe properties to move into the connect object.

◆ set_subscribe_options() [1/2]

void mqtt::response_options::set_subscribe_options ( const subscribe_options & opts)

Sets the options for a single topic subscription.

Parameters
optsThe subscribe options.

◆ set_subscribe_options() [2/2]

void mqtt::response_options::set_subscribe_options ( const std::vector< subscribe_options > & opts)

Sets the options for a multi-topic subscription.

Parameters
optsA vector of the subscribe options.

Friends And Related Symbol Documentation

◆ async_client

friend class async_client
friend

The client has special access


The documentation for this class was generated from the following file: