C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::Variant Class Reference

Variant class implements union of most common data types in C3D Vision and supports fixed set of types. More...

#include <vsn_variant.h>

+ Collaboration diagram for VSN::Variant:

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.
 
Variantoperator= (const Variant &other)
 Assigns value and type from another variant.
 
Variantoperator= (int other)
 Assigns value from integer.
 
Variantoperator= (unsigned other)
 Assigns value from unsighed integer.
 
Variantoperator= (unsigned long other)
 Assigns value from unsigned long.
 
Variantoperator= (bool other)
 Assigns value from bool.
 
Variantoperator= (float other)
 Assigns value from float.
 
Variantoperator= (double other)
 Assigns value from double.
 
Variantoperator= (const MbVector3D &other)
 Assigns value from MbVector3D.
 
Variantoperator= (const NodeKey &other)
 Assigns value from NodeKey.
 
Variantoperator= (const MbHomogeneous3D &other)
 Assigns value from MbHomogeneous3D.
 
Variantoperator= (const Color &other)
 Assigns value from color.
 
Variantoperator= (const String &other)
 Assigns value from string.
 
Variantoperator= (const char *other)
 Assigns value from pointer to char.
 
Variantoperator= (void *other)
 Sets value from pointer address to void.
 
Variantoperator= (MbItem *other)
 Sets value from pointer address to MbItem.
 
Variantoperator= (Object *other)
 Sets value from pointer address to Object.
 
Variantoperator= (const VariantVector &other)
 Sets value from variant vector.
 
Variantoperator= (const StringVector &other)
 Sets value from string vector.
 
Variantoperator= (const IntVector &other)
 Sets value from variant vector.
 
Variantoperator= (const FloatVector &other)
 Sets value from variant vector.
 
Variantoperator= (const RectI &other)
 Assigns value from integer rectangle.
 
Variantoperator= (const Matrix3DF &other)
 Assigns value from Matrix3DF.
 
template<typename T >
Variantoperator= (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 MbVector3DGetVector3 () const
 Returns MbVector3D or 0 if type mismatch.
 
const NodeKeyGetNodeKey () const
 Returns NodeKey or 0 if type mismatch.
 
const MbHomogeneous3DGetVector4 () const
 Returns MbHomogeneous3D or 0 if type mismatch.
 
const ColorGetColor () const
 Returns color or just white color if type mismatch.
 
const StringGetString () const
 Returns string or empty string if type mismatch.
 
voidGetVoidPtr () const
 Returns pointer to void or null if type mismatch.
 
MbItemGetMbItemPtr () const
 Returns pointer to void or null if type mismatch.
 
ObjectGetObjectPtr () const
 Returns pointer to Object or null if type mismatch.
 
const VariantVectorGetVariantVector () const
 Returns variant vector or empty vector if type mismatch.
 
const StringVectorGetStringVector () const
 Returns string vector or empty vector if type mismatch.
 
const IntVectorGetIntVector () const
 Returns Float vector or empty vector if type mismatch.
 
const FloatVectorGetFloatVector () const
 Returns Float vector or empty vector if type mismatch.
 
const RectIGetIntRect () const
 Returns integer rectangle or empty rectangle if type mismatch.
 
const Matrix3DFGetMatrix4 () const
 Returns Matrix3DF or unitary matrix if type mismatch.
 
const std::shared_ptr< voidGetSharedPtr () 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 >
Get () const
 Returns value of pattern version.
 
VariantVectorGetVariantVectorPtr ()
 Returns pointer to modified variant of vector or null if type mismatch.
 
StringVectorGetStringVectorPtr ()
 Returns pointer to modified string vector or null if type mismatch.
 
IntVectorGetIntVectorPtr ()
 Returns pointer to modified integer variant or null if type mismatch.
 
FloatVectorGetFloatVectorPtr ()
 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.
 

Detailed Description

Variant class implements union of most common data types in C3D Vision and supports fixed set of types.

Member Function Documentation

◆ operator!=()

bool VSN::Variant::operator!= ( const RectI other) const
inline

Checks inequality with Variant Map.

Checks inequality with integer rectangle.


The documentation for this class was generated from the following file: