PahoMqttCpp
MQTT C++ Client for POSIX and Windows
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Friends
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_IDENTIFIER = 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, uint32_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
 
std::string_view type_name () const
 
const std::type_info & value_type_id ()
 

Static Public Attributes

static PAHO_MQTTPP_EXPORT const std::map< code, std::string_view > TYPE_NAME
 

Friends

class properties
 

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_IDENTIFIER 
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/8]

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/8]

mqtt::property::property ( code  c,
uint32_t  val 
)
inline

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() [3/8]

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

Create a string or binary property.

Parameters
cThe property code
valThe value for the property

◆ property() [4/8]

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() [5/8]

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

Creates a property from a C struct.

Parameters
cpropA C struct for a property list.

◆ property() [6/8]

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

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() [7/8]

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

Copy constructor

Parameters
otherThe other property to copy into this one.

◆ property() [8/8]

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()

std::string_view mqtt::property::type_name ( ) const

Gets a printable name for the property type.

Returns
A printable name for the property type.

◆ value_type_id()

const std::type_info & mqtt::property::value_type_id ( )

Gets the typeid for the value contained in the property.

Returns
The typeid for the value contained in the property.

Friends And Related Symbol Documentation

◆ properties

friend class properties
friend

Field Documentation

◆ TYPE_NAME

PAHO_MQTTPP_EXPORT const std::map<code, std::string_view> mqtt::property::TYPE_NAME
static

The names of the different types of properties


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