rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWIterator Class Reference
[RWCollectable-derived]

Contains virtual functions for positioning and resetting the iterator. More...

#include <rw/iterator.h>

Inheritance diagram for RWIterator:
RWBagIterator RWBinaryTreeIterator RWDlistCollectablesIterator RWHashTableIterator RWOrderedIterator RWSlistCollectablesIterator RWSetIterator RWHashDictionaryIterator

List of all members.

Public Member Functions

virtual RWCollectablefindNext (const RWCollectable *target)=0
virtual RWCollectablekey () const =0
virtual RWCollectableoperator() ()=0
virtual void reset ()=0

Detailed Description

Class RWIterator is an abstract base class for iterators used by the Smalltalk-like collection classes. The class contains virtual functions for positioning and resetting the iterator. They are all pure virtual functions, meaning that deriving classes must supply a definition. The descriptions below are intended to be generic -- all inheriting iterators generally follow the described pattern.

Synopsis

 #include <rw/iterator.h>
 (Abstract base class)

Persistence

None


Member Function Documentation

virtual RWCollectable* RWIterator::findNext ( const RWCollectable target  )  [pure virtual]

Moves the iterator forward to the next item which "matches" the object pointed to by target and returns it or rwnil if no item was found. For most collections, an item "matches" the target if either RWCollectable::isEqual() or RWCollectable::compareTo() indicate equivalence, whichever is appropriate for the actual collection type. However, when an iterator is used with an "identity collection" (i.e., RWIdentitySet and RWIdentityDictionary), it looks for an item with the same address (i.e., "is identical to").

Implemented in RWBinaryTreeIterator, RWDlistCollectablesIterator, RWHashDictionaryIterator, RWHashTableIterator, RWOrderedIterator, RWBagIterator, and RWSlistCollectablesIterator.

virtual RWCollectable* RWIterator::key (  )  const [pure virtual]
virtual RWCollectable* RWIterator::operator() (  )  [pure virtual]

Advances the iterator and returns the next item, or rwnil if the end of the collection has been reached.

Implemented in RWBinaryTreeIterator, RWDlistCollectablesIterator, RWHashDictionaryIterator, RWHashTableIterator, RWOrderedIterator, RWBagIterator, and RWSlistCollectablesIterator.

virtual void RWIterator::reset (  )  [pure virtual]

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

Implemented in RWBinaryTreeIterator, RWDlistCollectablesIterator, RWHashTableIterator, RWOrderedIterator, RWBagIterator, and RWSlistCollectablesIterator.

 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.