Tools.h++ Manual

104011 Tandem Computers Incorporated 22-29
22
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.
T* operator()();
Advances the iterator to the next item and returns a pointer to it. When the
end of the collection is reached, returns nil and the position of the iterator will
be undefined.
Public member functions
RWTPtrDlist<T> container() const;
Returns a pointer to the collection over which this iterator is iterating.
T* findNext(T* a);
Advances the iterator to the first element that is equal to the object pointed to
by
a
and returns a pointer to it. If no item is found, returns nil and the
position of the iterator will be undefined. Equality is measured by the class-
defined equality operator for type
T
.
T* findNext(RWBoolean
(*testFun)(T*, void*), void*);
Advances the iterator to the first element for which the tester function pointed
to by
testFun
returns
TRUE
and returns a pointer to it. If no item is found,
returns nil and the position of the iterator will be undefined.
void insertAfterPoint(T* a);
Inserts the object pointed to by
a
into the iterator's associated collection in the
position immediately after the iterator's current position.
T* key() const;
Returns a pointer to the object at the iterator's current position. The results are
undefined if the iterator is no longer valid.
T* remove();
Removes and returns the object at the iterator's current position from the
iterator's associated collection. Afterwards, the iterator will be positioned at
the element immediately before the removed element. Returns nil if
unsuccessful in which case the position of the iterator is undefined.