Tools.h++ Class Reference

Table Of Contents
Client data may be passed through parameter d.
bool
insert(T* a);
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 RWTPtrHashSet<T,H,EQ>& s);
Destructively performs a set theoretic intersection of self and s, replacing the contents of self
with the result.
bool
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
bool
isEquivalent(const RWTPtrHashSet<T,H,EQ>& s) const;
Returns true if there is set equivalence between self and s, and returns false otherwise.
bool
isProperSubsetOf(const RWTPtrHashSet<T,H,EQ>& s) const;
Returns true if self is a proper subset of s, and returns false otherwise.
bool
isSubsetOf(const RWTPtrHashSet<T,H,EQ>& 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 that compare equal to *a
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 to *a. Returns rwnil if
there is no such element.
T*
remove(bool (*fn)(const T*,void*), void* d);