paho-mqtt-cpp
MQTT C++ Client for POSIX and Windows
Public Types | Public Member Functions
mqtt::property Class Reference

#include <properties.h>

Public Types

enum  code {
  PAYLOAD_FORMAT_INDICATOR = 1, MESSAGE_EXPIRY_INTERVAL = 2, CONTENT_TYPE = 3, RESPONSE_TOPIC = 8,
  CORRELATION_DATA = 9, SUBSCRIPTION_IDENTIFIER = 11, SESSION_EXPIRY_INTERVAL = 17, ASSIGNED_CLIENT_IDENTIFER = 18,
  SERVER_KEEP_ALIVE = 19, AUTHENTICATION_METHOD = 21, AUTHENTICATION_DATA = 22, REQUEST_PROBLEM_INFORMATION = 23,
  WILL_DELAY_INTERVAL = 24, REQUEST_RESPONSE_INFORMATION = 25, RESPONSE_INFORMATION = 26, SERVER_REFERENCE = 28,
  REASON_STRING = 31, RECEIVE_MAXIMUM = 33, TOPIC_ALIAS_MAXIMUM = 34, TOPIC_ALIAS = 35,
  MAXIMUM_QOS = 36, RETAIN_AVAILABLE = 37, USER_PROPERTY = 38, MAXIMUM_PACKET_SIZE = 39,
  WILDCARD_SUBSCRIPTION_AVAILABLE = 40, SUBSCRIPTION_IDENTIFIERS_AVAILABLE = 41, SHARED_SUBSCRIPTION_AVAILABLE = 42
}
 

Public Member Functions

 property (code c, int32_t val)
 
 property (code c, string_ref val)
 
 property (code c, string_ref name, string_ref val)
 
 property (const MQTTProperty &cprop)
 
 property (MQTTProperty &&cprop)
 
 property (const property &other)
 
 property (property &&other)
 
 ~property ()
 
propertyoperator= (const property &rhs)
 
propertyoperator= (property &&rhs)
 
const MQTTProperty & c_struct () const
 
code type () const
 
const char * type_name () const
 

Detailed Description

A single MQTT v5 property.

Member Enumeration Documentation

◆ code

The integer codes for the different v5 properties.

Enumerator
PAYLOAD_FORMAT_INDICATOR 
MESSAGE_EXPIRY_INTERVAL 
CONTENT_TYPE 
RESPONSE_TOPIC 
CORRELATION_DATA 
SUBSCRIPTION_IDENTIFIER 
SESSION_EXPIRY_INTERVAL 
ASSIGNED_CLIENT_IDENTIFER 
SERVER_KEEP_ALIVE 
AUTHENTICATION_METHOD 
AUTHENTICATION_DATA 
REQUEST_PROBLEM_INFORMATION 
WILL_DELAY_INTERVAL 
REQUEST_RESPONSE_INFORMATION 
RESPONSE_INFORMATION 
SERVER_REFERENCE 
REASON_STRING 
RECEIVE_MAXIMUM 
TOPIC_ALIAS_MAXIMUM 
TOPIC_ALIAS 
MAXIMUM_QOS 
RETAIN_AVAILABLE 
USER_PROPERTY 
MAXIMUM_PACKET_SIZE 
WILDCARD_SUBSCRIPTION_AVAILABLE 
SUBSCRIPTION_IDENTIFIERS_AVAILABLE 
SHARED_SUBSCRIPTION_AVAILABLE 

Constructor & Destructor Documentation

◆ property() [1/7]

mqtt::property::property ( code  c,
int32_t  val 
)

Create a numeric property. This can be a byte, or 2-byte, 4-byte, or variable byte integer.

Parameters
cThe property code
valThe integer value for the property

◆ property() [2/7]

mqtt::property::property ( code  c,
string_ref  val 
)

Create a string or binary property.

Parameters
cThe property code
valThe value for the property

◆ property() [3/7]

mqtt::property::property ( code  c,
string_ref  name,
string_ref  val 
)

Create a string pair property.

Parameters
cThe property code
nameThe string name for the property
valThe string value for the property

◆ property() [4/7]

mqtt::property::property ( const MQTTProperty &  cprop)
explicit

Creates a property list from an C struct.

Parameters
cpropA C struct for a property list.

◆ property() [5/7]

mqtt::property::property ( MQTTProperty &&  cprop)
explicit

Moves a C struct into this property list. This takes ownership of any memory that the C struct is holding.

Parameters
cpropA C struct for a property list.

◆ property() [6/7]

mqtt::property::property ( const property other)

Copy constructor

Parameters
otherThe other property to copy into this one.

◆ property() [7/7]

mqtt::property::property ( property &&  other)

Move constructor.

Parameters
otherThe other property that is moved into this one.

◆ ~property()

mqtt::property::~property ( )

Destructor

Member Function Documentation

◆ operator=() [1/2]

property& mqtt::property::operator= ( const property rhs)

Copy assignment.

Parameters
rhsAnother property list to copy into this one.
Returns
A reference to this object.

◆ operator=() [2/2]

property& mqtt::property::operator= ( property &&  rhs)

Move assignment.

Parameters
rhsAnother property list to move into this one.
Returns
A reference to this object.

◆ c_struct()

const MQTTProperty& mqtt::property::c_struct ( ) const
inline

Gets the underlying C property struct.

Returns
A const reference to the underlying C property struct.

◆ type()

code mqtt::property::type ( ) const
inline

Gets the property type (identifier).

Returns
The code for the property type.

◆ type_name()

const char* mqtt::property::type_name ( ) const
inline

Gets a printable name for the property type.

Returns
A printable name for the property type.

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