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 ).
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::PushL TLiwVariant CLiwDefaultMap
Public Member Functions | |
---|---|
TBool | AtL ( TInt , TDes8 &) |
TInt | Count () |
TBool | FindL (const TDesC8 &, TLiwVariant &) |
void | InsertL (const TDesC8 &, const TLiwVariant &) |
void | Remove (const TDesC8 &) |
IMPORT_C TBool | operator== (const CLiwMap &) |
TBool | AtL | ( | TInt | aIndex, |
TDes8 & | aFndKey | |||
) | const [pure virtual] |
Returns the key stored at the passed index. A default implementation is provided in CLiwDefaultMap .
TInt | Count | ( | ) | const [pure virtual] |
Returns the number of key-value pair stored in the map collection. A default implementation is provided in CLiwDefaultMap .
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.
const TDesC8 & aKey | the key to be searched |
TLiwVariant & aFndValue | the value associated with the found key |
void | InsertL | ( | 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 .
const TDesC8 & aKey | the key to be stored |
const TLiwVariant & aValue | the value associated with the key to be stored |
void | Remove | ( | 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
const TDesC8 & aKey | the key to be removed from the map |
IMPORT_C TBool | operator== | ( | const CLiwMap & | aMap | ) | const [virtual] |
Default implementation of equality operator.
const CLiwMap & aMap | the map to be compared |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.