![]() |
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 > |
Public Member Functions | |
create_options () | |
create_options (int mqttVersion) | |
create_options (int mqttVersion, int maxBufferedMessages) | |
create_options (const string &serverURI, const string &clientId=string{}) | |
create_options (const string &serverURI, const string &clientId, const persistence_type &persistence) | |
create_options (const string &serverURI, const string &clientId, int maxBufferedMessages, const persistence_type &persistence) | |
create_options (const string &serverURI, const string &clientId, const create_options &opts, const persistence_type &persistence) | |
create_options (const create_options &opts) | |
create_options (create_options &&opts) | |
create_options & | operator= (const create_options &rhs) |
create_options & | operator= (create_options &&rhs) |
void | set_server_uri (const string &serverURI) |
const string & | get_server_uri () const noexcept |
void | set_client_id (const string &clientId) |
const string & | get_client_id () const noexcept |
void | set_persistence (const persistence_type &persistence) |
const persistence_type & | get_persistence () const noexcept |
bool | get_send_while_disconnected () const |
void | set_send_while_disconnected (bool on, bool anyTime=false) |
int | get_max_buffered_messages () const |
void | set_max_buffered_messages (int n) |
int | mqtt_version () const |
void | set_mqtt_version (int ver) |
bool | get_delete_oldest_messages () const |
void | set_delete_oldest_messages (bool on) |
bool | get_restore_messages () const |
void | set_restore_messages (bool on) |
bool | get_persist_qos0 () const |
void | set_persist_qos0 (bool on) |
Friends | |
class | async_client |
class | create_options_builder |
Options for creating a client object.
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 |
Cretae options for the specified server and client ID. 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 |
exception | if an argument is invalid |
|
inline |
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 |