async_mqtt 9.0.1
Loading...
Searching...
No Matches

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
 
 property_variant ()=default
 constructor property variant value is std::monostate
 
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(auto) get ()
 Get by type. If not match, then throw std::bad_variant_access exception.
 
template<typename T >
decltype(auto) get () const
 Get by type. If not match, then throw std::bad_variant_access exception.
 
template<typename T >
decltype(auto) get_if ()
 Get by type pointer.
 
template<typename T >
decltype(auto) get_if () const
 Get by type pointer.
 
 operator bool ()
 Check the property is valid.
 

Friends

bool operator== (property_variant const &lhs, property_variant const &rhs)
 equal operator
 
bool operator< (property_variant const &lhs, property_variant const &rhs)
 less than operator
 

Related Symbols

(Note that these are not member symbols.)

bool operator< (property_variant const &lhs, property_variant const &rhs)
 less than operator
 
bool operator== (property_variant const &lhs, property_variant const &rhs)
 equal to operator
 
std::ostream & operator<< (std::ostream &o, property_variant const &v)
 stream output operator
 

Detailed Description

property variant

Thread Safety

  • Distinct objects: Safe
  • Shared objects: Unsafe

Requirements

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)

constructor

Parameters
propertyproperty

Member Function Documentation

◆ const_buffer_sequence()

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

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

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

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

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

Get by type pointer.

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

◆ id()

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

Get property_id.

Returns
property_id

◆ num_of_const_buffer_sequence()

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

Get number of element of const_buffer_sequence.

Returns
number of element of const_buffer_sequence

◆ operator bool()

async_mqtt::property_variant::operator bool ( )

Check the property is valid.

Returns
true if the property is valid, other

◆ size()

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

Get packet size.

Returns
packet size

◆ visit() [1/3]

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

visit to variant

Parameters
funcVisitor function

◆ visit() [2/3]

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

visit to variant

Parameters
funcVisitor function

◆ visit() [3/3]

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

visit to variant

Parameters
funcVisitor function

Friends And Related Symbol Documentation

◆ operator< [1/2]

bool operator< ( property_variant const & lhs,
property_variant const & rhs )
friend

less than operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs less than the rhs, otherwise false.

Requirements

◆ operator<() [2/2]

bool operator< ( property_variant const & lhs,
property_variant const & rhs )
related

less than operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs less than the rhs, otherwise false.

Requirements

◆ operator<<()

std::ostream & operator<< ( std::ostream & o,
property_variant const & v )
related

stream output operator

Parameters
ooutput stream
vtarget
Returns
output stream

Requirements

◆ operator== [1/2]

bool operator== ( property_variant const & lhs,
property_variant const & rhs )
friend

equal operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs equal to the rhs, otherwise false.

Requirements

◆ operator==() [2/2]

bool operator== ( property_variant const & lhs,
property_variant const & rhs )
related

equal to operator

Parameters
lhscompare target
rhscompare target
Returns
true if the lhs equal to the rhs, otherwise false.

Requirements


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