Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWTValSortedDlistIterator<T,C>

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include<rw/tvsrtdli.h>
RWTValSortedDlist<T,C> dl;
RWTValSortedDlistIterator<T,C> itr(dl);

Standard C++ Library Dependent!


RWTValSortedDlistIterator requires the Standard C++ Library.


Description

RWTValSortedDlistIterator is supplied with Tools.h++ 7 to provide an iterator interface to RWTValSortedDlistIterator that is backward compatable with the container iterators provided in Tools.h++ 6.x.

The order of iteration over an RWTValSortedDlist is dependent on the supplied comparator object supplied as applied to the values stored in the container.

The current item referenced by this iterator is undefined after construction or after a call to reset(). The iterator becomes valid after being advanced with either a preincrement or operator().

For both operator++ and operator(), iterating past the last element will return a value equivalent to boolean false. Continued increments will return a value equivalent to false until reset() is called.

The value type must have operator== and operator< defined. This requirement is imposed by the Standard C++ Library.

Persistence

None

Examples

#include<rw/tvsrtdli.h>
#include<iostream.h>
#include<rw/cstring.h>
int main(){
   RWTValSortedDlist<RWCString, less<RWCString> > a;
   RWTValSortedDlistIterator<RWCString, less<RWCString> > itr(a);
   a.insert("John");
   a.insert("Steve");
   a.insert("Mark");
   a.insert("Steve");
   for(;itr();)
     cout << itr.key() << endl;
   return 0;
}
Program Output
John
Mark
Steve
Steve

Public Constructors

RWTValSortedDlistIterator<T,C>(RWTValSortedDlist<T,C>&s); 

Public Member Operators

RWBoolean
operator()();
RWBoolean
operator++();
RWBoolean
operator+=(size_type n); 
RWBoolean
operator--();
RWBoolean
operator-=(size_type n); 

Public Member Functions

RWTValSortedDlist<T,C>*
container() const; 
RWBoolean
findNext(const T a); 
RWBoolean
findNext(RWBoolean(*fn)(T, void*), void* d);
T
key();
RWBoolean
remove();
RWBoolean
removeNext(const T); 
RWBoolean
removeNext(RWBoolean(*fn)(T, void*), void* d); 
void
reset();
void
reset(RWTValSortedDlist<T,C>& l);


Previous fileTop of documentContentsIndexNext file
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.