Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

RWTValDlistIterator<T>

Alternative interface: no Standard C++ Library

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

Synopsis

#include <rw/tvdlist.h>
RWTValDlist<T> list;
RWTValDlistIterator<T> iterator(list);

Please Note!


If you do not have the Standard C++ Library, use the interface described here. Otherwise, use the interface to RWTValDlistIterator described in the Class Reference.


Description

Iterator for class RWTValDlist<T>, allowing sequential access to all the elements of a doubly-linked parameterized list. Elements are accessed in order, in either direction.

Like all Rogue Wave iterators, 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.

Persistence

Isomorphic

Example

#include<rw/tvdlist.h>
#include<iostream.h>
#include<rw/cstring.h>
int main(){
   RWTValDlist<RWCString> a;
   RWTValDlistIterator<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
Steve
Mark
Steve

Public Constructor

RWTValDlistIterator<T>(RWTValDlist<T>& c);

Public Member Operators

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

Public Member Functions

RWTValDlist<T>*
container() const;
RWBoolean
findNext(const T& a);
RWBoolean
findNext(RWBoolean (*testFun)(const T&, void*), void*);
void
insertAfterPoint(const T& a);
T
key() const;
RWBoolean
remove();
RWBoolean
removeNext(const T& a);
RWBoolean
removeNext(RWBoolean (*testFun)(const T&, void*), void*);
void
reset();
void
reset(RWTValDlist<T>& c);


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