Loading...
Searching...
No Matches
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_options (response_options &&other)
response_options & | operator= (const response_options &rhs)
response_options & | operator= (response_options &&rhs)
void | set_mqtt_version (int mqttVersion)
void | set_token (const token_ptr &tok)
const properties & | get_properties () const
void | set_properties (const properties &props)
void | set_properties (properties &&props)
subscribe_options | get_subscribe_options () const
std::vector< subscribe_options > | get_subscribe_many_options () const
void | set_subscribe_options (const subscribe_options &opts)
void | set_subscribe_many_options (const std::vector< 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/4]

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

inline explicit

Create an empty response object.

Parameters

  mqttVersion | The MQTT version for the response.

## response_options() [2/4]

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

Creates a response object with the specified callbacks.

Parameters

  tok | A token to be used as the context.
  mqttVersion | The MQTT version for the response.

## response_options() [3/4]

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

Copy constructor.

Parameters

  other | The other options to copy to this one.

## response_options() [4/4]

mqtt::response_options::response_options | ( | response_options && | other | ) |

Move constructor.

Parameters

  other | The other options to move into this one.

## Member Function Documentation

## operator=() [1/2]

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

Copy operator.

Parameters

  rhs | The other options to copy to this one.

## operator=() [2/2]

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

Move operator.

Parameters

  rhs | The other options to move into 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

  mqttVersion | The 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

  tok | The token to be used as the callback context.

## get_properties()

const properties & mqtt::response_options::get_properties | ( |  | ) | const

inline

Gets the properties for the response options.

## set_properties() [1/2]

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

inline

Sets the properties for the response options.

Parameters

  props | The properties for the response options.

## set_properties() [2/2]

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

inline

Moves the properties for the response options.

Parameters

  props | The properties to move into the response options.

## get_subscribe_options()

subscribe_options mqtt::response_options::get_subscribe_options | ( |  | ) | const

inline

Gets the options for a single topic subscription.

Returns
  The subscribe options.

## get_subscribe_many_options()

std::vector< subscribe_options > mqtt::response_options::get_subscribe_many_options | ( |  | ) | const

Sets the options for a multi-topic subscription.

Returns
  The vector of the subscribe options.

## 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

  opts | The subscribe options.

## set_subscribe_many_options()

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

Sets the options for a multi-topic subscription.

Parameters

  opts | A vector of the subscribe options.

## set_subscribe_options() [2/2]

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

inline

Sets the options for a multi-topic subscription.

Parameters

  opts | A vector of the subscribe options.

See also
  set_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:

- response_options.h