15 #ifndef _A_UTILS_UTIL_VARIANT_VARIANT_HEADER_INCLUDED_
16 #define _A_UTILS_UTIL_VARIANT_VARIANT_HEADER_INCLUDED_
228 void reset(
const bool* array_storage, std::size_t array_size);
235 void reset(
const std::int8_t* array_storage, std::size_t array_size);
242 void reset(
const std::uint8_t* array_storage, std::size_t array_size);
249 void reset(
const std::int16_t* array_storage, std::size_t array_size);
256 void reset(
const std::uint16_t* array_storage, std::size_t array_size);
263 void reset(
const std::int32_t* array_storage, std::size_t array_size);
270 void reset(
const std::uint32_t* array_storage, std::size_t array_size);
277 void reset(
const std::int64_t* array_storage, std::size_t array_size);
284 void reset(
const std::uint64_t* array_storage, std::size_t array_size);
291 void reset(
const float* array_storage, std::size_t array_size);
298 void reset(
const double* array_storage, std::size_t array_size);
308 bool getBool(std::size_t array_index = 0)
const;
310 std::int8_t
getInt8(std::size_t array_index = 0)
const;
312 std::uint8_t
getUInt8(std::size_t array_index = 0)
const;
314 std::int16_t
getInt16(std::size_t array_index = 0)
const;
316 std::uint16_t
getUInt16(std::size_t array_index = 0)
const;
318 std::int32_t
getInt32(std::size_t array_index = 0)
const;
320 std::uint32_t
getUInt32(std::size_t array_index = 0)
const;
322 std::int64_t
getInt64(std::size_t array_index = 0)
const;
324 std::uint64_t
getUInt64(std::size_t array_index = 0)
const;
374 operator bool()
const;
380 operator std::int8_t()
const;
386 operator std::uint8_t()
const;
392 operator std::int16_t()
const;
398 operator std::uint16_t()
const;
404 operator std::int32_t()
const;
410 operator std::uint32_t()
const;
416 operator std::int64_t()
const;
422 operator std::uint64_t()
const;
428 operator float()
const;
434 operator double()
const;
440 operator std::string()
const;
524 class Implementation;
525 std::unique_ptr<Implementation> _impl;
Container type, able to store any primitive data type (and arrays thereof)
Variant & operator=(std::int8_t value)
Assignment operator for implicit type conversion to VT_Int8.
void reset(const std::uint16_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_UInt16.
std::int32_t getInt32(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
void reset(const float *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Float.
float getFloat32(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
std::uint32_t getUInt32(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
Variant(const Variant &other)
Copy CTOR.
double getFloat64(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
void reset(const std::uint8_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_UInt8.
float getFloat(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
Variant(std::uint8_t value)
CTOR: VT_UInt8.
std::string asString() const
Convert the value of the variant.
Variant & operator=(double value)
Assignment operator for implicit type conversion to VT_Double.
bool getBool(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
const char * getString() const
Get current string value.
std::uint16_t asUInt16() const
Convert the value of the variant.
Variant & operator=(std::uint8_t value)
Assignment operator for implicit type conversion to VT_UInt8.
void reset(const char *value)
Resets the instance to VT_String.
void reset(std::uint64_t value)
Resets the instance to VT_UInt64.
std::int8_t asInt8() const
Convert the value of the variant.
void reset(std::uint8_t value)
Resets the instance to VT_UInt8.
std::uint16_t getUInt16(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
void reset(std::int64_t value)
Resets the instance to VT_Int64.
std::int8_t getInt8(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
void reset(bool value)
Resets the instance to VT_Bool.
double getDouble(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
Variant & operator=(const char *value)
Assignment operator for implicit type conversion to VT_String.
void reset(const std::uint64_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_UInt64.
void reset(std::uint16_t value)
Resets the instance to VT_UInt16.
Variant(const char *value)
CTOR: VT_String.
void reset(float value)
Resets the instance to VT_Float.
void reset(std::int8_t value)
Resets the instance to VT_Int8.
void reset(const std::int8_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Int8.
Variant(bool value)
CTOR: VT_Bool.
std::uint64_t asUInt64() const
Convert the value of the variant.
~Variant()
Non-virtual DTOR.
Variant(float value)
CTOR: VT_Float32.
Variant & operator=(std::int64_t value)
Assignment operator for implicit type conversion to VT_Int64.
Variant(std::uint16_t value)
CTOR: VT_UInt16.
Variant(double value)
CTOR: VT_Float64.
float asFloat() const
Convert the value of the variant.
void reset(const std::int64_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Int64.
Variant(std::uint64_t value)
CTOR: VT_UInt64.
Variant & operator=(const Variant &other)
Assignment operator.
Variant(std::int64_t value)
CTOR: VT_Int64.
Variant & operator=(std::uint32_t value)
Assignment operator for implicit type conversion to VT_UInt32.
bool asBool() const
Convert the value of the variant.
Variant(std::uint32_t value)
CTOR: VT_UInt32.
std::uint8_t asUInt8() const
Convert the value of the variant.
VariantType getType() const
Returns the current underlying data type of the instance.
Variant & operator=(std::int16_t value)
Assignment operator for implicit type conversion to VT_Int16.
std::int16_t asInt16() const
Convert the value of the variant.
std::uint8_t getUInt8(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
friend bool operator==(const Variant &lhs, const Variant &rhs)
Compare for equality.
std::uint64_t getUInt64(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
std::int16_t getInt16(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
Variant(std::int8_t value)
CTOR: VT_Int8.
Variant & operator=(bool value)
Assignment operator for implicit type conversion to VT_Bool.
double asDouble() const
Convert the value of the variant.
std::size_t getArraySize() const
Get the current array size of the instance.
Variant(std::int32_t value)
CTOR: VT_Int32.
std::int64_t asInt64() const
Convert the value of the variant.
void reset(const bool *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Bool.
bool isEmpty() const
Returns whether the instance is in the empty state (VT_Empty)
Variant & operator=(std::int32_t value)
Assignment operator for implicit type conversion to VT_Int32.
void reset()
Resets the instance to VT_Empty.
Variant & operator=(std::uint64_t value)
Assignment operator for implicit type conversion to VT_UInt64.
Variant(Variant &&other) noexcept
Move CTOR.
void reset(std::int32_t value)
Resets the instance to VT_Int32.
Variant & operator=(float value)
Assignment operator for implicit type conversion to VT_Float.
void reset(std::int16_t value)
Resets the instance to VT_Int16.
Variant & operator=(Variant &&other) noexcept
Move assignment.
void reset(std::uint32_t value)
Resets the instance to VT_UInt32.
std::uint32_t asUInt32() const
Convert the value of the variant.
Variant & operator=(std::uint16_t value)
Assignment operator for implicit type conversion to VT_UInt16.
bool isArray() const
Returns whether the instance stores an array of any kind.
void reset(const std::uint32_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_UInt32.
std::int32_t asInt32() const
Convert the value of the variant.
void reset(const std::int32_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Int32.
void reset(double value)
Resets the instance to VT_Double.
Variant(std::int16_t value)
CTOR: VT_Int16.
void reset(const double *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Double.
std::int64_t getInt64(std::size_t array_index=0) const
Get current value or alternatively from an array index of the variants value.
void reset(const std::int16_t *array_storage, std::size_t array_size)
Resets the instance to an array of VT_Int16.
bool operator!=(const Variant &lhs, const Variant &rhs)
Compare for inequality.
VariantType
Enumeration of supported Variant types.
@ VT_UInt64
Variant type is std::uint64_t.
@ VT_UInt16
Variant type is std::uint16_t.
@ VT_Float
Variant type is float.
@ VT_Int8
Variant type is std::int8_t.
@ VT_Bool
Variant type is bool.
@ VT_Int16
Variant type is std::int16_t.
@ VT_UInt8
Variant type is std::uint8_t.
@ VT_Int64
Variant type is std::int64_t.
@ VT_Float64
Variant type is double.
@ VT_Double
Variant type is double.
@ VT_String
Variant type is const char*.
@ VT_Int32
Variant type is std::int32_t.
@ VT_Empty
Variant type is empty.
@ VT_Float32
Variant type is float.
@ VT_UInt32
Variant type is std::uint32_t.
Serves as the root component, with common functionality documented in core functionality.