SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWOrderedIterator Class Reference

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

#include <rw/ordcltn.h>

Inheritance diagram for RWOrderedIterator:
RWIterator

Public Member Functions

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

Friends

class RWOrderedConstIterator
 

Detailed Description

Iterator for class RWOrdered. Traverses the collection from the first to the last item. 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>
Traverses the collection from the first to the last item.
Definition ordcltn.h:340
Represents a group of ordered items, accessible by an index number, but not accessible by an external...
Definition ordcltn.h:57
Persistence
None

Constructor & Destructor Documentation

◆ RWOrderedIterator()

RWOrderedIterator::RWOrderedIterator ( const RWOrdered & ord)
inline

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

Member Function Documentation

◆ findNext()

virtual RWCollectable * RWOrderedIterator::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 RWIterator.

◆ key()

virtual RWCollectable * RWOrderedIterator::key ( ) const
virtual

Returns the item at the current iterator position.

Implements RWIterator.

◆ operator()()

virtual RWCollectable * RWOrderedIterator::operator() ( )
virtual

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

Implements RWIterator.

◆ reset()

virtual void RWOrderedIterator::reset ( )
inlinevirtual

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

Implements RWIterator.

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