AnimatLab
2
Test
|
Standard variant type. More...
#include <StdVariant.h>
Public Member Functions | |
CStdVariant () | |
Default constructor. More... | |
virtual | ~CStdVariant () |
Destructor. More... | |
virtual CStdSerialize * | Clone () |
Makes a deep copy of this object. More... | |
void | Copy (CStdVariant &oVar) |
Copies the given variant. More... | |
bool | GetBool (bool bConvert=true) |
Gets a bool. More... | |
bool * | GetBoolPtr () |
Gets the bool pointer. More... | |
char | GetChar (bool bConvert=true) |
Gets a character. More... | |
char * | GetCharPtr () |
Gets the character pointer. More... | |
double | GetDouble (bool bConvert=true) |
Gets a double. More... | |
double * | GetDoublePtr () |
Gets the double pointer. More... | |
float | GetFloat (bool bConvert=true) |
Gets a float. More... | |
float * | GetFloatPtr () |
Gets the float pointer. More... | |
int | GetInt (bool bConvert=true) |
Gets an int. More... | |
int * | GetIntPtr () |
Gets the int pointer. More... | |
long | GetLong (bool bConvert=true) |
Gets a long value. More... | |
long * | GetLongPtr () |
Gets the long pointer. More... | |
std::string | GetNumericString () |
Gets a string version of the value. More... | |
short | GetShort (bool bConvert=true) |
Gets a short value. More... | |
short * | GetShortPtr () |
Gets the short pointer. More... | |
std::string | GetString (bool bConvert=true) |
Gets a string version of the value. More... | |
std::string * | GetStringPtr () |
Gets the string pointer. More... | |
unsigned char | GetUChar (bool bConvert=true) |
Gets an unsigned character. More... | |
unsigned char * | GetUCharPtr () |
Gets the unsigned character pointer. More... | |
unsigned int | GetUInt (bool bConvert=true) |
Gets an unsigned int. More... | |
unsigned int * | GetUIntPtr () |
Gets the unsigned int pointer. More... | |
unsigned long | GetULong (bool bConvert=true) |
Gets an unsigned long. More... | |
unsigned long * | GetULongPtr () |
Gets the unsigned long pointer. More... | |
unsigned short | GetUShort (bool bConvert=true) |
Gets an unsigned short. More... | |
unsigned short * | GetUShortPtr () |
Gets the unsigned short pointer. More... | |
virtual void | Load (CStdXml &oXml) |
Loads the variant. More... | |
void | operator= (CStdVariant &oVar) |
= casting operator. More... | |
void | Reset () |
Resets the variant data. More... | |
virtual void | Save (CStdXml &oXml) |
Saves the variant. More... | |
void | SetPtr (short *lpVal) |
Sets a value pointer. More... | |
void | SetPtr (long *lpVal) |
Sets a pointer. More... | |
void | SetPtr (float *lpVal) |
Sets a pointer. More... | |
void | SetPtr (double *lpVal) |
Sets a pointer. More... | |
void | SetPtr (bool *lpVal) |
Sets a pointer. More... | |
void | SetPtr (char *lpVal) |
Sets a pointer. More... | |
void | SetPtr (unsigned char *lpVal) |
Sets a pointer. More... | |
void | SetPtr (unsigned short *lpVal) |
Sets a pointer. More... | |
void | SetPtr (unsigned long *lpVal) |
Sets a pointer. More... | |
void | SetPtr (int *lpVal) |
Sets a pointer. More... | |
void | SetPtr (unsigned int *lpVal) |
Sets a pointer. More... | |
void | SetPtr (std::string *lpVal) |
Sets a pointer. More... | |
void | SetValue (short Val) |
Sets the value. More... | |
void | SetValue (long Val) |
Sets a value. More... | |
void | SetValue (float Val) |
Sets a value. More... | |
void | SetValue (double Val) |
Sets a value. More... | |
void | SetValue (bool Val) |
Sets a value. More... | |
void | SetValue (char Val) |
Sets a value. More... | |
void | SetValue (unsigned char Val) |
Sets a value. More... | |
void | SetValue (unsigned short Val) |
Sets a value. More... | |
void | SetValue (unsigned long Val) |
Sets a value. More... | |
void | SetValue (int Val) |
Sets a value. More... | |
void | SetValue (unsigned int Val) |
Sets a value. More... | |
void | SetValue (std::string Val) |
Sets a value. More... | |
virtual void | Trace (std::ostream &oOs) |
Traces this object to an output stream. More... | |
int | VariantType () |
Gets the variant type. More... | |
std::string | VariantTypeName () |
Gets the variant type name. More... | |
Public Member Functions inherited from StdUtils::CStdSerialize | |
CStdSerialize () | |
Default constructor. More... | |
virtual | ~CStdSerialize () |
Destructor. More... | |
virtual void | Copy (CStdSerialize *lpSource) |
Makes a deep copy of this object. More... | |
Protected Attributes | |
bool | m_bCreatedVar |
true if created variable | |
int | m_iVariantType |
Variant type. | |
bool * | m_lpBool |
StdVtBool Boolean. | |
char * | m_lpChar |
StdVtChar Char. | |
double * | m_lpDouble |
StdVtDouble 8-byte real. | |
float * | m_lpFloat |
StdVtFloat 4-byte real. | |
int * | m_lpInt |
StdVtInt 2 byte signed int. | |
long * | m_lpLong |
StdVtLong 4-byte signed int. | |
short * | m_lpShort |
StdVtShort 2-byte signed int. | |
std::string * | m_lpString |
StdVtString string. | |
unsigned char * | m_lpUChar |
StdVtUChar Unsigned char. | |
unsigned int * | m_lpUInt |
StdVtUInt 2 byte unsigned int. | |
unsigned long * | m_lpULong |
StdVtULong 4 byte unsigned int. | |
unsigned short * | m_lpUShort |
StdVtUShort 2 byte unsigned int. | |
StdUtils::CStdVariant::CStdVariant | ( | ) |
Default constructor.
Definition at line 18 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
Referenced by Clone().
|
virtual |
Destructor.
Definition at line 43 of file StdVariant.cpp.
References Reset(), and StdUtils::Std_TraceMsg().
|
virtual |
Makes a deep copy of this object.
Reimplemented from StdUtils::CStdSerialize.
Definition at line 1541 of file StdVariant.cpp.
References CStdVariant().
void StdUtils::CStdVariant::Copy | ( | CStdVariant & | oVar | ) |
Copies the given variant.
[in,out] | oVar | The variable. |
Definition at line 1406 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, m_lpUShort, and SetValue().
bool StdUtils::CStdVariant::GetBool | ( | bool | bConvert = true | ) |
Gets a bool.
bConvert | true to convert. |
Definition at line 538 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, m_lpUShort, and StdUtils::Std_CheckString().
bool * StdUtils::CStdVariant::GetBoolPtr | ( | ) |
Gets the bool pointer.
Definition at line 591 of file StdVariant.cpp.
References m_iVariantType, and m_lpBool.
char StdUtils::CStdVariant::GetChar | ( | bool | bConvert = true | ) |
Gets a character.
bConvert | true to convert. |
Definition at line 641 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
char * StdUtils::CStdVariant::GetCharPtr | ( | ) |
Gets the character pointer.
Definition at line 697 of file StdVariant.cpp.
References m_iVariantType, and m_lpChar.
double StdUtils::CStdVariant::GetDouble | ( | bool | bConvert = true | ) |
Gets a double.
bConvert | true to convert. |
Definition at line 435 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
double * StdUtils::CStdVariant::GetDoublePtr | ( | ) |
Gets the double pointer.
Definition at line 488 of file StdVariant.cpp.
References m_iVariantType, and m_lpDouble.
float StdUtils::CStdVariant::GetFloat | ( | bool | bConvert = true | ) |
Gets a float.
bConvert | true to convert. |
Definition at line 332 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
float * StdUtils::CStdVariant::GetFloatPtr | ( | ) |
Gets the float pointer.
Definition at line 385 of file StdVariant.cpp.
References m_iVariantType, and m_lpFloat.
int StdUtils::CStdVariant::GetInt | ( | bool | bConvert = true | ) |
Gets an int.
bConvert | true to convert. |
Definition at line 1055 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
int * StdUtils::CStdVariant::GetIntPtr | ( | ) |
Gets the int pointer.
Definition at line 1107 of file StdVariant.cpp.
References m_iVariantType, and m_lpInt.
long StdUtils::CStdVariant::GetLong | ( | bool | bConvert = true | ) |
Gets a long value.
bConvert | true to convert. |
Definition at line 230 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
long * StdUtils::CStdVariant::GetLongPtr | ( | ) |
Gets the long pointer.
Definition at line 282 of file StdVariant.cpp.
References m_iVariantType, and m_lpLong.
std::string StdUtils::CStdVariant::GetNumericString | ( | ) |
Gets a string version of the value.
Definition at line 1257 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
short StdUtils::CStdVariant::GetShort | ( | bool | bConvert = true | ) |
Gets a short value.
bConvert | true to convert. |
Definition at line 128 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
short * StdUtils::CStdVariant::GetShortPtr | ( | ) |
Gets the short pointer.
Definition at line 180 of file StdVariant.cpp.
References m_iVariantType, and m_lpShort.
std::string StdUtils::CStdVariant::GetString | ( | bool | bConvert = true | ) |
Gets a string version of the value.
bConvert | true to convert. |
Definition at line 1306 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
std::string * StdUtils::CStdVariant::GetStringPtr | ( | ) |
Gets the string pointer.
Definition at line 1358 of file StdVariant.cpp.
References m_iVariantType, and m_lpString.
unsigned char StdUtils::CStdVariant::GetUChar | ( | bool | bConvert = true | ) |
Gets an unsigned character.
bConvert | true to convert. |
Definition at line 747 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
unsigned char * StdUtils::CStdVariant::GetUCharPtr | ( | ) |
Gets the unsigned character pointer.
Definition at line 800 of file StdVariant.cpp.
References m_iVariantType, and m_lpUChar.
unsigned int StdUtils::CStdVariant::GetUInt | ( | bool | bConvert = true | ) |
Gets an unsigned int.
bConvert | true to convert. |
Definition at line 1157 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
unsigned int * StdUtils::CStdVariant::GetUIntPtr | ( | ) |
Gets the unsigned int pointer.
Definition at line 1209 of file StdVariant.cpp.
References m_iVariantType, and m_lpUInt.
unsigned long StdUtils::CStdVariant::GetULong | ( | bool | bConvert = true | ) |
Gets an unsigned long.
bConvert | true to convert. |
Definition at line 953 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
unsigned long * StdUtils::CStdVariant::GetULongPtr | ( | ) |
Gets the unsigned long pointer.
Definition at line 1005 of file StdVariant.cpp.
References m_iVariantType, and m_lpULong.
unsigned short StdUtils::CStdVariant::GetUShort | ( | bool | bConvert = true | ) |
Gets an unsigned short.
bConvert | true to convert. |
Definition at line 850 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
unsigned short * StdUtils::CStdVariant::GetUShortPtr | ( | ) |
Gets the unsigned short pointer.
Definition at line 903 of file StdVariant.cpp.
References m_iVariantType, and m_lpUShort.
|
virtual |
Loads the variant.
[in,out] | oXml | The CStdXml & to load. |
Reimplemented from StdUtils::CStdSerialize.
Definition at line 1636 of file StdVariant.cpp.
References StdUtils::CStdXml::GetChildBool(), StdUtils::CStdXml::GetChildDouble(), StdUtils::CStdXml::GetChildFloat(), StdUtils::CStdXml::GetChildInt(), StdUtils::CStdXml::GetChildLong(), StdUtils::CStdXml::GetChildString(), StdUtils::CStdXml::IntoElem(), m_iVariantType, StdUtils::CStdXml::OutOfElem(), SetValue(), and StdUtils::Std_VariantTypeToConst().
void StdUtils::CStdVariant::operator= | ( | CStdVariant & | oVar | ) |
= casting operator.
[in,out] | oVar | The variable. |
Definition at line 1463 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, m_lpUShort, Reset(), and SetValue().
void StdUtils::CStdVariant::Reset | ( | ) |
Resets the variant data.
Definition at line 82 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, and m_lpUShort.
Referenced by operator=(), SetPtr(), SetValue(), and ~CStdVariant().
|
virtual |
Saves the variant.
[in,out] | oXml | The CStdXml & to save. |
Reimplemented from StdUtils::CStdSerialize.
Definition at line 1737 of file StdVariant.cpp.
References StdUtils::CStdXml::AddChildElement(), StdUtils::CStdXml::IntoElem(), m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, m_lpUShort, StdUtils::CStdXml::OutOfElem(), and StdUtils::Std_ConstToVariantType().
void StdUtils::CStdVariant::SetPtr | ( | short * | lpVal | ) |
Sets a value pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 212 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpShort, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | long * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 314 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpLong, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | float * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 417 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpFloat, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | double * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 520 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpDouble, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | bool * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 623 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpBool, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | char * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 729 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpChar, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | unsigned char * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 832 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUChar, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | unsigned short * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 935 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUShort, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | unsigned long * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 1037 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpULong, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | int * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 1139 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpInt, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | unsigned int * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 1241 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUInt, and Reset().
void StdUtils::CStdVariant::SetPtr | ( | std::string * | lpVal | ) |
Sets a pointer.
[in,out] | lpVal | Pointer to a value. |
Definition at line 1390 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpString, and Reset().
void StdUtils::CStdVariant::SetValue | ( | short | Val | ) |
Sets the value.
Val | The value. |
Definition at line 195 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpShort, and Reset().
Referenced by Copy(), Load(), and operator=().
void StdUtils::CStdVariant::SetValue | ( | long | Val | ) |
Sets a value.
Val | The value. |
Definition at line 297 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpLong, and Reset().
void StdUtils::CStdVariant::SetValue | ( | float | Val | ) |
Sets a value.
Val | The value. |
Definition at line 400 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpFloat, and Reset().
void StdUtils::CStdVariant::SetValue | ( | double | Val | ) |
Sets a value.
Val | The value. |
Definition at line 503 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpDouble, and Reset().
void StdUtils::CStdVariant::SetValue | ( | bool | Val | ) |
Sets a value.
Val | true to value. |
Definition at line 606 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpBool, and Reset().
void StdUtils::CStdVariant::SetValue | ( | char | Val | ) |
Sets a value.
Val | The value. |
Definition at line 712 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpChar, and Reset().
void StdUtils::CStdVariant::SetValue | ( | unsigned char | Val | ) |
Sets a value.
Val | The value. |
Definition at line 815 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUChar, and Reset().
void StdUtils::CStdVariant::SetValue | ( | unsigned short | Val | ) |
Sets a value.
Val | The value. |
Definition at line 918 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUShort, and Reset().
void StdUtils::CStdVariant::SetValue | ( | unsigned long | Val | ) |
Sets a value.
Val | The value. |
Definition at line 1020 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpULong, and Reset().
void StdUtils::CStdVariant::SetValue | ( | int | Val | ) |
Sets a value.
Val | The value. |
Definition at line 1122 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpInt, and Reset().
void StdUtils::CStdVariant::SetValue | ( | unsigned int | Val | ) |
Sets a value.
Val | The value. |
Definition at line 1224 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpUInt, and Reset().
void StdUtils::CStdVariant::SetValue | ( | std::string | Val | ) |
Sets a value.
Val | The value. |
Definition at line 1373 of file StdVariant.cpp.
References m_bCreatedVar, m_iVariantType, m_lpString, and Reset().
|
virtual |
Traces this object to an output stream.
[in,out] | oOs | The output stream. |
Reimplemented from StdUtils::CStdSerialize.
Definition at line 1573 of file StdVariant.cpp.
References m_iVariantType, m_lpBool, m_lpChar, m_lpDouble, m_lpFloat, m_lpInt, m_lpLong, m_lpShort, m_lpString, m_lpUChar, m_lpUInt, m_lpULong, m_lpUShort, and StdUtils::Std_ConstToVariantType().
int StdUtils::CStdVariant::VariantType | ( | ) |
Gets the variant type.
Definition at line 62 of file StdVariant.cpp.
References m_iVariantType.
std::string StdUtils::CStdVariant::VariantTypeName | ( | ) |
Gets the variant type name.
Definition at line 73 of file StdVariant.cpp.
References m_iVariantType, and StdUtils::Std_ConstToVariantType().