SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDlistCollectablesIterator Class Reference

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

#include <rw/dlistcol.h>

Inheritance diagram for RWDlistCollectablesIterator:
RWIterator

Public Member Functions

 RWDlistCollectablesIterator (RWDlistCollectables &s)
 
virtual RWCollectablefindNext (const RWCollectable *target)
 
RWCollectablefindNextReference (const RWCollectable *e)
 
RWCollectableinsertAfterPoint (RWCollectable *a)
 
virtual RWCollectablekey () const
 
virtual RWCollectableoperator() ()
 
RWCollectableremove ()
 
RWCollectableremoveNext (const RWCollectable *target)
 
RWCollectableremoveNextReference (const RWCollectable *e)
 
virtual void reset ()
 

Friends

class RWDlistCollectablesConstIterator
 

Detailed Description

Iterator for class RWDlistCollectables. 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:379
Represents a group of ordered items, not accessible by an external key.
Definition dlistcol.h:49
Persistence
None

Constructor & Destructor Documentation

◆ RWDlistCollectablesIterator()

RWDlistCollectablesIterator::RWDlistCollectablesIterator ( RWDlistCollectables & s)
inline

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

Member Function Documentation

◆ findNext()

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

◆ findNextReference()

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

Moves the iterator to the next item which 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.

◆ insertAfterPoint()

RWCollectable * RWDlistCollectablesIterator::insertAfterPoint ( RWCollectable * a)
inline

Inserts the item a after the current cursor position and returns the item. The cursor's position is unchanged.

◆ key()

virtual RWCollectable * RWDlistCollectablesIterator::key ( ) const
inlinevirtual

Returns the item at the current iterator position.

Implements RWIterator.

◆ operator()()

virtual RWCollectable * RWDlistCollectablesIterator::operator() ( )
inlinevirtual

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

Implements RWIterator.

◆ remove()

RWCollectable * RWDlistCollectablesIterator::remove ( )
inline

Removes and returns the item at the current cursor position. Afterwards, the iterator is positioned at the previous item in the list.

◆ removeNext()

RWCollectable * RWDlistCollectablesIterator::removeNext ( const RWCollectable * target)
inline

Moves the iterator to the next item in the list which isEqual() to the item pointed to by target, removes it from the list and returns it. Afterwards, the iterator is positioned at the previous item in the list. If no item is found, the function returns rwnil and the position of the iterator is undefined.

◆ removeNextReference()

RWCollectable * RWDlistCollectablesIterator::removeNextReference ( const RWCollectable * e)
inline

Moves iterator to the next item in the list which is identical to the item pointed to by e (that is, that has address e), removes it from the list and returns it. Afterwards, the iterator is positioned at the previous item in the list. If no item is found, the function returns rwnil and the position of the iterator is undefined.

◆ reset()

virtual void RWDlistCollectablesIterator::reset ( )
inlinevirtual

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

Implements RWIterator.

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