async_mqtt 5.0.0
Loading...
Searching...
No Matches
async_mqtt::property_variant Class Reference

property variant More...

#include <property_variant.hpp>

Public Member Functions

template<typename Property , std::enable_if_t< !std::is_same_v< std::decay_t< Property >, property_variant >, std::nullptr_t > * = nullptr>
 property_variant (Property &&property)
 constructor
 
template<typename Func >
auto visit (Func &&func) const &
 visit to variant
 
template<typename Func >
auto visit (Func &&func) &
 visit to variant
 
template<typename Func >
auto visit (Func &&func) &&
 visit to variant
 
property::id id () const
 Get property_id.
 
std::size_t num_of_const_buffer_sequence () const
 Get number of element of const_buffer_sequence.
 
std::vector< as::const_buffer > const_buffer_sequence () const
 Create const buffer sequence. it is for boost asio APIs.
 
std::size_t size () const
 Get packet size.
 
template<typename T >
decltype(autoget ()
 Get by type. If not match, then throw std::bad_variant_access exception.
 
template<typename T >
decltype(autoget () const
 Get by type. If not match, then throw std::bad_variant_access exception.
 
template<typename T >
decltype(autoget_if ()
 Get by type pointer.
 
template<typename T >
decltype(autoget_if () const
 Get by type pointer.
 

Detailed Description

property variant

Constructor & Destructor Documentation

◆ property_variant()

template<typename Property , std::enable_if_t< !std::is_same_v< std::decay_t< Property >, property_variant >, std::nullptr_t > * = nullptr>
async_mqtt::property_variant::property_variant ( Property && property)
inline

constructor

Parameters
propertyproperty

Member Function Documentation

◆ const_buffer_sequence()

std::vector< as::const_buffer > async_mqtt::property_variant::const_buffer_sequence ( ) const
inline

Create const buffer sequence. it is for boost asio APIs.

Returns
const buffer sequence

◆ get() [1/2]

template<typename T >
decltype(auto) async_mqtt::property_variant::get ( )
inline

Get by type. If not match, then throw std::bad_variant_access exception.

Returns
actual packet

◆ get() [2/2]

template<typename T >
decltype(auto) async_mqtt::property_variant::get ( ) const
inline

Get by type. If not match, then throw std::bad_variant_access exception.

Returns
actual packet

◆ get_if() [1/2]

template<typename T >
decltype(auto) async_mqtt::property_variant::get_if ( )
inline

Get by type pointer.

Returns
actual packet pointer. If not match then return nullptr.

◆ get_if() [2/2]

template<typename T >
decltype(auto) async_mqtt::property_variant::get_if ( ) const
inline

Get by type pointer.

Returns
actual packet pointer. If not match then return nullptr.

◆ id()

property::id async_mqtt::property_variant::id ( ) const
inline

Get property_id.

Returns
property_id

◆ num_of_const_buffer_sequence()

std::size_t async_mqtt::property_variant::num_of_const_buffer_sequence ( ) const
inline

Get number of element of const_buffer_sequence.

Returns
number of element of const_buffer_sequence

◆ size()

std::size_t async_mqtt::property_variant::size ( ) const
inline

Get packet size.

Returns
packet size

◆ visit() [1/3]

template<typename Func >
auto async_mqtt::property_variant::visit ( Func && func) &
inline

visit to variant

Parameters
funcVisitor function

◆ visit() [2/3]

template<typename Func >
auto async_mqtt::property_variant::visit ( Func && func) &&
inline

visit to variant

Parameters
funcVisitor function

◆ visit() [3/3]

template<typename Func >
auto async_mqtt::property_variant::visit ( Func && func) const &
inline

visit to variant

Parameters
funcVisitor function

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