THashTable Class Reference

class THashTable

Generic hashtable for storing keys with associated values. K must be a subclass of class MHashKey .

Constructor & Destructor Documentation

THashTable(TUint)

THashTable ( TUint aSize )

Parameters

TUint aSize

~THashTable()

~THashTable ( )

Member Functions Documentation

ConstructL()

void ConstructL ( )

Find(MHashKey &)

V * Find ( MHashKey & aKey )

Parameters

MHashKey & aKey

Length()

TUint Length ( )

RemoveAll()

void RemoveAll ( )

Removes all data from the hashtable.

RemoveIf(TBool(*)(const V &, void *), void *)

TUint RemoveIf ( TBool (*)(const V &, void *) aRemoveCriteria,
void * aDataObject
)

Iterate through hashtable and exectue aRemoveCriteria function for all entries. Delete entries for which the function returns ETrue.

Parameters

TBool (*)(const V &, void *) aRemoveCriteria Function that returns ETrue if the data item given as the parameter for the function should be removed.
void * aDataObject Data pointer that is passed to the remove criteria function. The meaning of data pointer is determined by the criteria function. See CDestinationCache::Cleanup for example on how this function is used.

RemoveL(MHashKey &)

TUint RemoveL ( MHashKey & aKey )

Deletes a data item from hash and releases the memory allocated.

Parameters

MHashKey & aKey

Size()

TUint Size ( ) [inline]

How many bytes does the hash table take. This assumes all data objects are equally sized.

StoreL(MHashKey &, V &)

TUint StoreL ( MHashKey & aKey,
V & aValue
)

Store key and the associated value to the hashtable. The cache operates in overwrite mode: if key exists, the earlier value is overwritten with new one. A future work item might be to implement the conventional mode, that would raise an exception when the key already exists.

Parameters

MHashKey & aKey
V & aValue

Member Data Documentation

TUint iSize

TUint iSize [private]

TChain< K, V > * iTable

TChain < K, V > * iTable [private]