Loading...
Searching...
No Matches
mqtt::disconnect_options Class Reference

`#include <disconnect_options.h>`

## Public Member Functions

| disconnect_options ()
| disconnect_options (int timeout)
template<class Rep, class Period>
| disconnect_options (const std::chrono::duration< Rep, Period > &to)
| disconnect_options (const disconnect_options &opt)
| disconnect_options (disconnect_options &&opt)
disconnect_options & | operator= (const disconnect_options &opt)
disconnect_options & | operator= (disconnect_options &&opt)
std::chrono::milliseconds | get_timeout () const
void | set_timeout (int timeout)
template<class Rep, class Period>
void | set_timeout (const std::chrono::duration< Rep, Period > &to)
void | set_token (const token_ptr &tok, int mqttVersion)
token_ptr | get_token () const
const properties & | get_properties () const
properties & | get_properties ()
void | set_properties (const properties &props)
void | set_properties (properties &&props)
ReasonCode | get_reason_code () const
void | set_reason_code (ReasonCode code)

## Static Public Member Functions

static disconnect_options | v3 ()
static disconnect_options | v5 ()

## Friends

class | async_client
class | disconnect_options_builder

## Detailed Description

Options for disconnecting from an MQTT broker.

## Constructor & Destructor Documentation

## disconnect_options() [1/5]

mqtt::disconnect_options::disconnect_options | ( |  | ) |

inline

Create an empty delivery response object.

## disconnect_options() [2/5]

mqtt::disconnect_options::disconnect_options | ( | int | timeout | ) |

inline

Creates disconnect options tied to the specific token.

Parameters

  timeout | The timeout (in milliseconds).

## disconnect_options() [3/5]

template<class Rep, class Period>

mqtt::disconnect_options::disconnect_options | ( | const std::chrono::duration< Rep, Period > & | to | ) |

inline

Creates disconnect options tied to the specific token.

Parameters

  to | The timeout.

## disconnect_options() [4/5]

mqtt::disconnect_options::disconnect_options | ( | const disconnect_options & | opt | ) |

Copy constructor.

Parameters

  opt | Another object to copy.

## disconnect_options() [5/5]

mqtt::disconnect_options::disconnect_options | ( | disconnect_options && | opt | ) |

Move constructor.

Parameters

  opt | Another object to move into this new one.

## Member Function Documentation

## v3()

disconnect_options mqtt::disconnect_options::v3 | ( |  | ) |

inline static

Creates default options for an MQTT v3.x connection.

Returns
  Default options for an MQTT v3.x connection.

## v5()

disconnect_options mqtt::disconnect_options::v5 | ( |  | ) |

inline static

Creates default options for an MQTT v5 connection.

Returns
  Default options for an MQTT v5 connection.

## operator=() [1/2]

disconnect_options & mqtt::disconnect_options::operator= | ( | const disconnect_options & | opt | ) |

Copy assignment.

Parameters

  opt | Another object to copy.

## operator=() [2/2]

disconnect_options & mqtt::disconnect_options::operator= | ( | disconnect_options && | opt | ) |

Move assignment.

Parameters

  opt | Another object to move into this new one.

## get_timeout()

std::chrono::milliseconds mqtt::disconnect_options::get_timeout | ( |  | ) | const

inline

Expose the underlying C struct for the unit tests. Gets the timeout used for disconnecting.

Returns
  The timeout for disconnecting (in milliseconds).

## set_timeout() [1/2]

void mqtt::disconnect_options::set_timeout | ( | int | timeout | ) |

inline

Sets the disconnect timeout, in milliseconds. This allows for any remaining in-flight messages to be delivered.

Parameters

  timeout | The disconnect timeout (in milliseconds).

## set_timeout() [2/2]

template<class Rep, class Period>

void mqtt::disconnect_options::set_timeout | ( | const std::chrono::duration< Rep, Period > & | to | ) |

inline

Sets the disconnect timeout with a duration. This allows for any remaining in-flight messages to be delivered.

Parameters

  to | The disconnect connect timeout.

## set_token()

void mqtt::disconnect_options::set_token | ( | const token_ptr & | tok,
|  | int | mqttVersion )

Sets the callback context to a delivery token.

Parameters

  tok | The delivery token to be used as the callback context.
  mqttVersion | The version of MQTT we're using for the connection.

## get_token()

token_ptr mqtt::disconnect_options::get_token | ( |  | ) | const

inline

Gets the callback context to a delivery token.

Returns
  The delivery token to be used as the callback context.

## get_properties() [1/2]

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

inline

Gets the disconnect properties.

Returns
  A const reference to the properties for the disconnect.

## get_properties() [2/2]

properties & mqtt::disconnect_options::get_properties | ( |  | ) |

inline

Gets a mutable reference to the disconnect properties.

Returns
  A mutable reference to the properties for the disconnect.

## set_properties() [1/2]

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

inline

Sets the properties for the connect.

Parameters

  props | The properties to place into the message.

## set_properties() [2/2]

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

inline

Moves the properties for the connect.

Parameters

  props | The properties to move into the connect object.

## get_reason_code()

ReasonCode mqtt::disconnect_options::get_reason_code | ( |  | ) | const

inline

Gets the reason code for the disconnect.

Returns
  The reason code for the disconnect.

## set_reason_code()

void mqtt::disconnect_options::set_reason_code | ( | ReasonCode | code | ) |

inline

Sets the reason code for the disconnect.

Parameters

  code | The reason code for the disconnect.

## Friends And Related Symbol Documentation

## async_client

friend class async_client

friend

The client has special access

## disconnect_options_builder

friend class disconnect_options_builder

friend

The options builder has special access

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

- disconnect_options.h