Struct CustomValueVariant#

Struct Documentation#

struct CustomValueVariant#

Variant for CustomValue.

Public Types

enum class Type#

Values that represent the type represented by this variant.

Values:

enumerator Invalid#

An enum constant representing the ‘invalid’ type (would throw an invalid-argument-exception).

enumerator Int32#

An enum constant representing the ‘signed 32-bit integer’ type.

enumerator Float#

An enum constant representing the ‘float’ type.

enumerator Double#

An enum constant representing the ‘double’ type.

enumerator Boolean#

An enum constant representing the ‘boolean’ type.

enumerator String#

An enum constant representing the ‘string’ type.

Public Functions

inline CustomValueVariant()#

Default constructor - setting the variant to ‘invalid’.

inline explicit CustomValueVariant(std::int32_t v)#

Constructor for initializing the ‘int32’ type.

Parameters:

v – The value to set the variant to.

inline explicit CustomValueVariant(double v)#

Constructor for initializing the ‘double’ type.

Parameters:

v – The value to set the variant to.

inline explicit CustomValueVariant(float v)#

Constructor for initializing the ‘float’ type.

Parameters:

v – The value to set the variant to.

inline explicit CustomValueVariant(bool v)#

Constructor for initializing the ‘bool’ type.

Parameters:

v – The value to set the variant to.

inline explicit CustomValueVariant(const std::string &v)#

Constructor for initializing the ‘string’ type.

Parameters:

v – The value to set the variant to.

inline explicit CustomValueVariant(const char *string)#

Constructor for initializing the ‘string’ type.

Parameters:

string – The value to set the variant to.

inline void SetInt32(std::int32_t v)#

Sets the type of the variant to “Int32” and the value to the specified value.

Parameters:

v – The value to be set.

inline void SetDouble(double v)#

Sets the type of the variant to “Double” and the value to the specified value.

Parameters:

v – The value to be set.

inline void SetFloat(float v)#

Sets the type of the variant to “Float” and the value to the specified value.

Parameters:

v – The value to be set.

inline void SetBool(bool v)#

Sets the type of the variant to “Boolean” and the value to the specified value.

Parameters:

v – The value to be set.

inline void SetString(const std::string &v)#

Sets the type of the variant to “String” and the value to the specified value.

Parameters:

v – The value to be set.

inline std::int32_t GetAsInt32OrThrow() const#

Returns integer value if ValueType is int, otherwise throws a RuntimeError.

inline double GetAsDoubleOrThrow() const#

Returns double value if ValueType is double, otherwise throws a RuntimeError.

inline float GetAsFloatOrThrow() const#

Returns float value if ValueType is ‘Float’, otherwise throws a RuntimeError.

inline bool GetAsBoolOrThrow() const#

Returns boolean value if ValueType is boolean, otherwise throws a RuntimeError.

inline std::string GetAsStringOrThrow() const#

Returns string value if ValueType is string, otherwise throws a RuntimeError.

inline Type GetType() const#

Returns ValueType.

Public Members

std::int32_t int32Value#
float floatValue#
double doubleValue#
bool boolValue#