Tools.h++ Class Reference

Table Of Contents
TRUE and returns a pointer to it, or nil if there is no such object. The tester function must have
the prototype:
RWBoolean yourTester(T*, void* d);
This function will be called for each item in the list, with a pointer to the item as the first
argument. Client data may be passed through as parameter d.
size_t
removeAll(const T* a);
Removes all objects which are equal to the object pointed to by a. Returns the number of objects
removed. Equality is measured by the class-defined equality operator for type T.
size_t
removeAll(RWBoolean (*testFun)(T*, void*),void* d);
Removes all objects for which the user-defined tester function pointed to by testFun returns
TRUE. Returns the number of objects removed. The tester function must have the prototype:
RWBoolean yourTester(T*, void* d);
This function will be called for each item in the list, with a pointer to the item as the first
argument. Client data may be passed through as parameter d.
T*
removeAt(size_t i);
Removes the object at index i and returns a pointer to it. An exception of type RWBoundsError
will be thrown if i is not a valid index. Valid indices are from zero to the number of items in the
list less one.
T*
removeFirst();
Removes the first item in the list and returns a pointer to it. The behavior is undefined if the list is
empty.
T*
removeLast();
Removes the last item in the list and returns a pointer to it. The behavior is undefined if the list is
empty.
Related Global Operators
RWvostream&
operator<<(RWvostream& strm, const RWTPtrDlist<T>& coll);
RWFile&
operator<<(RWFile& strm, const RWTPtrDlist<T>& coll);
Saves the collection coll onto the output stream strm, or a reference to it if it has already been
saved.
RWvistream&
operator>>(RWvistream& strm, RWTPtrDlist<T>& coll);
RWFile&