CLiwMap Class Reference

class CLiwMap : public CLiwContainer

Abstract interface for an associative array. The collection key entries are of type string (Descriptor type) and their associated values can be an variant type (TLiwVariant).

CLiwMap offers abstract methods to:
  • insert a key-value pair

  • find a stored value based on a key

  • get a key based on an index

  • remove a key-value pair based on a key

  • get the total number of stored key-value pairs

A default concrete implementation is provided in the form of specialized class CLiwDefaultMap

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Since container objects are reference counted, they cannot go with CleanupStack::PushL. The issue is solved by using CleanupClosePushL for pushing the container objects into the CleanupStack. Hence CLiwContainer::Close method is introduced common to all container objects.

This implies that the object of this concrete implementation class being created should be pushed into the CleanupStack using CLiwContainer::PushL.

ServiceHandler.lib

CLiwContainer CLiwContainer::Close CLiwContainer::PushLTLiwVariant CLiwDefaultMap

Inherits from

Member Functions Documentation

AtL(TInt, TDes8 &)

TBool AtL(TIntaIndex,
TDes8 &aFndKey
)const [pure virtual]

Returns the key stored at the passed index. A default implementation is provided in CLiwDefaultMap.

CLiwDefaultMap::AtL

Parameters

TInt aIndexthe index of the key to be found
TDes8 & aFndKeythe key found at the passed index

Count()

TInt Count()const [pure virtual]

Returns the number of key-value pair stored in the map collection. A default implementation is provided in CLiwDefaultMap.

CLiwDefaultMap::Count

FindL(const TDesC8 &, TLiwVariant &)

TBool FindL(const TDesC8 &aKey,
TLiwVariant &aFndValue
)const [pure virtual]

Finds a value stored in the map collection based on the key. A default implementation is provided in CLiwDefaultMap.

!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This is a copy of the value present in the map for the particular key. To ensure proper cleanup TLiwVariant::PushL method should be called beforehand.

CLiwDefaultMap::FindL TLiwVariant::PushL

Parameters

const TDesC8 & aKeythe key to be searched
TLiwVariant & aFndValuethe value associated with the found key

InsertL(const TDesC8 &, const TLiwVariant &)

voidInsertL(const TDesC8 &aKey,
const TLiwVariant &aValue
)[pure virtual]

Inserts a key-value pair element to the map collection. A default implementation is provided in CLiwDefaultMap.

CLiwDefaultMap::InsertL

Parameters

const TDesC8 & aKeythe key to be stored
const TLiwVariant & aValuethe value associated with the key to be stored

Remove(const TDesC8 &)

voidRemove(const TDesC8 &aKey)[pure virtual]

Returns the key stored at the passed index. A default implementation is provided in CLiwDefaultMap.

CLiwDefaultMap::AtL Removes a key from the map collection. A default implementation is provided in CLiwDefaultMap.CLiwDefaultMap::Remove

Parameters

const TDesC8 & aKeythe key to be removed from the map

operator==(const CLiwMap &)

IMPORT_C TBooloperator==(const CLiwMap &aMap)const [virtual]

Default implementation of equality operator.

CLiwDefaultMap::operator==

Parameters

const CLiwMap & aMapthe map to be compared