Module: Essential Tools Module Group: RWCollectable
#include <rw/hashdict.h> RWHashDictionary hd; RWHashDictionaryConstIterator iter(hd);
One of two iterators for class RWHashDictionary. This iterator allows sequential access to all the elements of RWHashDictionary, and, as a const iterator, does not change anything in the underlying data structure. Since RWHashDictionary is unordered, elements are not accessed in any particular order.
Like all Rogue Wave 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.
Construct a const iterator for an RWHashDictionary collection. Immediately after construction, the position of the iterator is undefined until positioned.
virtual const RWCollectable* operator()();
Redefined from class RWConstIterator. 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.
virtual const RWCollectable* findNext(const RWCollectable* target);
Redefined from class RWConstIterator. Moves the iterator to the next key-value pair where the key isEqual to the object pointed to by target. Returns the key or nil if no key was found.
virtual const RWCollectable* key() const;
Redefined from class RWConstIterator. Returns the key at the current iterator position.
virtual void reset();
const RWCollectable* value() const;
Returns the value at the current iterator position.
©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.