Tools.h++ Class Reference

Table Of Contents
Adds the item a to the collection. Returns true if the insertion is successful, otherwise returns false. The
function will return true unless the collection already holds an element with an equivalent key.
void
intersection(const RWTPtrSet<T,C>& s);
Sets self to the intersection of self and s. Elements from each set are dereferenced before being
compared.
bool
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
bool
isEquivalent(const RWTPtrSet<T,C>& s) const;
Returns true if there is set equivalence between self and s, and returns false otherwise.
bool
isProperSubsetOf(const RWTPtrSet<T,C>& s) const;
Returns true if self is a proper subset of s, and returns false otherwise.
bool
isSubsetOf(const RWTPtrSet<T,C>& s) const;
Returns true if self is a subset of s or if self is set equivalent to s, false otherwise.
size_type
occurrencesOf(const T* a) const;
Returns the number of elements t in self that compare equal with *a.
size_type
occurrencesOf(bool (*fn)(T*,void*), void* d);
size_type
occurrencesOf(bool (*fn)(const T*,void*), void* d) const;
Returns the number of elements t in self 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.
T*
remove(const T* a);
Removes and returns the first element t in self that compares equal with *a. Returns rwnil if there is no
such element.
T*
remove(bool (*fn)(const T*,void*), void* d);
Removes and returns the first element t in self such that the expression ((*fn)(t,d)) is true. Returns rwnil
if there is no such element. 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 par_meter d.
size_type
removeAll(const T* a);