ADTF  v2.14.3
cVariantMap Class Reference

Variant map class. More...

Public Member Functions

 cVariantMap ()
 Constructor that initializes an empty cVariantMap object.
 
 cVariantMap (const cVariantMap &Map)
 Constructor that duplicates an existing variant map. More...
 
virtual ~cVariantMap ()
 Destructor.
 
tVoid Clear ()
 This function cleans up the map and frees all allocated memory blocks. More...
 
tResult Set (const cString &sKey, const cVariant &vVariant)
 This function stores a string value to the map. More...
 
tResult Delete (const cString &sKey)
 This function removes one item from the map. More...
 
tResult Copy (const cVariantMap &Map)
 This function assigns an existing variant map the cVariantMap object. More...
 
tSize GetItemCount () const
 This function returns the number of items the map contains. More...
 
cVariant Get (const cString &sKey, const cVariant &vDefault=cVariant::vEmpty) const
 This function retrieves a string value from the list. More...
 
tResult Get (tSize nIdx, cString &sKey, cVariant &vValue) const
 This function retrieves both the key and the string value from the list. More...
 
tBool IsEmpty () const
 Check if map is empty. More...
 
cVariantMapoperator= (const cVariantMap &Map)
 The cVariantMap assignment (=) operator reinitializes existing variant maps with an existing object. More...
 
cVariantoperator[] (const cString &sKey)
 This function retrieves a variant value from the list. More...
 
cVariantoperator[] (tSize nIdx)
 This function retrieves a variant value from the list. More...
 

Protected Member Functions

tVoid Initialize ()
 Initializes the cVariantMap object. More...
 
cVariantGetRef (const cString &sKey)
 This function retrieves a variant value reference from the list. More...
 
cVariantGetRef (tSize nIdx)
 This function retrieves a variant value reference from the list. More...
 

Protected Attributes

tVariantMap m_Map
 The variant map.
 

Detailed Description

Variant map class.

Definition at line 34 of file variantmap.h.

Constructor & Destructor Documentation

cVariantMap ( const cVariantMap Map)

Constructor that duplicates an existing variant map.

Parameters
Map[in] Map object to be copied.

Member Function Documentation

tVoid Clear ( )

This function cleans up the map and frees all allocated memory blocks.

Returns
tVoid
tResult Copy ( const cVariantMap Map)

This function assigns an existing variant map the cVariantMap object.

  • Parameters
    Map[in] Map object to be copied.
    Return values
    ERR_NOERROR,ifeverything was ok
tResult Delete ( const cString sKey)

This function removes one item from the map.

Parameters
sKey[in] Key of map entry to be deleted.
Returns
Returns true, if the item specified by sKey was found and removed, otherwise false.
cVariant Get ( const cString sKey,
const cVariant vDefault = cVariant::vEmpty 
) const

This function retrieves a string value from the list.

Parameters
sKey[in] Key value of string to be fetched.
vDefault[in] Default value that is returned if the element was not found (default is an empty string).
Returns
The function creates a cString object that is initialized with the contents of the referenced map item.
tResult Get ( tSize  nIdx,
cString sKey,
cVariant vValue 
) const

This function retrieves both the key and the string value from the list.

Parameters
nIdx[in] Zero-based index of map item.
sKey[out] Buffer for key value to be fetched.
vValue[out] Buffer for variant value to be fetched.
Returns
Returns true, if the item was found, otherwise false.
tSize GetItemCount ( ) const

This function returns the number of items the map contains.

cVariant& GetRef ( const cString sKey)
protected

This function retrieves a variant value reference from the list.

Parameters
sKey[in] Key value of string to be fetched.
Returns
The function returns a reference to the map item.
This method is real-time safe.
See The ADTF Real-Time Extension.
cVariant& GetRef ( tSize  nIdx)
protected

This function retrieves a variant value reference from the list.

Parameters
nIdx[in] Index of value to be fetched.
Returns
The function returns a reference to the map item.
This method is real-time safe.
See The ADTF Real-Time Extension.
tVoid Initialize ( )
protected

Initializes the cVariantMap object.

Returns
tVoid
tBool IsEmpty ( ) const

Check if map is empty.

Returns
Returns true, if the map is empty.
This method is real-time safe.
See The ADTF Real-Time Extension.
cVariantMap& operator= ( const cVariantMap Map)

The cVariantMap assignment (=) operator reinitializes existing variant maps with an existing object.

Parameters
Map[in] Map object to be copied.
Returns
Reference to cVariantMap object.
cVariant& operator[] ( const cString sKey)

This function retrieves a variant value from the list.

Parameters
sKey[in] Key value of string to be fetched.
Returns
The function creates a cVariant object that is initialized with the contents of the referenced map item.
This method is real-time safe.
See The ADTF Real-Time Extension.
cVariant& operator[] ( tSize  nIdx)

This function retrieves a variant value from the list.

Parameters
nIdx[in] Index of value to be fetched.
Returns
The function creates a cVariant object that is initialized with the contents of the referenced map item.
This method is real-time safe.
See The ADTF Real-Time Extension.
tResult Set ( const cString sKey,
const cVariant vVariant 
)

This function stores a string value to the map.

Parameters
sKey[in] Key value of the element to be written to.
vVariant[in] Value that is to be written to the map.
Returns
The function returns true, if the operation succeeded, and false otherwise.

Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Fri Mar 22 2019 by doxygen 1.8.10)