SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWSlistCollectablesConstIterator Class Reference

Const iterator for class RWSlistCollectables that traverses the linked-list from the first to last item. More...

#include <rw/slistcol.h>

Inheritance diagram for RWSlistCollectablesConstIterator:
RWConstIterator

Public Member Functions

 RWSlistCollectablesConstIterator (const RWSlistCollectables &s)
 
 RWSlistCollectablesConstIterator (const RWSlistCollectablesIterator &it)
 
bool atFirst () const
 
bool atLast () const
 
virtual const RWCollectablefindNext (const RWCollectable *target)
 
const RWCollectablefindNextReference (const RWCollectable *e)
 
virtual const RWCollectablekey () const
 
virtual const RWCollectableoperator() ()
 
const void * operator++ ()
 
const void * operator+= (size_t n)
 
virtual void reset ()
 
void toFirst ()
 
void toLast ()
 

Detailed Description

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.

Synopsis
#include <rw/slistcol.h>
Persistence
None

Constructor & Destructor Documentation

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.

Member Function Documentation

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)
inlinevirtual

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
inlinevirtual

Returns the item at the current iterator position.

Implements RWConstIterator.

virtual const RWCollectable* RWSlistCollectablesConstIterator::operator() ( )
inlinevirtual

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 ( )
inlinevirtual

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 © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.