proj home

Files   Classes   Functions   Hierarchy  

hashtableiterator< H > Class Template Reference

Iterate over the hash table. More...

#include <hashtable.h>

Inheritance diagram for hashtableiterator< H >:
Collaboration diagram for hashtableiterator< H >:

List of all members.

Public Member Functions

 hashtableiterator (H &ht_)
 Pass the hash table.
void reset ()
 Initialize.
boolc operator! ()
 Is the iterator valid?
void operator++ ()
 Increment.
H::blink operator() () const
 Access.

Public Attributes

H & ht
 Hash table.


Detailed Description

template<typename H>
class hashtableiterator< H >

Iterate over the hash table.

Definition at line 94 of file hashtable.h.


Constructor & Destructor Documentation

template<typename H>
hashtableiterator< H >::hashtableiterator ( H &  ht_  )  [inline]

Pass the hash table.

Definition at line 105 of file hashtable.h.

00106     : ht(ht_) {}


Member Function Documentation

template<typename H>
boolc hashtableiterator< H >::operator! (  )  [inline]

Is the iterator valid?

Definition at line 111 of file hashtable.h.

00112     { return (cx!=0); }

template<typename H>
H::blink hashtableiterator< H >::operator() (  )  const [inline]

Access.

Definition at line 116 of file hashtable.h.

00117     { return cx; };

template<typename H >
void hashtableiterator< H >::operator++ (  )  [inline]

Increment.

Definition at line 135 of file hashtable.h.

References hashtableiterator< H >::ht.

00136 {
00137   if (cx)
00138   {
00139     cx = cx->next;
00140     if (cx)
00141       return;
00142 
00143     ++ci;
00144   }
00145 
00146   for ( ; ci<ht.bucketsize; ++ci)
00147   {
00148     cx = ht.vb[ci];
00149     if (cx==0)
00150       continue;
00151 
00152     return;
00153   }
00154 }

template<typename H >
void hashtableiterator< H >::reset (  )  [inline]

Initialize.

Definition at line 126 of file hashtable.h.

References hashtableiterator< H >::ht.

Referenced by cfcontainerhash::reset(), hashtabletest::test06(), hashtabletest::test07(), and hashtabletest::test08().

00127 {
00128   ci=0; 
00129   cx=ht.vb[0]; 
00130   if (cx==0)
00131     ++(*this);
00132 }


Member Data Documentation

template<typename H>
H& hashtableiterator< H >::ht

Hash table.

Definition at line 103 of file hashtable.h.

Referenced by hashtableiterator< H >::operator++(), and hashtableiterator< H >::reset().


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

Generated on Fri Mar 4 00:50:03 2011 for Chelton Evans Source by  doxygen 1.5.8