PahoMqttCpp
MQTT C++ Client for POSIX and Windows
Loading...
Searching...
No Matches
mqtt::response_options_builder Class Reference

#include <response_options.h>

Public Types

using self = response_options_builder
 

Public Member Functions

 response_options_builder (int mqttVersion=MQTTVERSION_DEFAULT)
 
auto mqtt_version (int mqttVersion) -> self &
 
auto token (const token_ptr &tok) -> self &
 
auto properties (mqtt::properties &&props) -> self &
 
auto properties (const mqtt::properties &props) -> self &
 
auto subscribe_opts (const subscribe_options &opts) -> self &
 
auto subscribe_many_opts (const std::vector< subscribe_options > &opts) -> self &
 
auto subscribe_opts (const std::vector< subscribe_options > &opts) -> self &
 
response_options finalize ()
 

Detailed Description

Class to build response options.

Member Typedef Documentation

◆ self

Constructor & Destructor Documentation

◆ response_options_builder()

mqtt::response_options_builder::response_options_builder ( int mqttVersion = MQTTVERSION_DEFAULT)
inlineexplicit

Default constructor.

Member Function Documentation

◆ mqtt_version()

auto mqtt::response_options_builder::mqtt_version ( int mqttVersion) -> self&
inline

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.

◆ token()

auto mqtt::response_options_builder::token ( const token_ptr & tok) -> self&
inline

Sets the callback context to a generic token.

Parameters
tokThe token to be used as the callback context.

◆ properties() [1/2]

auto mqtt::response_options_builder::properties ( mqtt::properties && props) -> self&
inline

Sets the properties for the response options.

Parameters
propsThe properties for the response options.

◆ properties() [2/2]

auto mqtt::response_options_builder::properties ( const mqtt::properties & props) -> self&
inline

Sets the properties for the disconnect message.

Parameters
propsThe properties for the disconnect message.

◆ subscribe_opts() [1/2]

auto mqtt::response_options_builder::subscribe_opts ( const subscribe_options & opts) -> self&
inline

Sets the options for a single topic subscription.

Parameters
optsThe subscribe options.

◆ subscribe_many_opts()

auto mqtt::response_options_builder::subscribe_many_opts ( const std::vector< subscribe_options > & opts) -> self&
inline

Sets the options for a multi-topic subscription.

Parameters
optsA vector of the subscribe options.

◆ subscribe_opts() [2/2]

auto mqtt::response_options_builder::subscribe_opts ( const std::vector< subscribe_options > & opts) -> self&
inline

Sets the options for a multi-topic subscription.

Parameters
optsA vector of the subscribe options.

◆ finalize()

response_options mqtt::response_options_builder::finalize ( )
inline

Finish building the response options and return them.

Returns
The response option struct as built.

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