Tools.h++ Manual

104011 Tandem Computers Incorporated 21-127
21
RWHashTableIterator
RWHashTableIterator
|
RWIterator
Synopsis
#include <rw/hashtab.h>
RWHashTable h;
RWHashTableIterator it(h);
Description Iterator for class
RWHashTable
, which allows sequential access to all the
elements of
RWHashTable
.
Note – Because a
RWHashTable
is unordered, elements are not accessed in any
particular order.
Like all Tools.h++ iterators, the "current item" is undefined immediately after
construction—you must define it by using
operator()
or some other (valid)
operation.
Once the iterator has advanced beyond the end of the collection it is no longer
valid—continuing to use it will bring undefined results.
Public constructor
RWHashTableIterator(RWHashTable&);
Construct an iterator for an
RWHashTable
. After construction, the position of
the iterator is undefined.
Public member operator
virtual RWCollectable* operator()();
Redefined from class
RWIterator
. Advances the iterator to the next item and
returns it. Returns nil when the end of the collection is reached.