![]() |
PahoMqttCpp
MQTT C++ Client for POSIX and Windows
|
#include <properties.h>
Data Structures | |
class | const_iterator |
Public Member Functions | |
properties () | |
properties (const properties &other) | |
properties (properties &&other) | |
properties (const MQTTProperties &cprops) | |
properties (std::initializer_list< property > props) | |
~properties () | |
const MQTTProperties & | c_struct () const |
properties & | operator= (const properties &rhs) |
properties & | operator= (properties &&rhs) |
bool | empty () const |
const property | operator[] (size_t i) const |
const property | at (size_t i) const |
size_t | size () const |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | end () const |
const_iterator | cend () const |
void | add (const property &prop) |
void | clear () |
bool | contains (property::code propid) const |
size_t | count (property::code propid) const |
property | get (property::code propid, size_t idx=0) const |
Friends | |
template<typename T > | |
T | get (const properties &props, property::code propid, size_t idx) |
template<typename T > | |
T | get (const properties &props, property::code propid) |
MQTT v5 property list.
A collection of properties that can be added to outgoing packets or retrieved from incoming packets.
|
inline |
Default constructor. Creates an empty properties list.
|
inline |
Copy constructor.
other | The property list to copy. |
|
inline |
Move constructor.
other | The property list to move to this one. |
|
inline |
Creates a list of properties from a C struct.
cprops | The c struct of properties |
mqtt::properties::properties | ( | std::initializer_list< property > | props | ) |
Constructs from a list of property objects.
props | An initializer list of property objects. |
|
inline |
Destructor.
|
inline |
Gets a reference to the underlying C properties structure.
properties & mqtt::properties::operator= | ( | const properties & | rhs | ) |
Copy assignment.
rhs | The other property list to copy into this one |
properties & mqtt::properties::operator= | ( | properties && | rhs | ) |
Move assignment.
rhs | The property list to move to this one. |
|
inline |
Determines if the property list is empty.
|
inline |
Gets the property at the specified index in the collection.
i | The index |
|
inline |
Gets the property at the specified index in the collection.
i | The index |
|
inline |
Gets the numbers of property items in the list.
|
inline |
Gets a const iterator to the full collection of properties.
|
inline |
Gets a const iterator to the full collection of properties.
|
inline |
Gets a const iterator to the end of the collection of properties.
|
inline |
Gets a const iterator to the end of the collection of properties.
|
inline |
Adds a property to the list.
prop | The property to add to the list. |
|
inline |
Removes all the items from the property list.
|
inline |
Determines if the list contains a specific property.
propid | The property ID (code). |
|
inline |
Get the number of properties in the list with the specified property ID.
Most properties can exist only once. User properties and subscription ID's can exist more than once.
propid | The property ID (code). |
property mqtt::properties::get | ( | property::code | propid, |
size_t | idx = 0 ) const |
Gets the property with the specified ID.
propid | The property ID (code). |
idx | Which instance of the property to retrieve, if there are more than one. |
|
friend |
Retrieves a single value from a property list for when there may be multiple identical property ID's.
T | The type of the value to retrieve |
props | The property list |
propid | The property ID code for the desired value. |
idx | Index of the desired property ID |
|
friend |
Retrieves a single value from a property list.
T | The type of the value to retrieve |
props | The property list |
propid | The property ID code for the desired value. |