Module: Essential Tools Module Group: STL-based Collection
Does not inherit
#include <rw/tvsrtdli.h> template <class T, class C, class A=std::allocator<T> > class RWTValSortedDlistConstIterator
RWTValSortedDlistConstIterator provides a const iterator to RWTValSortedDlist. A const iterator prohibits changes to the collection over which it iterates.
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 returns a value equivalent to boolean false. Continued increments 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.
Creates an iterator for the sorted 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. 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 references the first element. If, before iteration, self referenced the last value in the list, self now points to an undefined value distinct from the reset value and false is returned. 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 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 points to 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 RWTValSortedDlist<T,C,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 such an element if found, false otherwise.
bool findNext(bool(*fn)(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 such an element if found, false otherwise.
const T& key();
Returns the stored value referenced by self.
void reset(); void reset(RWTValSortedDlist<T,C,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 RWTValSortedDlist 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.