Tools.h++ Manual

104011 Tandem Computers Incorporated 22-59
22
Public member functions
RWTPtrSlist<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. This
function is relatively inefficient for a singly-linked list.
T* removeNext(T* a);
Advances the iterator to the first element that is equal to the object pointed to
by
a
, then removes and returns it. 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. Equality is
measured by the class-defined equality operator for type
T
.