![]() |
paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
|
#include <subscribe_options.h>
Public Types | |
enum | RetainHandling { SEND_RETAINED_ON_SUBSCRIBE = 0 , SEND_RETAINED_ON_NEW = 1 , DONT_SEND_RETAINED = 2 } |
using | ptr_t = std::shared_ptr<subscribe_options> |
using | const_ptr_t = std::shared_ptr<const subscribe_options> |
Public Member Functions | |
subscribe_options () | |
subscribe_options (bool noLocal, byte retainAsPublished=false, RetainHandling retainHandling=SEND_RETAINED_ON_SUBSCRIBE) | |
bool | get_no_local () const |
void | set_no_local (bool on=true) |
bool | get_retain_as_published () const |
void | set_retain_as_published (bool on) |
auto | get_retain_handling () const -> RetainHandling |
void | set_retain_handling (RetainHandling retainHandling) |
Static Public Attributes | |
static PAHO_MQTTPP_EXPORT const bool | SUBSCRIBE_NO_LOCAL |
static PAHO_MQTTPP_EXPORT const bool | SUBSCRIBE_LOCAL |
static PAHO_MQTTPP_EXPORT const bool | NO_RETAIN_AS_PUBLISHED |
static PAHO_MQTTPP_EXPORT const bool | RETAIN_AS_PUBLISHED |
Friends | |
class | async_client |
class | response_options |
The MQTT v5 subscription options. These are defined in section 3.8.3.1 of the MQTT v5 spec. The defaults use the behavior that was present in MQTT v3.1.1.
using mqtt::subscribe_options::ptr_t = std::shared_ptr<subscribe_options> |
Smart/shared pointer to an object of this class.
using mqtt::subscribe_options::const_ptr_t = std::shared_ptr<const subscribe_options> |
Smart/shared pointer to a const object of this class.
|
inline |
Create default subscription options. These are the default options corresponding to the original MQTT (v3) behaviors.
|
inlineexplicit |
Creates a set of subscription options.
noLocal | Whether the server should send back our own publications, if subscribed. |
retainAsPublished | Whether to keep the retained flag as in the original published message (true). |
retainHandling | When to send retained messages:
|
|
inline |
Gets the value of the "no local" flag.
|
inline |
Sets the "no local" flag on or off.
on | Whether the server should send back our own publications, if subscribed. |
|
inline |
Gets the "retain as published" flag.
|
inline |
Sets the "retain as published" flag on or off.
on | Whether to keep the retained flag as in the original published message. |
|
inline |
Gets the "retain handling" option.
|
inline |
Sets the "retain handling" option.
retainHandling | When to send retained messages:
|
|
friend |
The client and response have special access
|
friend |
|
static |
Don't receive our own publications
|
static |
Receive our own publications
|
static |
Retain flag is only set on publications sent by a broker if in response to a subscribe request
|
static |
Keep the retain flag as on the original publish message