SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Const iterator for class RWSlistCollectables that traverses the linked-list from the first to last item. More...
#include <rw/slistcol.h>
Public Member Functions | |
RWSlistCollectablesConstIterator (const RWSlistCollectables &s) | |
RWSlistCollectablesConstIterator (const RWSlistCollectablesIterator &it) | |
bool | atFirst () const |
bool | atLast () const |
void | toFirst () |
void | toLast () |
const void * | operator++ () |
const void * | operator+= (size_t n) |
virtual const RWCollectable * | findNext (const RWCollectable *target) |
virtual const RWCollectable * | key () const |
virtual const RWCollectable * | operator() () |
virtual void | reset () |
const RWCollectable * | findNextReference (const RWCollectable *e) |
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.
#include <rw/slistcol.h> RWSlistCollectables sc; RWSlistCollectablesConstIterator sci(sc);
None
RWSlistCollectablesConstIterator::RWSlistCollectablesConstIterator | ( | const RWSlistCollectables & | s | ) | [inline] |
Constructs a const
iterator from a singly-linked list. Immediately after construction, the position of the iterator is undefined.
RWSlistCollectablesConstIterator::RWSlistCollectablesConstIterator | ( | const RWSlistCollectablesIterator & | it | ) | [inline] |
Constructs a const
iterator from an iterator. Immediately after construction, the position of the const
iterator is undefined.
bool RWSlistCollectablesConstIterator::atFirst | ( | ) | const [inline] |
Returns true
if the iterator is at the beginning of the list, otherwise returns false
.
bool RWSlistCollectablesConstIterator::atLast | ( | ) | const [inline] |
Returns true
if the iterator is at the end of the list, otherwise returns false
.
virtual const RWCollectable* RWSlistCollectablesConstIterator::findNext | ( | const RWCollectable * | target | ) | [inline, virtual] |
Moves iterator to the next item that isEqual() to the item pointed to by target and returns it. If no item is found, returns rwnil and the position of the iterator is undefined.
Implements RWConstIterator.
const RWCollectable* RWSlistCollectablesConstIterator::findNextReference | ( | const RWCollectable * | e | ) | [inline] |
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 rwnil and the position of the iterator is undefined.
virtual const RWCollectable* RWSlistCollectablesConstIterator::key | ( | ) | const [inline, virtual] |
Returns the item at the current iterator position.
Implements RWConstIterator.
virtual const RWCollectable* RWSlistCollectablesConstIterator::operator() | ( | ) | [inline, virtual] |
Advances the iterator and returns the next item, or rwnil if the end of the collection has been reached.
Implements RWConstIterator.
const void* RWSlistCollectablesConstIterator::operator++ | ( | ) | [inline] |
Advances the iterator one item.
const void* RWSlistCollectablesConstIterator::operator+= | ( | size_t | n | ) | [inline] |
Advances the iterator n items.
virtual void RWSlistCollectablesConstIterator::reset | ( | ) | [inline, virtual] |
Resets the iterator, after which the position of the iterator is undefined.
Implements RWConstIterator.
void RWSlistCollectablesConstIterator::toFirst | ( | ) | [inline] |
Moves the iterator to the beginning of the list.
void RWSlistCollectablesConstIterator::toLast | ( | ) | [inline] |
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.