Tools.h++ Manual

21-120 104011 Tandem Computers Incorporated
21
RWHashDictionaryIterator
RWHashDictionaryIterator
|
RWSetIterator
|
RWIterator
Synopsis
#include <rw/hashdict.h>
RWHashDictionary hd;
RWHashDictionaryIterator iter(hd);
Description Iterator for class
RWHashDictionary
, allowing sequential access to all the
elements of
RWHashDictionary
. Since
RWHashDictionary
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
RWHashDictionaryIterator(RWHashDictionary&);
Construct an iterator for a
RWHashDictionary
collection. Immediately after
construction, the position of the iterator is undefined until positioned.
Public member operator
virtual RWCollectable* operator()();
Redefined from class
RWIterator
. Advances the iterator to the next key-value
pair and returns the key. Returns nil if the cursor is at the end of the collection.
Use member function
value()
to recover the value.