|
Dev Essential
1.6.3
|
#include <variant.h>
Public Member Functions | |
| Variant () | |
| CTOR: VT_Empty. | |
| Variant (bool value) | |
| Variant (std::int8_t value) | |
| Variant (std::uint8_t value) | |
| Variant (std::int16_t value) | |
| Variant (std::uint16_t value) | |
| Variant (std::int32_t value) | |
| Variant (std::uint32_t value) | |
| Variant (std::int64_t value) | |
| Variant (std::uint64_t value) | |
| Variant (float value) | |
| Variant (double value) | |
| Variant (const char *value) | |
| Variant (const Variant &other) | |
| Variant & | operator= (const Variant &other) |
| ~Variant () | |
| Non-virtual DTOR. | |
| Variant (Variant &&other) noexcept | |
| Variant & | operator= (Variant &&other) noexcept |
| VariantType | getType () const |
| Returns the current underlying data type of the instance. | |
| std::size_t | getArraySize () const |
| std::size_t | getStringSize () const |
| 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) |
| void | reset (std::int8_t value) |
| void | reset (std::uint8_t value) |
| void | reset (std::int16_t value) |
| void | reset (std::uint16_t value) |
| void | reset (std::int32_t value) |
| void | reset (std::uint32_t value) |
| void | reset (std::int64_t value) |
| void | reset (std::uint64_t value) |
| void | reset (float value) |
| void | reset (double value) |
| void | reset (const char *value) |
| void | reset (const bool *array_storage, std::size_t array_size) |
| void | reset (const std::int8_t *array_storage, std::size_t array_size) |
| void | reset (const std::uint8_t *array_storage, std::size_t array_size) |
| void | reset (const std::int16_t *array_storage, std::size_t array_size) |
| void | reset (const std::uint16_t *array_storage, std::size_t array_size) |
| void | reset (const std::int32_t *array_storage, std::size_t array_size) |
| void | reset (const std::uint32_t *array_storage, std::size_t array_size) |
| void | reset (const std::int64_t *array_storage, std::size_t array_size) |
| void | reset (const std::uint64_t *array_storage, std::size_t array_size) |
| void | reset (const float *array_storage, std::size_t array_size) |
| void | reset (const double *array_storage, std::size_t array_size) |
| bool | getBool (std::size_t array_index=0) const |
| std::int8_t | getInt8 (std::size_t array_index=0) const |
| std::uint8_t | getUInt8 (std::size_t array_index=0) const |
| std::int16_t | getInt16 (std::size_t array_index=0) const |
| std::uint16_t | getUInt16 (std::size_t array_index=0) const |
| std::int32_t | getInt32 (std::size_t array_index=0) const |
| std::uint32_t | getUInt32 (std::size_t array_index=0) const |
| std::int64_t | getInt64 (std::size_t array_index=0) const |
| std::uint64_t | getUInt64 (std::size_t array_index=0) const |
| float | getFloat (std::size_t array_index=0) const |
| double | getDouble (std::size_t array_index=0) const |
| float | getFloat32 (std::size_t array_index=0) const |
| double | getFloat64 (std::size_t array_index=0) const |
| const char * | getString () const |
| bool | asBool () const |
| std::int8_t | asInt8 () const |
| std::uint8_t | asUInt8 () const |
| std::int16_t | asInt16 () const |
| std::uint16_t | asUInt16 () const |
| std::int32_t | asInt32 () const |
| std::uint32_t | asUInt32 () const |
| std::int64_t | asInt64 () const |
| std::uint64_t | asUInt64 () const |
| float | asFloat () const |
| double | asDouble () const |
| std::string | asString () const |
| operator bool () const | |
| operator std::int8_t () const | |
| operator std::uint8_t () const | |
| operator std::int16_t () const | |
| operator std::uint16_t () const | |
| operator std::int32_t () const | |
| operator std::uint32_t () const | |
| operator std::int64_t () const | |
| operator std::uint64_t () const | |
| operator float () const | |
| operator double () const | |
| operator std::string () const | |
| Variant & | operator= (bool value) |
| Variant & | operator= (std::int8_t value) |
| Variant & | operator= (std::uint8_t value) |
| Variant & | operator= (std::int16_t value) |
| Variant & | operator= (std::uint16_t value) |
| Variant & | operator= (std::int32_t value) |
| Variant & | operator= (std::uint32_t value) |
| Variant & | operator= (std::int64_t value) |
| Variant & | operator= (std::uint64_t value) |
| Variant & | operator= (float value) |
| Variant & | operator= (double value) |
| Variant & | operator= (const char *value) |
Friends | |
| bool | operator== (const Variant &lhs, const Variant &rhs) |
Container type, able to store any primitive data type (and arrays thereof)
| a_util::variant::Variant::Variant | ( | bool | value | ) |
CTOR: VT_Bool
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::int8_t | value | ) |
CTOR: VT_Int8
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::uint8_t | value | ) |
CTOR: VT_UInt8
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::int16_t | value | ) |
CTOR: VT_Int16
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::uint16_t | value | ) |
CTOR: VT_UInt16
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::int32_t | value | ) |
CTOR: VT_Int32
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::uint32_t | value | ) |
CTOR: VT_UInt32
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::int64_t | value | ) |
CTOR: VT_Int64
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | std::uint64_t | value | ) |
CTOR: VT_UInt64
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | float | value | ) |
CTOR: VT_Float32
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | double | value | ) |
CTOR: VT_Float64
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | const char * | value | ) |
CTOR: VT_String
| [in] | value | Value of the variant |
| a_util::variant::Variant::Variant | ( | const Variant & | other | ) |
Copy CTOR
| [in] | other | Other variant object to copy construct *this from |
|
noexcept |
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 a_util::variant::Variant::asBool | ( | ) | const |
Convert the value of the variant
| std::runtime_error | If variant is either VT_Empty or the type is unknown |
| double a_util::variant::Variant::asDouble | ( | ) | const |
Convert the value of the variant
| std::runtime_error | If variant is either VT_Empty or the type is unknown |
| float a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::asInt8 | ( | ) | const |
Convert the value of the variant
| std::runtime_error | If variant is either VT_Empty or the type is unknown |
| std::string a_util::variant::Variant::asString | ( | ) | const |
Convert the value of the variant
| std::runtime_error | If variant is either VT_Empty or the type is unknown |
| std::uint16_t a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::getArraySize | ( | ) | const |
Get the current array size of the instance
| bool a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 * a_util::variant::Variant::getString | ( | ) | const |
Get current string value
| std::runtime_error | If variant type is different to the requested type |
| std::size_t a_util::variant::Variant::getStringSize | ( | ) | const |
Get the current string size of the instance for VT_String, not counting the trailing null byte.
| std::uint16_t a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 |
| a_util::variant::Variant::operator bool | ( | ) | const |
| a_util::variant::Variant::operator double | ( | ) | const |
| a_util::variant::Variant::operator float | ( | ) | const |
| a_util::variant::Variant::operator std::int16_t | ( | ) | const |
| a_util::variant::Variant::operator std::int32_t | ( | ) | const |
| a_util::variant::Variant::operator std::int64_t | ( | ) | const |
| a_util::variant::Variant::operator std::int8_t | ( | ) | const |
| a_util::variant::Variant::operator std::string | ( | ) | const |
| a_util::variant::Variant::operator std::uint16_t | ( | ) | const |
| a_util::variant::Variant::operator std::uint32_t | ( | ) | const |
| a_util::variant::Variant::operator std::uint64_t | ( | ) | const |
| a_util::variant::Variant::operator std::uint8_t | ( | ) | const |
| Variant & a_util::variant::Variant::operator= | ( | bool | value | ) |
Assignment operator for implicit type conversion to VT_Bool
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::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 & a_util::variant::Variant::operator= | ( | double | value | ) |
Assignment operator for implicit type conversion to VT_Double
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | float | value | ) |
Assignment operator for implicit type conversion to VT_Float
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::int16_t | value | ) |
Assignment operator for implicit type conversion to VT_Int16
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::int32_t | value | ) |
Assignment operator for implicit type conversion to VT_Int32
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::int64_t | value | ) |
Assignment operator for implicit type conversion to VT_Int64
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::int8_t | value | ) |
Assignment operator for implicit type conversion to VT_Int8
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::uint16_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt16
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::uint32_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt32
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::Variant::operator= | ( | std::uint64_t | value | ) |
Assignment operator for implicit type conversion to VT_UInt64
| [in] | value | Other value to assign *this from |
| Variant & a_util::variant::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 a_util::variant::Variant::reset | ( | bool | value | ) |
Resets the instance to VT_Bool
| [in] | value | Value of the variant |
| void a_util::variant::Variant::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 a_util::variant::Variant::reset | ( | const char * | value | ) |
Resets the instance to VT_String
| [in] | value | Value of the variant |
| void a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::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 a_util::variant::Variant::reset | ( | double | value | ) |
Resets the instance to VT_Double
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | float | value | ) |
Resets the instance to VT_Float
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::int16_t | value | ) |
Resets the instance to VT_Int16
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::int32_t | value | ) |
Resets the instance to VT_Int32
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::int64_t | value | ) |
Resets the instance to VT_Int64
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::int8_t | value | ) |
Resets the instance to VT_Int8
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::uint16_t | value | ) |
Resets the instance to VT_UInt16
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::uint32_t | value | ) |
Resets the instance to VT_UInt32
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::uint64_t | value | ) |
Resets the instance to VT_UInt64
| [in] | value | Value of the variant |
| void a_util::variant::Variant::reset | ( | std::uint8_t | value | ) |
Resets the instance to VT_UInt8
| [in] | value | Value of the variant |
Compare for equality
| [in] | lhs | Left hand side operand |
| [in] | rhs | Right hand side operand |
true if both are equal, false otherwise