Module: Essential Tools Module Group: RWCollectable
#include <rw/dlistcol.h> RWDlistCollectables d; RWDlistCollectablesConstIterator it(d);
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 will bring undefined results.
RWDlistCollectablesConstIterator (RWDlistCollectables& d);
Construct an RWDlistCollectablesConstIterator from an RWDlistCollectables. Immediately after construction, the position of the iterator is undefined.
virtual const RWCollectable* operator()();
Redefined from class RWIterator. Advances the iterator to the next item and returns it. Returns rwnil when the end of the list is reached.
Advances the iterator one item.
Moves the iterator back one item.
void operator+=(size_t n);
Advances the iterator n items.
void operator-=(size_t n);
Moves the iterator back n items.
bool atFirst() const;
Returns true if the iterator is at the beginning of the list, otherwise false;
bool atLast() const;
Returns true if the iterator is at the end of the list, otherwise false;
virtual const RWCollectable* findNext(const RWCollectable* target);
Redefined from class RWConstIterator. Moves iterator to the next item which isEqual to the item pointed to by target and returns it. If no item is found, returns nil and the position of the iterator will be undefined.
const RWCollectable* findNextReference(const RWCollectable* e);
Moves 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, returns nil and the position of the iterator will be undefined.
virtual const RWCollectable* key() const;
Redefined from class RWConstIterator. Returns the item at the current iterator position.
virtual void reset();
Redefined from class RWIterator. Resets the iterator. Afterwards, the position of the iterator will be undefined.
Moves the iterator to the beginning of the list.
Moves the iterator to the end of the list.
©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, 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.