rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWHashDictionaryConstIterator Class Reference
[RWCollectable-derived]

Allows sequential access to all the elements of RWHashDictionary and, as a const iterator, does not change anything in the underlying data structure. More...

#include <rw/hashdict.h>

Inheritance diagram for RWHashDictionaryConstIterator:
RWSetConstIterator RWHashTableConstIterator RWConstIterator

List of all members.

Public Member Functions

 RWHashDictionaryConstIterator (const RWHashDictionary &hd)
 RWHashDictionaryConstIterator (const RWHashDictionaryIterator &it)
const RWCollectablefindNext (const RWCollectable *target)
const RWCollectablekey () const
const RWCollectableoperator() ()
virtual void reset ()
const RWCollectablevalue () const

Detailed Description

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 brings undefined results.

Synopsis

 #include <rw/hashdict.h>
 
 RWHashDictionary hd;
 RWHashDictionaryConstIterator  iter(hd);

Persistence

None


Constructor & Destructor Documentation

RWHashDictionaryConstIterator::RWHashDictionaryConstIterator ( const RWHashDictionary hd  )  [inline]

Constructs a const iterator for an RWHashDictionary collection. Immediately after construction, the position of the iterator is undefined.

RWHashDictionaryConstIterator::RWHashDictionaryConstIterator ( const RWHashDictionaryIterator it  )  [inline]

Constructs a const iterator for an RWHashDictionary collection from an iterator. Immediately after construction, the position of the const iterator is undefined.


Member Function Documentation

const RWCollectable* RWHashDictionaryConstIterator::findNext ( const RWCollectable target  )  [virtual]

Moves the iterator to the next key-value pair where the key isEqual() to the object pointed to by target. Returns the key or rwnil if no key was found.

Reimplemented from RWHashTableConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::key (  )  const [virtual]

Returns the key at the current iterator position.

Reimplemented from RWHashTableConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::operator() (  )  [virtual]

Advances the iterator to the next key-value pair and returns the key. Returns rwnil if the cursor is at the end of the collection. Use member function value() to recover the value.

Reimplemented from RWHashTableConstIterator.

virtual void RWHashDictionaryConstIterator::reset (  )  [inline, virtual]

Resets the iterator to the state it had immediately after construction.

Reimplemented from RWSetConstIterator.

const RWCollectable* RWHashDictionaryConstIterator::value (  )  const

Returns the value at the current iterator position.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, 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.