Generic object to store a set of datatypes in without losing type safety. More...
#include <Variant.hpp>
Classes | |
| struct | from_any_tag |
| struct | from_basic_type_tag |
Public Member Functions | |
| template<typename U> | |
| Variant (from_basic_type_tag, U) | |
| Variant (from_any_tag, std::any) | |
| template<typename U> | |
| Variant (U u) | |
| Construct a lightweight wrapper around a generic object that indicates the concrete datatype of the specific object stored. | |
| template<typename U> | |
| U const & | get () const |
| Retrieve a stored specific object of known datatype with ensured type-safety. | |
| template<typename variant_t> | |
| variant_t const & | getVariant () const |
| Retrieve the stored generic object. | |
| std::any const & | getAny () const |
| size_t | index () const |
| Retrieve the index of the alternative that is currently been held. | |
| template<typename U> | |
| U const & | get () const |
Public Attributes | |
| T_DTYPES | dtype |
Static Public Attributes | |
| static constexpr from_basic_type_tag | from_basic_type |
| static constexpr from_any_tag | from_any = from_any_tag{} |
Generic object to store a set of datatypes in without losing type safety.
| T_DTYPES | Enumeration of datatypes to be stored and identified. |
| T | Varaidic template argument list of datatypes to be stored. |
| openPMD::auxiliary::Variant< T_DTYPES, variant_types >::Variant | ( | U | u | ) |
Construct a lightweight wrapper around a generic object that indicates the concrete datatype of the specific object stored.
| u | Generic object to be stored. |
|
nodiscard |
Retrieve a stored specific object of known datatype with ensured type-safety.
| std::bad_variant_access | if stored object is not of type U. |
| U | Type of the object to be retrieved. |
|
inlinenodiscard |
Retrieve the stored generic object.
|
nodiscard |
Retrieve the index of the alternative that is currently been held.
|
staticconstexpr |