SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDlistCollectablesConstIterator Class Reference

Traverses the linked-list from the first (head) to the last (tail) item. More...

#include <rw/dlistcol.h>

Inheritance diagram for RWDlistCollectablesConstIterator:
RWConstIterator

Public Member Functions

 RWDlistCollectablesConstIterator (const RWDlistCollectables &s)
 
 RWDlistCollectablesConstIterator (const RWDlistCollectablesIterator &it)
 
virtual const RWCollectablefindNext (const RWCollectable *target)
 
const RWCollectablefindNextReference (const RWCollectable *e)
 
virtual const RWCollectablekey () const
 
virtual const RWCollectableoperator() ()
 
virtual void reset ()
 

Detailed Description

One of two iterators for class RWDlistCollectables. As a const iterator, this iterator does not contain any functions that change the data structure it is iterating through.

This iterator traverses the linked-list from the first (head) to the last (tail) item. Functions are provided for moving in either direction.

As with 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/dlistcol.h>
Traverses the linked-list from the first (head) to the last (tail) item.
Definition dlistcol.h:503
Represents a group of ordered items, not accessible by an external key.
Definition dlistcol.h:49
Persistence
None

Constructor & Destructor Documentation

◆ RWDlistCollectablesConstIterator() [1/2]

RWDlistCollectablesConstIterator::RWDlistCollectablesConstIterator ( const RWDlistCollectables & s)
inline

Constructs an RWDlistCollectablesConstIterator from an RWDlistCollectables. Immediately after construction, the position of the iterator is undefined.

◆ RWDlistCollectablesConstIterator() [2/2]

RWDlistCollectablesConstIterator::RWDlistCollectablesConstIterator ( const RWDlistCollectablesIterator & it)
inline

Constructs an RWDlistCollectablesConstIterator from an RWDlistCollectablesIterator. Immediately after construction, the position of the iterator is undefined.

Member Function Documentation

◆ findNext()

virtual const RWCollectable * RWDlistCollectablesConstIterator::findNext ( const RWCollectable * target)
inlinevirtual

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

Implements RWConstIterator.

◆ findNextReference()

const RWCollectable * RWDlistCollectablesConstIterator::findNextReference ( const RWCollectable * e)
inline

Moves the iterator to the next item that is identical to the item pointed to by e (that is, that has address e) and returns it. If no item is found, the function returns rwnil and the position of the iterator is undefined.

◆ key()

virtual const RWCollectable * RWDlistCollectablesConstIterator::key ( ) const
inlinevirtual

Returns the item at the current iterator position.

Implements RWConstIterator.

◆ operator()()

virtual const RWCollectable * RWDlistCollectablesConstIterator::operator() ( )
inlinevirtual

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

Implements RWConstIterator.

◆ reset()

virtual void RWDlistCollectablesConstIterator::reset ( )
inlinevirtual

Resets the iterator. Afterwards, the position of the iterator is undefined.

Implements RWConstIterator.

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