Tools.h++ Class Reference

Table Of Contents
by testFun returns TRUE . Returns FALSE otherwise. 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
entries() const;
Returns the number of items that are currently in the collection.
T*
find(const T* target) const;
Returns a pointer to the first object encountered which is equal to the object pointed to by target,
or nil if no such object can be found. Equality is measured by the class-defined equality operator
for type T.
T*
find(RWBoolean (*testFun)(T*, void*),void* d,) const;
Returns a pointer to the first object encountered for which the user-defined tester function
pointed to by testFun returns TRUE, or nil if no such object can be found. 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*&
first();
T* const&
first() const;
Returns a pointer to the first item in the list. The behavior is undefined if the list is empty.
T*
get();
Returns a pointer to the first item in the list and removes the item. The behavior is undefined if
the list is empty.
size_t
index(const T* a);
Returns the index of the first object that is equal to the object pointed to by a, or RW_NPOS if
there is no such object. Equality is measured by the class-defined equality operator for type T.
size_t
index(RWBoolean (*testFun)(T*, void*),void* d) const;
Returns the index of the first object for which the user-defined tester function pointed to by
testFun returns TRUE, or RW_NPOS if there is no such object. The tester function must have the
prototype:
RWBoolean yourTester(T*, void* d);