Module: Essential Tools Module Group: RWCollectable Classes
RWDlistCollectablesConstIterator RWConstIterator
atFirst() atLast() findNext() findNextReference() |
key() operator()() operator++() operator+=() |
operator--() operator-=() reset() RWDlistCollectablesConstIterator() |
toFirst() toLast() |
#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.
None
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.
void operator++();
Advances the iterator one item.
void operator--();
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.
void toFirst();
Moves the iterator to the beginning of the list.
void toLast();
Moves the iterator to the end of the list.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, 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.