cee::Variant
-
class
Variant
The Variant class acts like a union for the most common data types.
A Variant object holds a single value of a single type() at a time. The methods named get*() (e.g., getInt(), getString()) are const.
Public Types
-
enum
DataType
List of variant data types.
Values:
-
enumerator
INVALID
Invalid.
-
enumerator
INT
Integer data type (int)
-
enumerator
UINT
Unsigned integer data type (unsigned int)
-
enumerator
DOUBLE
Double precision data type (double)
-
enumerator
FLOAT
Floating point data type (float)
-
enumerator
BOOL
Boolean data type (bool)
-
enumerator
VEC3D
Vector data type (cee::Vec3d)
-
enumerator
COLOR3F
Color data type (cee::Color3f)
-
enumerator
ARRAY
Array data type (std::vector)
-
enumerator
Public Functions
-
Variant
() Creates an empty Variant.
-
Variant
(int val) Creates a Variant with the int value val.
-
Variant
(unsigned int val) Creates a Variant with the unsigned int value val.
-
Variant
(double val) Creates a Variant with the double value val.
-
Variant
(float val) Creates a Variant with the float value val.
-
Variant
(bool val) Creates a Variant with the bool value val.
-
Variant
(const char *val) Creates a Variant with the const char pointer val.
-
Variant &
operator=
(const Variant &rhs) Assigns rhs to this and returns a reference to this Variant.
-
bool
operator==
(const Variant &rhs) const Returns true if rhs is equal to this Variant; otherwise returns false.
-
bool
operator!=
(const Variant &rhs) const Returns true if rhs is not equal to this Variant; otherwise returns false.
-
bool
isValid
() const Returns true if this is a valid Variant.
-
int
getInt
() const Returns the current value as an int.
Assumes that the type of the Variant is INT. No conversion is done.
-
unsigned int
getUInt
() const Returns the current value as an unsigned int.
Assumes that the type of the Variant is UINT. No conversion is done.
-
double
getDouble
() const Returns the current value as a double.
Assumes that the type of the Variant is DOUBLE. No conversion is done.
-
float
getFloat
() const Returns the current value as a float.
Assumes that the type of the Variant is FLOAT. No conversion is done.
-
bool
getBool
() const Returns the current value as a bool.
Assumes that the type of the Variant is BOOL. No conversion is done.
-
Vec3d
getVec3d
() const Returns the current value as a Vec3d.
Assumes that the type of the Variant is VEC3D. No conversion is done.
-
Color3f
getColor3f
() const Returns the current value as a Color3f.
Assumes that the type of the Variant is COLOR3F. No conversion is done.
-
enum