Module: Essential Tools Module Group: RWCollectable Classes
RWSlistCollectablesConstIterator RWConstIterator
atFirst() atLast() findNext() |
findNextReference() key() operator()() |
operator++() operator+=() reset() |
RWSlistCollectablesConstIterator() toFirst() toLast() |
#include <rw/slistcol.h> RWSlistCollectables sc; RWSlistCollectablesConstIterator sci(sc);
One of two iterators for class RWSlistCollectables. This version is a const iterator, that cannot effect any changes to the data structure it is iterating through. This iterator traverses the linked-list from the first to last item.
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
RWSlistCollectablesConstIterator (RWSlistCollectables&);
Constructs an iterator from a singly-linked list. Immediately after construction, the position of the iterator is undefined.
virtual const RWCollectable* operator()();
Redefined from class RWConstIterator. Advances the iterator to the next element and returns it. Returns nil when the end of the collection is reached.
void operator++();
Advances the iterator one item.
void operator+=(size_t n);
Advances the iterator 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 is undefined.
const RWCollectable* findNextReference(const RWCollectable* e);
Moves 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, returns nil and the position of the iterator is undefined.
virtual const RWCollectable* key() const;
Redefined from class RWConstIterator. Returns the item at the current iterator position.
virtual void reset();
Redefined from class RWConstIterator. Resets the iterator. Afterwards, the position of the iterator is 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.