SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWOrderedConstIterator Class Reference

Traverses the collection from the first to the last item. More...

#include <rw/ordcltn.h>

Inheritance diagram for RWOrderedConstIterator:
RWConstIterator

Public Member Functions

 RWOrderedConstIterator (const RWOrdered &ord)
 
 RWOrderedConstIterator (const RWOrderedIterator &it)
 
virtual const RWCollectablefindNext (const RWCollectable *target)
 
virtual const RWCollectablekey () const
 
virtual const RWCollectableoperator() ()
 
virtual void reset ()
 

Detailed Description

One of two iterators for class RWOrdered. Traverses the collection from the first to the last item. As a const iterator, this iterator does not change anything in the underlying data structure.

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/ordcltn.h>
Persistence
None

Constructor & Destructor Documentation

RWOrderedConstIterator::RWOrderedConstIterator ( const RWOrdered ord)
inline

Constructs an RWOrderedConstIterator from an RWOrdered collection. Immediately after construction the position of the iterator is undefined.

RWOrderedConstIterator::RWOrderedConstIterator ( const RWOrderedIterator it)
inline

Constructs an RWOrderedConstIterator from an RWOrderedIterator. Immediately after construction the position of the iterator is undefined.

Member Function Documentation

virtual const RWCollectable* RWOrderedConstIterator::findNext ( const RWCollectable target)
virtual

Moves the iterator to the next item which isEqual() to the item pointed to by target and returns it. If no item is found, returns rwnil and the position of the iterator is undefined.

Implements RWConstIterator.

virtual const RWCollectable* RWOrderedConstIterator::key ( ) const
virtual

Returns the item at the current iterator position.

Implements RWConstIterator.

virtual const RWCollectable* RWOrderedConstIterator::operator() ( )
virtual

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

Implements RWConstIterator.

virtual void RWOrderedConstIterator::reset ( )
inlinevirtual

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

Implements RWConstIterator.

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.