C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Variant class implements union of most common data types in C3D Vision and supports fixed set of types. More...
#include <vsn_variant.h>
Public Member Functions | |
Variant () | |
Default constructor. | |
Variant (int value) | |
Constructor with integer value. | |
Variant (unsigned value) | |
Constructor with unsigned integer value. | |
Variant (unsigned long value) | |
Constructor with unsigned integer value. | |
Variant (bool value) | |
Constructor with bool value. | |
Variant (float value) | |
Constructor with float value. | |
Variant (double value) | |
Constructor with double value. | |
Variant (const MbVector3D &value) | |
Constructor with MbVector3D value. | |
Variant (const NodeKey &value) | |
Constructor with NodeKey value. | |
Variant (const MbHomogeneous3D &value) | |
Constructor with MbHomogeneous3D value. | |
Variant (const Color &value) | |
Constructor with Color value. | |
Variant (const String &value) | |
Constructor with String value. | |
Variant (const char *value) | |
Constructor with a pointer to char value. | |
Variant (MbItem *value) | |
Constructor with a pointer to MbItem. | |
Variant (void *value) | |
Constructor with a pointer to void value. | |
Variant (const VariantVector &value) | |
Constructor with VariantVector value. | |
Variant (const StringVector &value) | |
Constructor with StringVector value. | |
Variant (const IntVector &value) | |
Constructor with IntVector value. | |
Variant (const FloatVector &value) | |
Constructor with FloatVector value. | |
Variant (const RectI &value) | |
Constructor with integer rect value. | |
Variant (const Matrix3DF &value) | |
Constructor with Matrix3DF value. | |
Variant (const String &type, const String &value) | |
Constructor with setting type and value initialization. | |
Variant (VariantType type, const String &value) | |
Constructor with setting type and value initialization. | |
Variant (const char *type, const char *value) | |
Constructor with setting type and value initialization. | |
Variant (VariantType type, const char *value) | |
Constructor with setting type and value initialization. | |
Variant (const Variant &value) | |
Copy constructor by another variant. | |
template<typename T > | |
Variant (std::shared_ptr< T > value) | |
Constructor with a pointer to std::shared_ptr<T> value. | |
~Variant () | |
Destructor. | |
void | Clear () |
Clears variant from value and type. | |
Variant & | operator= (const Variant &other) |
Assigns value and type from another variant. | |
Variant & | operator= (int other) |
Assigns value from integer. | |
Variant & | operator= (unsigned other) |
Assigns value from unsighed integer. | |
Variant & | operator= (unsigned long other) |
Assigns value from unsigned long. | |
Variant & | operator= (bool other) |
Assigns value from bool. | |
Variant & | operator= (float other) |
Assigns value from float. | |
Variant & | operator= (double other) |
Assigns value from double. | |
Variant & | operator= (const MbVector3D &other) |
Assigns value from MbVector3D. | |
Variant & | operator= (const NodeKey &other) |
Assigns value from NodeKey. | |
Variant & | operator= (const MbHomogeneous3D &other) |
Assigns value from MbHomogeneous3D. | |
Variant & | operator= (const Color &other) |
Assigns value from color. | |
Variant & | operator= (const String &other) |
Assigns value from string. | |
Variant & | operator= (const char *other) |
Assigns value from pointer to char. | |
Variant & | operator= (void *other) |
Sets value from pointer address to void. | |
Variant & | operator= (MbItem *other) |
Sets value from pointer address to MbItem. | |
Variant & | operator= (Object *other) |
Sets value from pointer address to Object. | |
Variant & | operator= (const VariantVector &other) |
Sets value from variant vector. | |
Variant & | operator= (const StringVector &other) |
Sets value from string vector. | |
Variant & | operator= (const IntVector &other) |
Sets value from variant vector. | |
Variant & | operator= (const FloatVector &other) |
Sets value from variant vector. | |
Variant & | operator= (const RectI &other) |
Assigns value from integer rectangle. | |
Variant & | operator= (const Matrix3DF &other) |
Assigns value from Matrix3DF. | |
template<typename T > | |
Variant & | operator= (std::shared_ptr< T > other) |
Assigns value from std::shared_ptr<T>. | |
bool | operator== (const Variant &other) const |
Checks equality with another variant. Returns true if variant is equal to this one. | |
bool | operator== (int other) const |
Checks equality with integer. Returns true if there is coincidence of type and value. | |
bool | operator== (unsigned other) const |
Checks equality with unsigned integer. Returns true if there is coincidence of type and value. | |
bool | operator== (unsigned long other) const |
Checks equality with unsigned integer. Returns true if there is coincidence of type and value. | |
bool | operator== (bool other) const |
Checks equality with bool. Returns true if there is coincidence of type and value. | |
bool | operator== (float other) const |
Checks equality with float. Returns true if there is coincidence of type and value. | |
bool | operator== (double other) const |
Checks equality with double. Returns true if there is coincidence of type and value. | |
bool | operator== (const MbVector3D &other) const |
Checks equality with MbVector3D. Returns true if there is coincidence of type and value. | |
bool | operator== (const NodeKey &other) const |
Checks equality with NodeKey. Returns true if there is coincidence of type and value. | |
bool | operator== (const MbHomogeneous3D &other) const |
Checks equality with MbHomogeneous3D. Returns true if there is coincidence of type and value. | |
bool | operator== (const Color &other) const |
Checks equality with color. Returns true if there is coincidence of type and value. | |
bool | operator== (const String &other) const |
Checks equality with string. Returns true if there is coincidence of type and value. | |
bool | operator== (void *other) const |
Checks equality with pointer to void. Returns true if there is coincidence of type and value. | |
bool | operator== (MbItem *other) const |
Checks equality with pointer to MbItem. Returns true if there is coincidence of type and value. | |
bool | operator== (Object *other) const |
Checks equality with pointer to Object. Returns true if there is coincidence of type and value. | |
bool | operator== (const VariantVector &other) const |
Checks equality with variant vector. Returns true if there is coincidence of type and value. | |
bool | operator== (const StringVector &other) const |
Checks equality with string vector. Returns true if there is coincidence of type and value. | |
bool | operator== (const IntVector &other) const |
Checks equality with integer vector. Returns true if there is coincidence of type and value. | |
bool | operator== (const FloatVector &other) const |
Checks equality with float vector. Returns true if there is coincidence of type and value. | |
bool | operator== (const RectI &other) const |
Checks equality with integer rectangle. Returns true if there is coincidence of type and value. | |
bool | operator== (const Matrix3DF &other) const |
Checks equality with Matrix3DF. Returns true if there is coincidence of type and value. | |
bool | operator!= (const Variant &other) const |
Checks inequality with another variant. | |
bool | operator!= (int other) const |
Checks inequality with integer. | |
bool | operator!= (unsigned other) const |
Checks inequality with unsigned integer. | |
bool | operator!= (unsigned long other) const |
Checks inequality with unsigned integer. | |
bool | operator!= (bool other) const |
Checks inequality with bool. | |
bool | operator!= (float other) const |
Checks inequality with float. | |
bool | operator!= (double other) const |
Checks inequality with double. | |
bool | operator!= (const MbVector3D &other) const |
Checks inequality with MbVector3D. | |
bool | operator!= (const NodeKey &other) const |
Checks inequality with NodeKey. | |
bool | operator!= (const MbHomogeneous3D &other) const |
Checks inequality with MbHomogeneous3D. | |
bool | operator!= (const String &other) const |
Checks inequality with string. | |
bool | operator!= (void *other) const |
Checks inequality with pointer to void. | |
bool | operator!= (MbItem *other) const |
Checks inequality with pointer to MbItem. | |
bool | operator!= (const VariantVector &other) const |
Checks inequality with variant vector. | |
bool | operator!= (const StringVector &other) const |
Checks inequality with string vector. | |
bool | operator!= (const IntVector &other) const |
Checks inequality with integer vector. | |
bool | operator!= (const FloatVector &other) const |
Checks inequality with float vector. | |
bool | operator!= (const RectI &other) const |
Checks inequality with Variant Map. More... | |
bool | operator!= (const Matrix3DF &other) const |
Checks inequality with Matrix3DF. | |
void | FromString (const String &type, const String &value) |
Sets type and value from a string. Pointers will be set to 0 and VariantMap type is not supported. | |
void | FromString (const char *type, const char *value) |
Sets from a string chars and string values. Pointers will be set to 0 and VariantMap type is not supported. | |
void | FromString (VariantType type, const String &value) |
Sets from type and string. Pointers will be set to 0 and VariantMap type is not supported. | |
void | FromString (VariantType type, const char *value) |
Sets from type and string. Pointers will be set to 0 and VariantMap type is not supported. | |
int | GetInt () const |
Returns integer or 0 if type mismatch. Floats and doubles are converted. | |
unsigned | GetUInt () const |
Returns unsigned integer or 0 if type mismatch. Floats and doubles are converted. | |
unsigned long | GetUInt32 () const |
Returns unsigned integer or 0 if type mismatch. Floats and doubles are converted. | |
bool | GetBool () const |
Returns bool or false if type mismatch. | |
float | GetFloat () const |
Returns float or 0 if type mismatch. | |
double | GetDouble () const |
Returns double or 0 if type mismatch. | |
const MbVector3D & | GetVector3 () const |
Returns MbVector3D or 0 if type mismatch. | |
const NodeKey & | GetNodeKey () const |
Returns NodeKey or 0 if type mismatch. | |
const MbHomogeneous3D & | GetVector4 () const |
Returns MbHomogeneous3D or 0 if type mismatch. | |
const Color & | GetColor () const |
Returns color or just white color if type mismatch. | |
const String & | GetString () const |
Returns string or empty string if type mismatch. | |
void * | GetVoidPtr () const |
Returns pointer to void or null if type mismatch. | |
MbItem * | GetMbItemPtr () const |
Returns pointer to void or null if type mismatch. | |
Object * | GetObjectPtr () const |
Returns pointer to Object or null if type mismatch. | |
const VariantVector & | GetVariantVector () const |
Returns variant vector or empty vector if type mismatch. | |
const StringVector & | GetStringVector () const |
Returns string vector or empty vector if type mismatch. | |
const IntVector & | GetIntVector () const |
Returns Float vector or empty vector if type mismatch. | |
const FloatVector & | GetFloatVector () const |
Returns Float vector or empty vector if type mismatch. | |
const RectI & | GetIntRect () const |
Returns integer rectangle or empty rectangle if type mismatch. | |
const Matrix3DF & | GetMatrix4 () const |
Returns Matrix3DF or unitary matrix if type mismatch. | |
const std::shared_ptr< void > | GetSharedPtr () const |
Returns pointer to void or empty pointer if type mismatch. | |
VariantType | GetType () const |
Returns variant type. | |
String | GetTypeName () const |
Returns variant type name. | |
String | ToString () const |
Converts a value to string. Pointers are returned as null, and VariantMap is not supported, and returned as empty. | |
bool | IsZero () const |
Returns true, when variant value is 0 in conformance with its actual type. | |
bool | IsEmpty () const |
Returns true, when variant is empty, i.e. isn't initialized yet. | |
template<class T > | |
T | Get () const |
Returns value of pattern version. | |
VariantVector * | GetVariantVectorPtr () |
Returns pointer to modified variant of vector or null if type mismatch. | |
StringVector * | GetStringVectorPtr () |
Returns pointer to modified string vector or null if type mismatch. | |
IntVector * | GetIntVectorPtr () |
Returns pointer to modified integer variant or null if type mismatch. | |
FloatVector * | GetFloatVectorPtr () |
Returns pointer to modified float variant or null if type mismatch. | |
Static Public Member Functions | |
static String | GetTypeName (VariantType type) |
Returns name for variant type. | |
static VariantType | GetTypeFromName (const String &typeName) |
Returns variant type by name type. | |
static VariantType | GetTypeFromName (const wchar_t *typeName) |
Returns variant type by name type. | |
Static Public Attributes | |
static const Variant | EMPTY |
Empty variant. | |
static const VariantVector | emptyVariantVector |
Empty variant vector. | |
static const StringVector | emptyStringVector |
Empty string vector. | |
static const IntVector | emptyIntVector |
Empty integer vector. | |
static const FloatVector | emptyFloatVector |
Empty float vector. | |
Variant class implements union of most common data types in C3D Vision and supports fixed set of types.
|
inline |
Checks inequality with Variant Map.
Checks inequality with integer rectangle.