ADTF
|
Variant class which can handle all base data types. More...
Public Member Functions | |
cVariant () | |
Constructor that initializes an empty cVariant object. | |
cVariant (const cVariant &oVariant) | |
Constructor that initializes the variant with an existing cVariant object. More... | |
cVariant (tBool Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tInt8 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tUInt8 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tInt16 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tUInt16 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tInt32 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tUInt32 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tInt64 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tUInt64 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tFloat32 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (tFloat64 Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (const cString &Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
cVariant (const tChar *Value) | |
Constructor that initializes the variant with a certain type and value. More... | |
virtual | ~cVariant () |
Destructor. | |
tVoid | Clear () |
Frees all internal buffers used by the cVariant object and mark the instance as empty. More... | |
tVariantType | GetType () const |
This function returns the variant type. More... | |
tSize | GetArraySize () const |
This function returns the size of an array type variant. More... | |
tVoid | Set (const cVariant &oVariant) |
Assigns a new value to a cVariant object. More... | |
tVoid | Set (tBool Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tInt8 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tUInt8 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tInt16 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tUInt16 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tInt32 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tUInt32 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tInt64 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tUInt64 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tFloat32 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tFloat64 Value) |
Sets the variant value and the type. More... | |
tVoid | Set (const cString &Value) |
Sets the variant value and the type. More... | |
tVoid | Set (const tChar *Value) |
Sets the variant value and the type. More... | |
tVoid | Set (tInt8 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tUInt8 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tInt16 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tUInt16 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tInt32 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tUInt32 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tInt64 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tUInt64 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tFloat32 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tVoid | Set (tFloat64 *pArray, tSize nSize) |
Assigns an array as variant value and sets the variant type. More... | |
tBool | GetBool (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt8 | GetInt8 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tUInt8 | GetUInt8 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt16 | GetInt16 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tUInt16 | GetUInt16 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt32 | GetInt32 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tUInt32 | GetUInt32 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt64 | GetInt64 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tUInt64 | GetUInt64 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt | GetInt (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tUInt | GetUInt (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tFloat32 | GetFloat32 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tFloat64 | GetFloat64 (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tFloat64 | GetFloat (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
const tChar * | GetStringPtr (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
cString | GetString (tBool *pIsOk=nullptr) const |
Get variant value as TYPE. More... | |
tInt32 | AsInt (tBool *pIsOk=nullptr) const |
Converts the variant value to tInt if neccessary. More... | |
tFloat64 | AsFloat (tBool *pIsOk=nullptr) const |
Converts the variant value to tFloat64 if neccessary. More... | |
cString | AsString (tBool *pIsOk=nullptr) const |
Converts the variant value to cString if neccessary. More... | |
const tBool * | GetBoolArray () const |
Get pointer to the array buffer. More... | |
const tInt8 * | GetInt8Array () const |
Get pointer to the array buffer. More... | |
const tUInt8 * | GetUInt8Array () const |
Get pointer to the array buffer. More... | |
const tInt16 * | GetInt16Array () const |
Get pointer to the array buffer. More... | |
const tUInt16 * | GetUInt16Array () const |
Get pointer to the array buffer. More... | |
const tInt32 * | GetInt32Array () const |
Get pointer to the array buffer. More... | |
const tUInt32 * | GetUInt32Array () const |
Get pointer to the array buffer. More... | |
const tInt64 * | GetInt64Array () const |
Get pointer to the array buffer. More... | |
const tUInt64 * | GetUInt64Array () const |
Get pointer to the array buffer. More... | |
const tInt * | GetIntArray () const |
Get pointer to the array buffer. More... | |
const tUInt * | GetUIntArray () const |
Get pointer to the array buffer. More... | |
const tFloat32 * | GetFloat32Array () const |
Get pointer to the array buffer. More... | |
const tFloat64 * | GetFloat64Array () const |
Get pointer to the array buffer. More... | |
tVoid * | GetArray () const |
Get pointer to the array buffer. More... | |
tBool | IsArray () const |
This function checks, if the variant is an array. More... | |
tBool | IsInt () const |
This function checks, if the variant is an integer, that is (U)Int(8/16/32/64) More... | |
tBool | IsFloat () const |
This function checks, if the variant is a float, that is tFloat(32,64). More... | |
tBool | IsBool () const |
This function checks, if the variant is a bool. More... | |
tBool | IsString () const |
This function checks, if the variant is a string. More... | |
tBool | IsIntArray () const |
This function checks, if the variant is an integer [ (U)Int(8/16/32/64) ] array. More... | |
tBool | IsFloatArray () const |
This function checks, if the variant is a float [ tFloat(32/36) ] array. More... | |
tBool | IsStringArray () const |
This function checks, if the variant is a string array. More... | |
tBool | IsEmpty () const |
This function checks, if the variant object is empty. More... | |
operator tBool () const | |
Get variant value as TYPE. More... | |
operator tInt8 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tUInt8 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tInt16 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tUInt16 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tInt32 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tUInt32 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tInt64 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tUInt64 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tFloat32 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator tFloat64 () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator const cString () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
operator const tChar * () const | |
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent). More... | |
cVariant & | operator= (const cVariant &Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tBool Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tInt8 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tUInt8 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tInt16 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tUInt16 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tInt32 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tUInt32 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tInt64 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tUInt64 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tFloat32 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tFloat64 Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const cString &Value) |
Sets the variant value and the type. More... | |
cVariant & | operator= (const tChar *Value) |
Sets the variant value and the type. More... | |
Static Public Member Functions | |
static tResult | Serialize (cVariant &oVariant, tVoid *pWriteBuffer, tSize szSize, tSize *pszWriteSize=nullptr) |
Serialization method. More... | |
static tResult | Deserialize (cVariant &oVariant, tVoid *pReadBuffer, tSize szSize, tSize *pszReadSize=nullptr) |
Deserialization method. More... | |
Static Public Attributes | |
static const cVariant | vEmpty |
Empty variant. | |
Protected Member Functions | |
tVoid | Initialize () |
Initializes the object. More... | |
tVoid | Free () |
Frees internally used memory structures. More... | |
Protected Attributes | |
tVariantType | m_Type |
The actual type of this instance. | |
union { | |
tBool bool_val | |
The actual instance is a tBool. | |
tInt8 int8_val | |
The actual instance is a tInt8. | |
tUInt8 uint8_val | |
The actual instance is a tUInt8. | |
tInt16 int16_val | |
The actual instance is a tInt16. | |
tUInt16 uint16_val | |
The actual instance is a tUIn16. | |
tInt32 int32_val | |
The actual instance is a tInt32. | |
tUInt32 uint32_val | |
The actual instance is a tUIn32. | |
tInt64 int64_val | |
The actual instance is a tInt64. | |
tUInt64 uint64_val | |
The actual instance is a tUInt64. | |
tFloat32 float32_val | |
The actual instance is a tFloat32. | |
tFloat64 float64_val | |
The actual instance is a tFloat64. | |
tBool * bool_array | |
The actual instance is a tBool array. | |
tInt8 * int8_array | |
The actual instance is a tInt8 array. | |
tUInt8 * uint8_array | |
The actual instance is a tUInt8 array. | |
tInt16 * int16_array | |
The actual instance is a tInt16 array. | |
tUInt16 * uint16_array | |
The actual instance is a tUIn16 array. | |
tInt32 * int32_array | |
The actual instance is a tInt32 array. | |
tUInt32 * uint32_array | |
The actual instance is a tUIn32 array. | |
tInt64 * int64_array | |
The actual instance is a tInt64 array. | |
tUInt64 * uint64_array | |
The actual instance is a tUInt64 array. | |
tFloat32 * float32_array | |
The actual instance is a tFloat32 array. | |
tFloat64 * float64_array | |
The actual instance is a tFloat64 array. | |
} | m_Data |
The actual data. More... | |
cString | m_strBuffer |
Internal buffer. | |
tSize | m_nArraySize |
Size of array. | |
Static Protected Attributes | |
static const tUInt8 | m_ui8Version |
Not yet used. | |
Variant class which can handle all base data types.
The variant is classified using the type set to m_Type which is initialized with one of the tVariantType values.
Definition at line 43 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/variant.h.
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Constructor that initializes the variant with a certain type and value.
Value | [in] Value to initialize the variant with. |
Converts the variant value to tFloat64 if neccessary.
pIsOk | [out] Bool value to check if the conversion was successful. |
Converts the variant value to tInt if neccessary.
pIsOk | [out] Bool value to check if the conversion was successful. |
Converts the variant value to cString if neccessary.
pIsOk | [out] Bool value to check if the conversion was successful. |
tVoid Clear | ( | ) |
Frees all internal buffers used by the cVariant object and mark the instance as empty.
|
static |
Deserialization method.
oVariant | [out] Variant to deserialize. |
pReadBuffer | [in] Buffer to read from. |
szSize | [in] Size of buffer. |
pszReadSize | [out] Read bytes. |
|
protected |
Frees internally used memory structures.
tVoid* GetArray | ( | ) | const |
Get pointer to the array buffer.
tSize GetArraySize | ( | ) | const |
This function returns the size of an array type variant.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tBool* GetBoolArray | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tFloat32* GetFloat32Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tFloat64* GetFloat64Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tInt16* GetInt16Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tInt32* GetInt32Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tInt64* GetInt64Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tInt8* GetInt8Array | ( | ) | const |
Get pointer to the array buffer.
const tInt* GetIntArray | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
tVariantType GetType | ( | ) | const |
This function returns the variant type.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tUInt16* GetUInt16Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tUInt32* GetUInt32Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tUInt64* GetUInt64Array | ( | ) | const |
Get pointer to the array buffer.
Get variant value as TYPE.
pIsOk | [out] Bool value to check if the conversion was successful. |
const tUInt8* GetUInt8Array | ( | ) | const |
Get pointer to the array buffer.
const tUInt* GetUIntArray | ( | ) | const |
Get pointer to the array buffer.
|
protected |
Initializes the object.
tBool IsArray | ( | ) | const |
This function checks, if the variant is an array.
tBool IsBool | ( | ) | const |
This function checks, if the variant is a bool.
tBool IsEmpty | ( | ) | const |
This function checks, if the variant object is empty.
tBool IsFloat | ( | ) | const |
This function checks, if the variant is a float, that is tFloat(32,64).
tBool IsFloatArray | ( | ) | const |
This function checks, if the variant is a float [ tFloat(32/36) ] array.
tBool IsInt | ( | ) | const |
This function checks, if the variant is an integer, that is (U)Int(8/16/32/64)
tBool IsIntArray | ( | ) | const |
This function checks, if the variant is an integer [ (U)Int(8/16/32/64) ] array.
tBool IsString | ( | ) | const |
This function checks, if the variant is a string.
tBool IsStringArray | ( | ) | const |
This function checks, if the variant is a string array.
operator const cString | ( | ) | const |
operator const tChar * | ( | ) | const |
operator tFloat32 | ( | ) | const |
operator tFloat64 | ( | ) | const |
operator tInt16 | ( | ) | const |
operator tInt32 | ( | ) | const |
operator tInt64 | ( | ) | const |
operator tInt8 | ( | ) | const |
operator tUInt16 | ( | ) | const |
operator tUInt32 | ( | ) | const |
operator tUInt64 | ( | ) | const |
operator tUInt8 | ( | ) | const |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
|
static |
Serialization method.
oVariant | [in] Variant to serialize. |
pWriteBuffer | [out] Buffer to write to. |
szSize | [in] Size of buffer. |
pszWriteSize | [out] Written bytes. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns a new value to a cVariant object.
oVariant | [in] Variant value to be assigned. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
Assigns an array as variant value and sets the variant type.
pArray | [in] Array to be assigned to the variant. |
nSize | [in] Element count of the array. |
Sets the variant value and the type.
Value | [in] Value to be assigned to the variant. |
union { ... } m_Data |
The actual data.
The actual data