Module: Essential Tools Module Group: STL-based Collection
Does not inherit
#include <rw/tvdlist.h> template <class T, class A=std::allocator<T> > class RWTValDlistConstIterator
RWTValDlistConstIterator provides a const iterator for Standard Library-based RWTValDlist collections. The const iterator prohibits changes to the underlying collection.
The order of iteration over an RWTValDlist is dependent on the order of insertion of the values into 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 returns a value equivalent to boolean false. Continued increments return a value equal to false until reset() is called.
Creates an iterator for the dlist s. The iterator begins in an undefined state and must be advanced before the first element is accessible.
Advances self to the next element and returns its value. If the iterator has advanced past the last item in the container, the element returned is a nil pointer equivalent to boolean false.
Advances self to the next element. If the iterator has been reset or just created, self now references the first element. If, before iteration, self referenced the last value in the list, self now references an undefined value distinct from the reset value, and this operator returns false. Otherwise, true is returned. Note: no postincrement operator is provided.
bool operator+=(size_type n);
Behaves as if the operator++ member function had been applied n times
Moves self back to the immediately previous element. If the iterator has been reset or just created, this operator returns false, otherwise it returns true. If self now references the first element, it is now in the reset state. If self has been iterated past the last value in the list, it now references the last item in the list. Note: no postdecrement operator is provided.
bool operator-=(size_type n);
Behaves as if the operator-- member function had been applied n times
const RWTValDlist<T,A>* container() const;
Returns a pointer to the collection being iterated over.
bool findNext(const T& a);
Advances self to the first element t encountered by iterating forward, such that the expression (t == a) is true. Returns true if an element was found, returns false otherwise.
bool findNext(bool(*fn)(const T&, void*), void* d);
Advances self to the first element t encountered by iterating forward such that the expression((*fn)(t,d)) is true. fn points to a user-defined tester function which must have prototype:
bool yourTester(const T a, void* d);
Client data may be passed through parameter d. Returns true if an element was found, returns false otherwise.
const T& key();
Returns the stored value referenced by self.
void reset(); void reset(RWTValDlist<T,A>& l);
Resets the iterator so that after being advanced it references the first element of the collection. Using reset() with no argument resets the iterator on the current container. Supplying a RWTValDlist to reset() resets the iterator on the new container.
©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.