7 #ifndef _VARIANT_CLASS_HEADER_
8 #define _VARIANT_CLASS_HEADER_
uint8_t tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
int16_t tInt16
type definition for signed integer values (16bit) (platform and compiler independent type).
int32_t tInt32
type definition for signed integer values (32bit) (platform and compiler independent type).
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent type).
float tFloat32
type definition for Float32 (32bit float values) (platform and compiler independent type).
void tVoid
The tVoid is always the definition for the void (non-type).
uint16_t tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
double tFloat64
type definition for Float64 (64bit double values) (platform and compiler independent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
size_t tSize
type definition for a array size values, map size values etc.
int8_t tInt8
type definition for signed integer values (8bit) (platform and compiler independent type).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
A common result class usable as return value throughout.
Variant class which can handle all base data types.
cVariant & operator=(const tBool Value)
Sets the variant value and the type.
tUInt32 * uint32_array
The actual instance is a tUIn32 array.
static tResult Deserialize(cVariant &oVariant, tVoid *pReadBuffer, tSize szSize, tSize *pszReadSize=nullptr)
Deserialization method.
const tUInt64 * GetUInt64Array() const
Get pointer to the array buffer.
tVoid Set(tUInt64 Value)
Sets the variant value and the type.
tVoid Set(tInt8 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
cVariant & operator=(const tInt64 Value)
Sets the variant value and the type.
tUInt64 GetUInt64(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
const tFloat64 * GetFloat64Array() const
Get pointer to the array buffer.
tVoid Set(const tChar *Value)
Sets the variant value and the type.
virtual ~cVariant()
Destructor.
tVoid Set(tUInt16 Value)
Sets the variant value and the type.
tVoid Set(tInt8 Value)
Sets the variant value and the type.
tVoid Set(const cString &Value)
Sets the variant value and the type.
cVariant(tFloat64 Value)
Constructor that initializes the variant with a certain type and value.
const tUInt16 * GetUInt16Array() const
Get pointer to the array buffer.
tVoid Set(tFloat32 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
cVariant & operator=(const tUInt32 Value)
Sets the variant value and the type.
tVariantType m_Type
The actual type of this instance.
tVoid Set(tBool Value)
Sets the variant value and the type.
cVariant & operator=(const tFloat64 Value)
Sets the variant value and the type.
cVariant(tUInt8 Value)
Constructor that initializes the variant with a certain type and value.
tInt32 * int32_array
The actual instance is a tInt32 array.
cVariant(tInt8 Value)
Constructor that initializes the variant with a certain type and value.
tInt8 int8_val
The actual instance is a tInt8.
const tInt8 * GetInt8Array() const
Get pointer to the array buffer.
const tInt16 * GetInt16Array() const
Get pointer to the array buffer.
tInt64 GetInt64(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tFloat64 GetFloat(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
const tInt * GetIntArray() const
Get pointer to the array buffer.
tUInt8 uint8_val
The actual instance is a tUInt8.
tVoid Set(tInt64 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
tBool GetBool(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tUInt32 uint32_val
The actual instance is a tUIn32.
tBool IsString() const
This function checks, if the variant is a string.
cVariant()
Constructor that initializes an empty cVariant object.
cVariant & operator=(const tInt16 Value)
Sets the variant value and the type.
tFloat64 GetFloat64(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tBool IsFloatArray() const
This function checks, if the variant is a float [ tFloat(32/36) ] array.
tUInt16 uint16_val
The actual instance is a tUIn16.
tFloat64 float64_val
The actual instance is a tFloat64.
tBool IsIntArray() const
This function checks, if the variant is an integer [ (U)Int(8/16/32/64) ] array.
tVoid Set(tInt16 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
tVoid Set(tUInt32 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
const tUInt * GetUIntArray() const
Get pointer to the array buffer.
tUInt GetUInt(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tInt8 * int8_array
The actual instance is a tInt8 array.
tVoid Initialize()
Initializes the object.
tVoid Set(tUInt32 Value)
Sets the variant value and the type.
tVoid Set(tInt32 Value)
Sets the variant value and the type.
tInt8 GetInt8(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
const tInt32 * GetInt32Array() const
Get pointer to the array buffer.
cVariant & operator=(const tUInt64 Value)
Sets the variant value and the type.
tInt GetInt(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
const tBool * GetBoolArray() const
Get pointer to the array buffer.
cVariant(tUInt32 Value)
Constructor that initializes the variant with a certain type and value.
tVoid * GetArray() const
Get pointer to the array buffer.
const tUInt8 * GetUInt8Array() const
Get pointer to the array buffer.
cVariant(const tChar *Value)
Constructor that initializes the variant with a certain type and value.
tVoid Set(tUInt8 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
tInt16 GetInt16(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tInt32 int32_val
The actual instance is a tInt32.
tBool IsInt() const
This function checks, if the variant is an integer, that is (U)Int(8/16/32/64)
tBool IsStringArray() const
This function checks, if the variant is a string array.
tVoid Set(tInt16 Value)
Sets the variant value and the type.
tSize GetArraySize() const
This function returns the size of an array type variant.
tFloat32 GetFloat32(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tInt64 int64_val
The actual instance is a tInt64.
cVariant(tUInt16 Value)
Constructor that initializes the variant with a certain type and value.
cString GetString(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tUInt64 * uint64_array
The actual instance is a tUInt64 array.
cVariant & operator=(const cString &Value)
Sets the variant value and the type.
tUInt16 GetUInt16(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
cString AsString(tBool *pIsOk=nullptr) const
Converts the variant value to cString if neccessary.
static tResult Serialize(cVariant &oVariant, tVoid *pWriteBuffer, tSize szSize, tSize *pszWriteSize=nullptr)
Serialization method.
tBool IsArray() const
This function checks, if the variant is an array.
tInt32 AsInt(tBool *pIsOk=nullptr) const
Converts the variant value to tInt if neccessary.
cVariant(tInt32 Value)
Constructor that initializes the variant with a certain type and value.
tVoid Free()
Frees internally used memory structures.
tVoid Clear()
Frees all internal buffers used by the cVariant object and mark the instance as empty.
cVariant & operator=(const cVariant &Value)
Sets the variant value and the type.
tUInt8 GetUInt8(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tVoid Set(tUInt64 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
tVariantType GetType() const
This function returns the variant type.
tVoid Set(tInt32 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
tVoid Set(const cVariant &oVariant)
Assigns a new value to a cVariant object.
tUInt16 * uint16_array
The actual instance is a tUIn16 array.
tBool IsFloat() const
This function checks, if the variant is a float, that is tFloat(32,64).
static const cVariant vEmpty
Empty variant.
const tUInt32 * GetUInt32Array() const
Get pointer to the array buffer.
tVoid Set(tUInt8 Value)
Sets the variant value and the type.
static const tUInt8 m_ui8Version
Not yet used.
cVariant(tBool Value)
Constructor that initializes the variant with a certain type and value.
cString m_strBuffer
Internal buffer.
cVariant & operator=(const tFloat32 Value)
Sets the variant value and the type.
tBool IsEmpty() const
This function checks, if the variant object is empty.
tFloat32 * float32_array
The actual instance is a tFloat32 array.
const tFloat32 * GetFloat32Array() const
Get pointer to the array buffer.
cVariant & operator=(const tUInt8 Value)
Sets the variant value and the type.
cVariant(const cString &Value)
Constructor that initializes the variant with a certain type and value.
cVariant & operator=(const tInt8 Value)
Sets the variant value and the type.
tBool * bool_array
The actual instance is a tBool array.
tFloat64 AsFloat(tBool *pIsOk=nullptr) const
Converts the variant value to tFloat64 if neccessary.
cVariant(const cVariant &oVariant)
Constructor that initializes the variant with an existing cVariant object.
tUInt8 * uint8_array
The actual instance is a tUInt8 array.
tVoid Set(tFloat64 Value)
Sets the variant value and the type.
tUInt64 uint64_val
The actual instance is a tUInt64.
cVariant(tUInt64 Value)
Constructor that initializes the variant with a certain type and value.
tBool bool_val
The actual instance is a tBool.
tInt16 * int16_array
The actual instance is a tInt16 array.
tBool IsBool() const
This function checks, if the variant is a bool.
tVoid Set(tInt64 Value)
Sets the variant value and the type.
const tInt64 * GetInt64Array() const
Get pointer to the array buffer.
tInt16 int16_val
The actual instance is a tInt16.
tSize m_nArraySize
Size of array.
tInt64 * int64_array
The actual instance is a tInt64 array.
tInt32 GetInt32(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
tVoid Set(tFloat64 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
cVariant & operator=(const tUInt16 Value)
Sets the variant value and the type.
cVariant & operator=(const tInt32 Value)
Sets the variant value and the type.
tUInt32 GetUInt32(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
cVariant(tInt64 Value)
Constructor that initializes the variant with a certain type and value.
cVariant(tInt16 Value)
Constructor that initializes the variant with a certain type and value.
tVoid Set(tUInt16 *pArray, tSize nSize)
Assigns an array as variant value and sets the variant type.
cVariant & operator=(const tChar *Value)
Sets the variant value and the type.
tFloat32 float32_val
The actual instance is a tFloat32.
tVoid Set(tFloat32 Value)
Sets the variant value and the type.
const tChar * GetStringPtr(tBool *pIsOk=nullptr) const
Get variant value as TYPE.
cVariant(tFloat32 Value)
Constructor that initializes the variant with a certain type and value.
tFloat64 * float64_array
The actual instance is a tFloat64 array.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
tBool operator==(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
tVariantType
Enumeration of variant types.
tBool operator!=(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.