property variant
More...
#include <property_variant.hpp>
|
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.
|
|
property variant
Thread Safety
- Distinct objects: Safe
- Shared objects: Unsafe
Requirements
◆ 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 | ) |
|
◆ 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()
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
-
◆ visit() [2/3]
template<typename Func >
auto async_mqtt::property_variant::visit |
( |
Func && | func | ) |
&& |
visit to variant
- Parameters
-
◆ visit() [3/3]
template<typename Func >
auto async_mqtt::property_variant::visit |
( |
Func && | func | ) |
const & |
visit to variant
- Parameters
-
◆ operator< [1/2]
less than operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs less than the rhs, otherwise false.
Requirements
◆ operator<() [2/2]
less than operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs less than the rhs, otherwise false.
Requirements
◆ operator<<()
stream output operator
- Parameters
-
- Returns
- output stream
Requirements
◆ operator== [1/2]
equal operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs equal to the rhs, otherwise false.
Requirements
◆ operator==() [2/2]
equal to operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs equal to the rhs, otherwise false.
Requirements
The documentation for this class was generated from the following file: