|
| class | reader_type |
| |
| class | reader_type< R1, no_type2, no_type3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Define the reader type for 1 type. More...
|
| |
| class | reader_type< R1, R2, no_type3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Define the reader type for 2 types. More...
|
| |
| class | reader_type< R1, R2, R3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Define the reader type for 3 types. More...
|
| |
| class | reader_type< R1, R2, R3, R4, no_type5, no_type6, no_type7, no_type8 > |
| | Define the reader type for 4 types. More...
|
| |
| class | reader_type< R1, R2, R3, R4, R5, no_type6, no_type7, no_type8 > |
| | Define the reader type for 5 types. More...
|
| |
| class | reader_type< R1, R2, R3, R4, R5, R6, no_type7, no_type8 > |
| | Define the reader type for 6 types. More...
|
| |
| class | reader_type< R1, R2, R3, R4, R5, R6, R7, no_type8 > |
| | Define the reader type for 7 types. More...
|
| |
| class | upcast_functor |
| | Base upcast_functor for eight types. More...
|
| |
| class | upcast_functor< TBase, U1, no_type2, no_type3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Upcast_functor for one type. More...
|
| |
| class | upcast_functor< TBase, U1, U2, no_type3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Upcast_functor for two types. More...
|
| |
| class | upcast_functor< TBase, U1, U2, U3, no_type4, no_type5, no_type6, no_type7, no_type8 > |
| | Upcast_functor for three types. More...
|
| |
| class | upcast_functor< TBase, U1, U2, U3, U4, no_type5, no_type6, no_type7, no_type8 > |
| | Upcast_functor for four types. More...
|
| |
| class | upcast_functor< TBase, U1, U2, U3, U4, U5, no_type6, no_type7, no_type8 > |
| | Upcast_functor for five types. More...
|
| |
| class | upcast_functor< TBase, U1, U2, U3, U4, U5, U6, no_type7, no_type8 > |
| | Upcast_functor for six types. More...
|
| |
| class | upcast_functor< TBase, U1, U2, U3, U4, U5, U6, U7, no_type8 > |
| | Upcast_functor for seven types. More...
|
| |
|
| | variant () |
| |
| template<typename T > |
| | variant (T value) |
| |
| | variant (const variant &other) |
| |
| template<typename T > |
| variant & | operator= (typename parameter_type< T >::type value) |
| |
| bool | is_same_type (const variant &other) const |
| |
| template<typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 > |
| bool | is_same_type (const variant< U1, U2, U3, U4, U5, U6, U7, U8 > &other) const |
| |
| void | call (reader &reader) |
| |
| bool | is_valid () const |
| |
| template<typename T > |
| bool | is_type () const |
| |
|
void | clear () |
| | Clears the value to 'no valid stored value'.
|
| |
| template<typename T > |
| T & | get () |
| |
| template<typename T > |
| const T & | get () const |
| |
| template<typename TBase > |
| TBase & | upcast () |
| |
| template<typename TBase > |
| const TBase & | upcast () const |
| |
|
| operator T1 & () |
| | Conversion operators for each type.
|
| |
|
| operator T2 & () |
| |
|
| operator T3 & () |
| |
|
| operator T4 & () |
| |
|
| operator T5 & () |
| |
|
| operator T6 & () |
| |
|
| operator T7 & () |
| |
|
| operator T8 & () |
| |
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
class etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >
A template class that can store any of the types defined in the template parameter list. Supports up to 8 types.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
Default constructor. Sets the state of the instance to containing no valid data.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
Constructor that catches any types that are not supported. Forces a static_assert.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
| etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::variant |
( |
const variant< T1, T2, T3, T4, T5, T6, T7, T8 > & |
other | ) |
|
|
inline |
Copy constructor.
- Parameters
-
| other>The | other variant object to copy. |
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
Calls the supplied reader instance. The 'read' function appropriate to the current type is called with the stored value.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
Gets the value stored as the specified template type. Throws a variant_incorrect_type_exception if the actual type is not that specified.
- Returns
- A reference to the value.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
| const T& etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::get |
( |
| ) |
const |
|
inline |
Gets the value stored as the specified template type. Throws a variant_incorrect_type_exception if the actual type is not that specified.
- Returns
- A const reference to the value.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
| bool etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::is_same_type |
( |
const variant< T1, T2, T3, T4, T5, T6, T7, T8 > & |
other | ) |
const |
|
inline |
Checks if the type is the same as the current stored type. For variants with the same type declarations.
- Returns
- true if the types are the same, otherwise false.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 >
| bool etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::is_same_type |
( |
const variant< U1, U2, U3, U4, U5, U6, U7, U8 > & |
other | ) |
const |
|
inline |
Checks if the type is the same as the current stored type. For variants with differing declarations.
- Returns
- true if the types are the same, otherwise false.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
| static bool etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::is_supported_type |
( |
| ) |
|
|
inlinestatic |
Checks if the template type is supported by the implementation of variant..
- Returns
- true if the type is supported, otherwise false.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
| bool etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::is_type |
( |
| ) |
const |
|
inline |
Checks to see if the type currently stored is the same as that specified in the template parameter.
- Returns
- true if it is the specified type, otherwise false.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
| bool etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::is_valid |
( |
| ) |
const |
|
inline |
Checks whether a valid value is currently stored.
- Returns
- true if the value is valid, otherwise false.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename T >
| variant& etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::operator= |
( |
typename parameter_type< T >::type |
value | ) |
|
|
inline |
Assignment operator for T1 type.
- Parameters
-
| value>The | value to assign. |
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename TBase >
| TBase& etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::upcast |
( |
| ) |
|
|
inline |
Gets the value stored as the specified template type.
- Returns
- A reference to the value.
template<typename T1, typename T2 = __private_variant__::no_type<2>, typename T3 = __private_variant__::no_type<3>, typename T4 = __private_variant__::no_type<4>, typename T5 = __private_variant__::no_type<5>, typename T6 = __private_variant__::no_type<6>, typename T7 = __private_variant__::no_type<7>, typename T8 = __private_variant__::no_type<8>>
template<typename TBase >
| const TBase& etl::variant< T1, T2, T3, T4, T5, T6, T7, T8 >::upcast |
( |
| ) |
const |
|
inline |
Gets the value stored as the specified template type.
- Returns
- A const reference to the value.