Tools.h++ Class Reference

Table Of Contents
find(const K* key) const;
If there exists a key j in self that compares equal to *key, then j is returned. Otherwise,
returns rwnil.
value_type
find(bool (*fn)(value_type,void*), void* d) const;
If there exists an association a in self such that the expression ((*fn)(a,d)) is true, then returns
a. Otherwise, returns pair<rwnil,rwnil>. fn points to a user-defined tester function which must
have prototype:
bool yourTester(value_type a, void* d);
Client data may be passed through parameter d.
T*
findValue(const K* key);
const T*
findValue(const K* key) const;
If there exists a key j in self such that the expression (*j == *key) is true, returns the item
associated with j. Otherwise, returns rwnil.
const K*
findKeyAndValue(const K* key, T*& tr);
const K*
findKeyAndValue(const K* key, const T*& tr) const;
If there exists a key j in self that compares equal to *key, assigns the item associated with j to
tr, and returns j. Otherwise, returns rwnil and leaves the value of tr unchanged.
bool
insert(K* key, T* a);
Adds key with associated item a to the collection. Returns true.
bool
insertKeyAndValue(K* key, T* a);
This is a deprecated version of the insert member above. It behaves exactly the same as
insert.
bool
isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
size_type
occurrencesOf(const K* key) const;
Returns the number of keys j in self that compare equal to *key.
size_type
occurrencesOf
(bool (*fn)(value_type,void*), void* d) const;