Loading...
Searching...
No Matches
sdbus::Variant Class Reference

`#include <Types.h>`

## Public Member Functions

template<typename ValueType>
| Variant (const ValueType &value)
| Variant (const Variant &value, embed_variant_t)
template<typename Struct>
| Variant (const as_dictionary< Struct > &value)
template<typename... Elements>
| Variant (const std::variant< Elements... > &value)
template<typename ValueType>
ValueType | get () const
std::string | dumpToString () const
template<typename ValueType, typename = std::enable_if_t<signature_of<ValueType>::is_valid>>
| operator ValueType () const
template<typename... Elements>
| operator std::variant< Elements... > () const
template<typename Type>
bool | containsValueOfType () const
bool | isEmpty () const
void | serializeTo (Message &msg) const
void | deserializeFrom (Message &msg)
const char * | peekValueType () const

## Detailed Description

Variant can hold value of any D-Bus-supported type.

Note: Even though thread-aware, Variant objects are not thread-safe. Some const methods are conceptually const, but not physically const, thus are not thread-safe. This is by design: normally, clients should process a single Variant object in a single thread at a time. Otherwise, they need to take care of synchronization by themselves.

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

- include/sdbus-c++/Types.h