ADTF
|
Container type, able to store any primitive data type (and arrays thereof) More...
Public Member Functions | |
Variant () | |
CTOR: VT_Empty. | |
Variant (bool value) | |
CTOR: VT_Bool. More... | |
Variant (std::int8_t value) | |
CTOR: VT_Int8. More... | |
Variant (std::uint8_t value) | |
CTOR: VT_UInt8. More... | |
Variant (std::int16_t value) | |
CTOR: VT_Int16. More... | |
Variant (std::uint16_t value) | |
CTOR: VT_UInt16. More... | |
Variant (std::int32_t value) | |
CTOR: VT_Int32. More... | |
Variant (std::uint32_t value) | |
CTOR: VT_UInt32. More... | |
Variant (std::int64_t value) | |
CTOR: VT_Int64. More... | |
Variant (std::uint64_t value) | |
CTOR: VT_UInt64. More... | |
Variant (float value) | |
CTOR: VT_Float32. More... | |
Variant (double value) | |
CTOR: VT_Float64. More... | |
Variant (const char *value) | |
CTOR: VT_String. More... | |
Variant (const Variant &other) | |
Copy CTOR. More... | |
Variant & | operator= (const Variant &other) |
Assignment operator. More... | |
~Variant () | |
Non-virtual DTOR. | |
Variant (Variant &&other) noexcept | |
Move CTOR. More... | |
Variant & | operator= (Variant &&other) noexcept |
Move assignment. More... | |
VariantType | getType () const |
Returns the current underlying data type of the instance. | |
std::size_t | getArraySize () const |
Get the current array size of the instance. More... | |
bool | isArray () const |
Returns whether the instance stores an array of any kind. | |
bool | isEmpty () const |
Returns whether the instance is in the empty state (VT_Empty) | |
void | reset () |
Resets the instance to VT_Empty. | |
void | reset (bool value) |
Resets the instance to VT_Bool. More... | |
void | reset (std::int8_t value) |
Resets the instance to VT_Int8. More... | |
void | reset (std::uint8_t value) |
Resets the instance to VT_UInt8. More... | |
void | reset (std::int16_t value) |
Resets the instance to VT_Int16. More... | |
void | reset (std::uint16_t value) |
Resets the instance to VT_UInt16. More... | |
void | reset (std::int32_t value) |
Resets the instance to VT_Int32. More... | |
void | reset (std::uint32_t value) |
Resets the instance to VT_UInt32. More... | |
void | reset (std::int64_t value) |
Resets the instance to VT_Int64. More... | |
void | reset (std::uint64_t value) |
Resets the instance to VT_UInt64. More... | |
void | reset (float value) |
Resets the instance to VT_Float. More... | |
void | reset (double value) |
Resets the instance to VT_Double. More... | |
void | reset (const char *value) |
Resets the instance to VT_String. More... | |
void | reset (const bool *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Bool. More... | |
void | reset (const std::int8_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Int8. More... | |
void | reset (const std::uint8_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_UInt8. More... | |
void | reset (const std::int16_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Int16. More... | |
void | reset (const std::uint16_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_UInt16. More... | |
void | reset (const std::int32_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Int32. More... | |
void | reset (const std::uint32_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_UInt32. More... | |
void | reset (const std::int64_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Int64. More... | |
void | reset (const std::uint64_t *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_UInt64. More... | |
void | reset (const float *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Float. More... | |
void | reset (const double *array_storage, std::size_t array_size) |
Resets the instance to an array of VT_Double. More... | |
bool | getBool (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::int8_t | getInt8 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::uint8_t | getUInt8 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::int16_t | getInt16 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::uint16_t | getUInt16 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::int32_t | getInt32 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::uint32_t | getUInt32 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::int64_t | getInt64 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
std::uint64_t | getUInt64 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
float | getFloat (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
double | getDouble (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
float | getFloat32 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
double | getFloat64 (std::size_t array_index=0) const |
Get current value or alternatively from an array index of the variants value. More... | |
const char * | getString () const |
Get current string value. More... | |
bool | asBool () const |
Convert the value of the variant. More... | |
std::int8_t | asInt8 () const |
Convert the value of the variant. More... | |
std::uint8_t | asUInt8 () const |
Convert the value of the variant. More... | |
std::int16_t | asInt16 () const |
Convert the value of the variant. More... | |
std::uint16_t | asUInt16 () const |
Convert the value of the variant. More... | |
std::int32_t | asInt32 () const |
Convert the value of the variant. More... | |
std::uint32_t | asUInt32 () const |
Convert the value of the variant. More... | |
std::int64_t | asInt64 () const |
Convert the value of the variant. More... | |
std::uint64_t | asUInt64 () const |
Convert the value of the variant. More... | |
float | asFloat () const |
Convert the value of the variant. More... | |
double | asDouble () const |
Convert the value of the variant. More... | |
std::string | asString () const |
Convert the value of the variant. More... | |
operator bool () const | |
Explicit conversion of the value of the variant to VT_Bool. More... | |
operator std::int8_t () const | |
Explicit conversion of the value of the variant to VT_Int8. More... | |
operator std::uint8_t () const | |
Explicit conversion of the value of the variant to VT_UInt8. More... | |
operator std::int16_t () const | |
Explicit conversion of the value of the variant to VT_Int16. More... | |
operator std::uint16_t () const | |
Explicit conversion of the value of the variant to VT_UInt16. More... | |
operator std::int32_t () const | |
Explicit conversion of the value of the variant to VT_Int32. More... | |
operator std::uint32_t () const | |
Explicit conversion of the value of the variant to VT_UInt32. More... | |
operator std::int64_t () const | |
Explicit conversion of the value of the variant to VT_Int64. More... | |
operator std::uint64_t () const | |
Explicit conversion of the value of the variant to VT_UInt64. More... | |
operator float () const | |
Explicit conversion of the value of the variant to VT_Float. More... | |
operator double () const | |
Explicit conversion of the value of the variant to VT_Double. More... | |
operator std::string () const | |
Explicit conversion of the value of the variant to VT_String. More... | |
Variant & | operator= (bool value) |
Assignment operator for implicit type conversion to VT_Bool. More... | |
Variant & | operator= (std::int8_t value) |
Assignment operator for implicit type conversion to VT_Int8. More... | |
Variant & | operator= (std::uint8_t value) |
Assignment operator for implicit type conversion to VT_UInt8. More... | |
Variant & | operator= (std::int16_t value) |
Assignment operator for implicit type conversion to VT_Int16. More... | |
Variant & | operator= (std::uint16_t value) |
Assignment operator for implicit type conversion to VT_UInt16. More... | |
Variant & | operator= (std::int32_t value) |
Assignment operator for implicit type conversion to VT_Int32. More... | |
Variant & | operator= (std::uint32_t value) |
Assignment operator for implicit type conversion to VT_UInt32. More... | |
Variant & | operator= (std::int64_t value) |
Assignment operator for implicit type conversion to VT_Int64. More... | |
Variant & | operator= (std::uint64_t value) |
Assignment operator for implicit type conversion to VT_UInt64. More... | |
Variant & | operator= (float value) |
Assignment operator for implicit type conversion to VT_Float. More... | |
Variant & | operator= (double value) |
Assignment operator for implicit type conversion to VT_Double. More... | |
Variant & | operator= (const char *value) |
Assignment operator for implicit type conversion to VT_String. More... | |
Private Attributes | |
std::unique_ptr< Implementation > | _impl |
Container type, able to store any primitive data type (and arrays thereof)
Definition at line 46 of file workspace/conan/dev_essential/1.4.3/dw/stable/package/aef85909f792a5a628750d25016a24323084963f/include/a_util/variant/variant.h.
Variant | ( | float | value | ) |
CTOR: VT_Float32.
[in] | value | Value of the variant |
Variant | ( | double | value | ) |
CTOR: VT_Float64.
[in] | value | Value of the variant |
Copy CTOR.
[in] | other | Other variant object to copy construct *this from |
Move CTOR.
[in,out] | other | Moved-from object *this is constructed from. Left in a valid but unspecified state. Should not be used after this move ctor returns |
bool asBool | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
double asDouble | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
float asFloat | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::int16_t asInt16 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::int32_t asInt32 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::int64_t asInt64 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::int8_t asInt8 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::string asString | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
Referenced by ddl::access_element::getValueAsString().
std::uint16_t asUInt16 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::uint32_t asUInt32 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::uint64_t asUInt64 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::uint8_t asUInt8 | ( | ) | const |
Convert the value of the variant.
std::runtime_error | If variant is either VT_Empty or the type is unknown |
std::size_t getArraySize | ( | ) | const |
Get the current array size of the instance.
bool getBool | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
double getDouble | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
float getFloat | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
float getFloat32 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
double getFloat64 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::int16_t getInt16 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::int32_t getInt32 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::int64_t getInt64 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::int8_t getInt8 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
const char* getString | ( | ) | const |
Get current string value.
std::runtime_error | If variant type is different to the requested type |
std::uint16_t getUInt16 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::uint32_t getUInt32 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::uint64_t getUInt64 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
std::uint8_t getUInt8 | ( | std::size_t | array_index = 0 | ) | const |
Get current value or alternatively from an array index of the variants value.
[in] | array_index | Index of the value to retrieve from the array (default: 0). Must be zero, if variant is not an array. |
std::runtime_error | If variant type is different to the requested type |
std::out_of_range | If array_index is out of range or the variant is not an array |
operator bool | ( | ) | const |
operator double | ( | ) | const |
operator float | ( | ) | const |
operator std::int16_t | ( | ) | const |
operator std::int32_t | ( | ) | const |
operator std::int64_t | ( | ) | const |
operator std::int8_t | ( | ) | const |
operator std::string | ( | ) | const |
operator std::uint16_t | ( | ) | const |
operator std::uint32_t | ( | ) | const |
operator std::uint64_t | ( | ) | const |
operator std::uint8_t | ( | ) | const |
Variant& operator= | ( | bool | value | ) |
Assignment operator for implicit type conversion to VT_Bool.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | const char * | value | ) |
Assignment operator for implicit type conversion to VT_String.
[in] | value | Other value to assign *this from |
Assignment operator.
[in] | other | Other object to assign *this from |
Variant& operator= | ( | double | value | ) |
Assignment operator for implicit type conversion to VT_Double.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | float | value | ) |
Assignment operator for implicit type conversion to VT_Float.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::int16_t | value | ) |
Assignment operator for implicit type conversion to VT_Int16.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::int32_t | value | ) |
Assignment operator for implicit type conversion to VT_Int32.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::int64_t | value | ) |
Assignment operator for implicit type conversion to VT_Int64.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::int8_t | value | ) |
Assignment operator for implicit type conversion to VT_Int8.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::uint16_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt16.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::uint32_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt32.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::uint64_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt64.
[in] | value | Other value to assign *this from |
Variant& operator= | ( | std::uint8_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt8.
[in] | value | Other value to assign *this from |
Move assignment.
[in,out] | other | Moved-from object *this is assigned from. Left in a valid but unspecified state. Should not be used after this assignment operator returns. |
*this |
void reset | ( | bool | value | ) |
Resets the instance to VT_Bool.
[in] | value | Value of the variant |
void reset | ( | const bool * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Bool.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const char * | value | ) |
Resets the instance to VT_String.
[in] | value | Value of the variant |
void reset | ( | const double * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Double.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const float * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Float.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::int16_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Int16.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::int32_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Int32.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::int64_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Int64.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::int8_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_Int8.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::uint16_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_UInt16.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::uint32_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_UInt32.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::uint64_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_UInt64.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | const std::uint8_t * | array_storage, |
std::size_t | array_size | ||
) |
Resets the instance to an array of VT_UInt8.
[in] | array_storage | Pointer to begin of the array |
[in] | array_size | Size of the array array_storage points to |
std::invalid_argument | if either array_storage is nullptr or array_size is zero |
void reset | ( | double | value | ) |
Resets the instance to VT_Double.
[in] | value | Value of the variant |
void reset | ( | float | value | ) |
Resets the instance to VT_Float.
[in] | value | Value of the variant |
void reset | ( | std::int16_t | value | ) |
Resets the instance to VT_Int16.
[in] | value | Value of the variant |
void reset | ( | std::int32_t | value | ) |
Resets the instance to VT_Int32.
[in] | value | Value of the variant |
void reset | ( | std::int64_t | value | ) |
Resets the instance to VT_Int64.
[in] | value | Value of the variant |
void reset | ( | std::int8_t | value | ) |
Resets the instance to VT_Int8.
[in] | value | Value of the variant |
void reset | ( | std::uint16_t | value | ) |
Resets the instance to VT_UInt16.
[in] | value | Value of the variant |
void reset | ( | std::uint32_t | value | ) |
Resets the instance to VT_UInt32.
[in] | value | Value of the variant |
void reset | ( | std::uint64_t | value | ) |
Resets the instance to VT_UInt64.
[in] | value | Value of the variant |
void reset | ( | std::uint8_t | value | ) |
Resets the instance to VT_UInt8.
[in] | value | Value of the variant |