DCL 4.0
Loading...
Searching...
No Matches
HASHMAP_T::Iterator Class Reference

#include <__HASHMAP.h>

Public Member Functions

 Iterator (HashNode *_pNode, HASHMAP_T *_pMap)
Iteratoroperator= (const Iterator &_it)
Iteratoroperator++ ()
Iterator operator++ (int)
bool operator== (const Iterator &_it) const
bool operator!= (const Iterator &_it) const
Assocoperator* () const

Protected Attributes

HASHMAP_T__pMap
HashNode__pNode

Friends

class ConstIterator

Detailed Description

Definition at line 81 of file __HASHMAP.h.

Constructor & Destructor Documentation

◆ Iterator()

HASHMAP_T::Iterator::Iterator ( HashNode * _pNode,
HASHMAP_T * _pMap )
inline

Definition at line 154 of file __HASHMAP.h.

159{
160 __pNode = _pNode;
161 __pMap = _pMap;
162}
HASHMAP_T * __pMap
Definition __HASHMAP.h:92
HashNode * __pNode
Definition __HASHMAP.h:93

Member Function Documentation

◆ operator!=()

bool HASHMAP_T::Iterator::operator!= ( const Iterator & _it) const
inline

Definition at line 184 of file __HASHMAP.h.

186{
187 return __pNode != _it.__pNode;
188}

◆ operator*()

HASHMAP_T::Assoc & HASHMAP_T::Iterator::operator* ( ) const
inline

Definition at line 192 of file __HASHMAP.h.

193{
194 return *__pNode;
195}

◆ operator++() [1/2]

HASHMAP_T::Iterator & HASHMAP_T::Iterator::operator++ ( )

Definition at line 46 of file __HASHMAP.cpp.

47{
50
51 const HashNode* pOldNode = __pNode;
52 __pNode = __pNode->pNext;
53 if (__pNode == NULL)
54 {
55 size_t index = __pMap->bucketIndex(pOldNode->key);
56 while((__pNode == NULL) && (++index < __pMap->__buckets.size()))
57 __pNode = (HashNode*)__pMap->__buckets[index];
58 }
59 return *this;
60}
#define NULL
Definition Config.h:340
#define __DCL_ASSERT(expr)
Definition Object.h:371
PointerArray __buckets
Definition __HASHMAP.h:145

◆ operator++() [2/2]

HASHMAP_T::Iterator HASHMAP_T::Iterator::operator++ ( int )

Definition at line 63 of file __HASHMAP.cpp.

64{
65 Iterator itTemp = *this;
66 ++(*this);
67 return itTemp;
68}
Iterator(HashNode *_pNode, HASHMAP_T *_pMap)
Definition __HASHMAP.h:155

◆ operator=()

HASHMAP_T::Iterator & HASHMAP_T::Iterator::operator= ( const Iterator & _it)
inline

Definition at line 166 of file __HASHMAP.h.

168{
169 __pNode = _it.__pNode;
170 __pMap = _it.__pMap;
171 return *this;
172}

◆ operator==()

bool HASHMAP_T::Iterator::operator== ( const Iterator & _it) const
inline

Definition at line 176 of file __HASHMAP.h.

178{
179 return __pNode == _it.__pNode;
180}

◆ ConstIterator

friend class ConstIterator
friend

Definition at line 94 of file __HASHMAP.h.

Member Data Documentation

◆ __pMap

HASHMAP_T* HASHMAP_T::Iterator::__pMap
protected

Definition at line 92 of file __HASHMAP.h.

◆ __pNode

HashNode* HASHMAP_T::Iterator::__pNode
protected

Definition at line 93 of file __HASHMAP.h.


The documentation for this class was generated from the following files: