The varaint type of all packets and system_error.
More...
|
| basic_packet_variant ()=default |
| constructor the variant value is monostate
|
|
template<typename Packet , std::enable_if_t< !std::is_same_v< std::decay_t< Packet >, basic_packet_variant< PacketIdBytes > >, std::nullptr_t > = nullptr> |
| basic_packet_variant (Packet &&packet) |
| 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
|
|
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.
|
|
std::optional< control_packet_type > | type () const |
| Get control_packet_type.
|
|
std::vector< as::const_buffer > | const_buffer_sequence () const |
| Create const buffer sequence it is for boost asio APIs.
|
|
template<std::size_t PacketIdBytes>
class async_mqtt::basic_packet_variant< PacketIdBytes >
The varaint type of all packets and system_error.
Thread Safety
- Distinct objects: Safe
- Shared objects: Unsafe
Requirements
◆ basic_packet_variant()
template<std::size_t PacketIdBytes>
template<typename Packet , std::enable_if_t< !std::is_same_v< std::decay_t< Packet >,
basic_packet_variant< PacketIdBytes > >, std::nullptr_t > = nullptr>
◆ const_buffer_sequence()
template<std::size_t PacketIdBytes>
Create const buffer sequence it is for boost asio APIs.
- Returns
- const buffer sequence
◆ get() [1/2]
template<std::size_t PacketIdBytes>
template<typename T >
Get by type. If not match, then throw std::bad_variant_access exception.
- Returns
- actual packet
◆ get() [2/2]
template<std::size_t PacketIdBytes>
template<typename T >
Get by type. If not match, then throw std::bad_variant_access exception.
- Returns
- actual packet
◆ get_if() [1/2]
template<std::size_t PacketIdBytes>
template<typename T >
Get by type pointer.
- Returns
- actual packet pointer. If not match then return nullptr.
◆ get_if() [2/2]
template<std::size_t PacketIdBytes>
template<typename T >
Get by type pointer.
- Returns
- actual packet pointer. If not match then return nullptr.
◆ type()
template<std::size_t PacketIdBytes>
Get control_packet_type.
- Returns
- If packet is stored then return its control_packet_type, If error then return std::nullopt.
◆ visit() [1/3]
template<std::size_t PacketIdBytes>
template<typename Func >
visit to variant
- Parameters
-
◆ visit() [2/3]
template<std::size_t PacketIdBytes>
template<typename Func >
visit to variant
- Parameters
-
◆ visit() [3/3]
template<std::size_t PacketIdBytes>
template<typename Func >
visit to variant
- Parameters
-
◆ operator<
template<std::size_t PacketIdBytes>
less than operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs less than the rhs, otherwise false.
◆ operator<<()
template<std::size_t PacketIdBytes>
stream output operator
- Parameters
-
- Returns
- output stream
◆ operator==
template<std::size_t PacketIdBytes>
equal operator
- Parameters
-
lhs | compare target |
rhs | compare target |
- Returns
- true if the lhs equal to the rhs, otherwise false.
The documentation for this class was generated from the following files: