SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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>
Const iterator for class RWSlistCollectables that traverses the linked-list from the first to last it...
Definition slistcol.h:522
Represents a group of ordered elements without keyed access, where duplicates are allowed.
Definition slistcol.h:56
Persistence
None

Constructor & Destructor Documentation

◆ RWSlistCollectablesConstIterator() [1/2]

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() [2/2]

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

◆ atFirst()

bool RWSlistCollectablesConstIterator::atFirst ( ) const
inline

Returns true if the iterator is at the beginning of the list, otherwise returns false.

◆ atLast()

bool RWSlistCollectablesConstIterator::atLast ( ) const
inline

Returns true if the iterator is at the end of the list, otherwise returns false.

◆ findNext()

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.

◆ findNextReference()

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.

◆ key()

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

Returns the item at the current iterator position.

Implements RWConstIterator.

◆ operator()()

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.

◆ operator++()

const void * RWSlistCollectablesConstIterator::operator++ ( )
inline

Advances the iterator one item.

◆ operator+=()

const void * RWSlistCollectablesConstIterator::operator+= ( size_t n)
inline

Advances the iterator n items.

◆ reset()

virtual void RWSlistCollectablesConstIterator::reset ( )
inlinevirtual

Resets the iterator, after which the position of the iterator is undefined.

Implements RWConstIterator.

◆ toFirst()

void RWSlistCollectablesConstIterator::toFirst ( )
inline

Moves the iterator to the beginning of the list.

◆ toLast()

void RWSlistCollectablesConstIterator::toLast ( )
inline

Moves the iterator to the end of the list.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.