Paho C++  1.0
The Paho MQTT C++ Client Library
 All Classes Files Functions Variables Typedefs Friends
mqtt::disconnect_options Class Reference

Options for disconnecting from an MQTT broker. More...

#include <disconnect_options.h>

Public Member Functions

 disconnect_options ()
 Create an empty delivery response object.
 
 disconnect_options (int timeout, const token_ptr &tok)
 Creates disconnect options tied to the specific token. More...
 
template<class Rep , class Period >
 disconnect_options (const std::chrono::duration< Rep, Period > &to, const token_ptr &tok)
 Creates disconnect options tied to the specific token. More...
 
 disconnect_options (const disconnect_options &opt)
 Copy constructor. More...
 
 disconnect_options (disconnect_options &&opt)
 Move constructor. More...
 
disconnect_optionsoperator= (const disconnect_options &opt)
 Copy assignment. More...
 
disconnect_optionsoperator= (disconnect_options &&opt)
 Move assignment. More...
 
std::chrono::milliseconds get_timeout () const
 Gets the timeout used for disconnecting. More...
 
void set_timeout (int timeout)
 Sets the timeout for disconnecting. More...
 
template<class Rep , class Period >
void set_timeout (const std::chrono::duration< Rep, Period > &to)
 Sets the connect timeout with a chrono duration. More...
 
void set_token (const token_ptr &tok)
 Sets the callback context to a delivery token. More...
 
token_ptr get_token () const
 Gets the callback context to a delivery token. More...
 

Friends

class async_client
 The client has special access.
 
class disconnect_options_test
 

Detailed Description

Options for disconnecting from an MQTT broker.

Constructor & Destructor Documentation

mqtt::disconnect_options::disconnect_options ( int  timeout,
const token_ptr &  tok 
)

Creates disconnect options tied to the specific token.

Parameters
timeoutThe timeout (in milliseconds).
tokA token to be used as the context.
template<class Rep , class Period >
mqtt::disconnect_options::disconnect_options ( const std::chrono::duration< Rep, Period > &  to,
const token_ptr &  tok 
)
inline

Creates disconnect options tied to the specific token.

Parameters
toThe timeout.
tokA token to be used as the context.
mqtt::disconnect_options::disconnect_options ( const disconnect_options opt)

Copy constructor.

Parameters
optAnother object to copy.
mqtt::disconnect_options::disconnect_options ( disconnect_options &&  opt)

Move constructor.

Parameters
optAnother object to move into this new one.

Member Function Documentation

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

Gets the timeout used for disconnecting.

Returns
The timeout for disconnecting (in milliseconds).
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.
disconnect_options& mqtt::disconnect_options::operator= ( const disconnect_options opt)

Copy assignment.

Parameters
optAnother object to copy.
disconnect_options& mqtt::disconnect_options::operator= ( disconnect_options &&  opt)

Move assignment.

Parameters
optAnother object to move into this new one.
void mqtt::disconnect_options::set_timeout ( int  timeout)
inline

Sets the timeout for disconnecting.

This allows for any remaining in-flight messages to be delivered.

Parameters
timeoutThe timeout (in milliseconds).
template<class Rep , class Period >
void mqtt::disconnect_options::set_timeout ( const std::chrono::duration< Rep, Period > &  to)
inline

Sets the connect timeout with a chrono duration.

This is the maximum time that the underlying library will wait for a connection before failing.

Parameters
toThe connect timeout in seconds.
void mqtt::disconnect_options::set_token ( const token_ptr &  tok)

Sets the callback context to a delivery token.

Parameters
tokThe delivery token to be used as the callback context.

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