![]() |
PahoMqttCpp
MQTT C++ Client for POSIX and Windows
|
#include <create_options.h>
Public Types | |
| using | ptr_t = std::shared_ptr< create_options > |
| using | const_ptr_t = std::shared_ptr< const create_options > |
Friends | |
| class | async_client |
| class | create_options_builder |
The set of options for constructing a client object.
Note that the numerous, incomplete set of constructors pre-date the current, expanded, options structure. For a full set of create options, a builder can be used to specify the options, then construct the client with those options, like this:
| using mqtt::create_options::ptr_t = std::shared_ptr<create_options> |
Smart/shared pointer to an object of this class.
| using mqtt::create_options::const_ptr_t = std::shared_ptr<const create_options> |
Smart/shared pointer to a const object of this class.
|
inline |
Default set of client create options.
|
inlineexplicit |
Default create options for the specified version of MQTT.
| mqttVersion | The MQTT version used to create the client. |
| mqtt::create_options::create_options | ( | int | mqttVersion, |
| int | maxBufferedMessages | ||
| ) |
Default create options, but with off-line buffering enabled.
| mqttVersion | The MQTT version used to create the client. |
| maxBufferedMessages | the maximum number of messages allowed to be buffered while not connected |
|
inlineexplicit |
Create options for the specified server and client ID, with optional persistence. This allows the caller to specify a user-defined persistence object, or use no persistence.
| serverURI | the address of the server to connect to, specified as a URI. |
| clientId | a client identifier that is unique on the server being connected to |
| persistence | The desired persistence structure. |
| exception | if an argument is invalid |
|
inline |
Create an async_client that can be used to communicate with an MQTT server, which allows for off-line message buffering. This uses file-based persistence in the specified directory.
| serverURI | the address of the server to connect to, specified as a URI. |
| clientId | a client identifier that is unique on the server being connected to |
| maxBufferedMessages | the maximum number of messages allowed to be buffered while not connected |
| persistence | The persistence that the client should use. |
| exception | if an argument is invalid |
|
inline |
Create an async_client that can be used to communicate with an MQTT server, which allows for off-line message buffering. This uses file-based persistence in the specified directory.
| serverURI | the address of the server to connect to, specified as a URI. |
| clientId | a client identifier that is unique on the server being connected to |
| opts | The create options |
| persistence | The persistence that the client should use. |
| exception | if an argument is invalid |
|
inline |
Copy constructor.
| opts | The other options. |
|
inline |
Move constructor.
| opts | The other options. |
| create_options & mqtt::create_options::operator= | ( | const create_options & | rhs | ) |
| create_options & mqtt::create_options::operator= | ( | create_options && | rhs | ) |
|
inline |
Set the address of the server to connect to, specified as a URI
| serverURI | The URI of the server. |
|
inlinenoexcept |
Get the address of the server to connect to, specified as a URI.
|
inline |
Set the client identifier.
| clientId | The client identifier. |
|
inlinenoexcept |
Get the client identifier.
|
inline |
Set the persistence for the client.
| persistence | The persistence for the client |
|
inlinenoexcept |
Get the persistence for the client.
|
inline |
Gets whether the client will accept message to publish while disconnected.
|
inline |
Sets whether the client will accept message to publish while disconnected.
| on | true to allow the application to publish messages while disconnected, false returns an error on publish if disconnected. |
| anyTime | If true, allows you to publish messages before the first successful connection. |
|
inline |
Gets the maximum number of offline buffered messages.
|
inline |
Sets the maximum number of offline buffered messages.
| n | The maximum number of offline buffered messages. |
|
inline |
Gets the MQTT version used to create the client.
|
inline |
Sets the MQTT version used to create the client.
| ver | The MQTT version used to create the client. |
|
inline |
Whether the oldest messages are deleted when the output buffer is full.
|
inline |
Determines what to do when the maximum number of buffered messages is reached: delete the oldest messages rather than the newest
| on | true When the output queue is full, delete the oldest message, false drop the newest message being added. |
|
inline |
Whether the messages will be restored from persistence or the store will be cleared.
|
inline |
Determine whether to restore messages from persistence or clear the persistence store.
| on | true to restore messages from persistence, false to clear the persistence store. |
|
inline |
Whether to persist QoS 0 messages.
|
inline |
Determine whether to persist QoS 0 messages.
| on | true if QoS 0 messages are persisted, false if not. |
|
friend |
The client and tests have special access
|
friend |