Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32hashtab.h>

Class THashMapIter

class THashMapIter : public THashTableIterBase;

Description

A templated class which allows iteration over the elements of a RHashMap<K,V> class.

The array being iterated over may not be modified while an iteration is in progress or the iteration operations may malfunction or panic.

Derivation

Members

Defined in THashMapIter:


Construction and destruction


THashMapIter(const RHashMap< K, V > &)

inline THashMapIter(const RHashMap< K, V > &aMap);

Description

Construct an iterator over the specified associative array. The iterator starts at conceptual position one before the beginning of the list being iterated.

Parameters

const RHashMap< K, V > &aMap

The array to be iterated over.

[Top]


Member functions


Reset()

inline void Reset();

Description

Reset the iterator to its initial state.


CurrentKey()const

inline const K* CurrentKey() const;

Description

Return the key corresponding to the current position of the iterator.

Return value

const K *

A pointer to the key object corresponding to the current position of the iterator. NULL if the iterator has just been constructed or reset, or if it has previously reached the end of an iteration.


NextKey()

inline const K* NextKey();

Description

Steps the iterator to the next position and returns the corresponding key.

Return value

const K *

A pointer to the key object corresponding to the next position of the iterator. NULL if the iterator has exhausted all the available key-value pairs.


CurrentValue()

inline V* CurrentValue();

Description

Return the value corresponding to the current position of the iterator.

Return value

V *

A pointer to the value object corresponding to the current position of the iterator. NULL if the iterator has just been constructed or reset, or if it has previously reached the end of an iteration.


NextValue()

inline const V* NextValue();

Description

Steps the iterator to the next position and returns the corresponding value.

Return value

const V *

A pointer to the value object corresponding to the next position of the iterator. NULL if the iterator has exhausted all the available key-value pairs.


RemoveCurrent()

inline void RemoveCurrent();

Description

Removes the element at the current iterator position from the hash table. If the iterator does not currently point to a valid element, no action is taken. Note that the iterator position is not altered so it no longer points to a valid element following the Remove(TUint32 *,TUint32 *,TInt,TUint32). It is illegal to call either THashMapIter::CurrentKey()const or THashMapIter::CurrentValue() on the iterator after calling Remove(TUint32 *,TUint32 *,TInt,TUint32) - the only legal operations are THashMapIter::Reset(), THashMapIter::NextKey() or THashMapIter::NextValue().