RWTValDlistIterator(3C++) RWTValDlistIterator(3C++)
Name
RWTValDlistIterator<T> - Rogue Wave library class
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
Public Constructor
RWTValDlistIterator<T>(RWTValDlist<T>& c);
Constructs an iterator to be used with the list c.
Public Member Operators
RWBoolean
operator++();
Advances the iterator to the next item and returns TRUE. When the end of
the collection is reached, returns FALSE and the position of the iterator
will be undefined.
RWBoolean
operator--();
Page 1
RWTValDlistIterator(3C++) RWTValDlistIterator(3C++)
Retreats the iterator to the previous item and returns TRUE. When the
beginning of the collection is reached, returns FALSE and the position of
the iterator will be undefined.
RWBoolean
operator+=(size_t n);
Advances the iterator n positions and returns TRUE. When the end of the
collection is reached, returns FALSE and the position of the iterator
will be undefined.
RWBoolean
operator-=(size_t n);
Retreats the iterator n positions and returns TRUE. When the beginning
of the collection is reached, returns FALSE and the position of the
iterator will be undefined.
RWBoolean
operator()();
Advances the iterator to the next item. Returns TRUE if the new position
is valid, FALSE otherwise.
Public Member Functions
RWTValDlist<T>*
container() const;
Returns a pointer to the collection over which this iterator is
iterating.
RWBoolean
findNext(const T& a);
Advances the iterator to the first element that is equal to a and returns
TRUE, or FALSE if there is no such element. Equality is measured by the
class-defined equality operator for type T.
RWBoolean
findNext(RWBoolean (*testFun)(const T&, void*), void*);
Advances the iterator to the first element for which the tester function
pointed to by testFun returns TRUE and returns TRUE, or FALSE if there is
no such element.
Page 2
RWTValDlistIterator(3C++) RWTValDlistIterator(3C++)
void
insertAfterPoint(const T& a);
Inserts the value a into the iterator's associated collection in the
position immediately after the iterator's current position.
T
key() const;
Returns the value at the iterator's current position. The results are
undefined if the iterator is no longer valid.
RWBoolean
remove();
Removes the value from the iterator's associated collection at the
current position of the iterator. Returns TRUE if successful, FALSE
otherwise. Afterwards, if successful, the iterator will be positioned at
the element immediately before the removed element.
RWBoolean
removeNext(const T& a);
Advances the iterator to the first element that is equal to a and removes
it. Returns TRUE if successful, FALSE otherwise. Equality is measured
by the class-defined equality operator for type T. Afterwards, if
successful, the iterator will be positioned at the element immediately
before the removed element.
RWBoolean
removeNext(RWBoolean (*testFun)(const T&, void*), void*);
Advances the iterator to the first element for which the tester function
pointed to by testFun returns TRUE and removes it. Returns TRUE if
successful, FALSE otherwise. Afterwards, if successful, the iterator
will be positioned at the element immediately before the removed element.
void
reset();
Resets the iterator to the state it had immediately after construction.
void
reset(RWTValDlist<T>& c);
Page 3
RWTValDlistIterator(3C++) RWTValDlistIterator(3C++)
Resets the iterator to iterate over the collection c.
Page 4