Tools.h++ Class Reference

Table Of Contents
apply(void (*fn)(const K*,const T*,void*),void* d) const;
Applies the user-defined function pointed to by fn to every association in the collection.
This function must have one of the prototypes:
void yourfun(const K* key, T*& a, void* d);
void yourfun(const K* key, const T* a, void* d);
Client data may be passed through parameter d.
void
applyToKeyAndValue(void (*fn)(const K*,T*&,void*),void* d);
void
applyToKeyAndValue
(void (*fn)(const K*,const T*,void*),void* d) const;
This is a deprecated version of the apply member above. It behaves exactly the same as
apply.
iterator
begin();
const_iterator
begin() const;
Returns an iterator positioned at the first pair in self.
void
clear();
Clears the collection by removing all items from self.
void
clearAndDestroy();
Removes all associations from the collection and uses operator delete to destroy the
objects pointed to by the keys and their associated items. Do not use this method if
multiple pointers to the same object are stored. (This could happen even if keys all
compare different, since items are not considered during comparison.)
bool
contains(const K* key) const;
Returns true if there exists a key j in self that compares equal to *key, otherwise returns
false.
bool
contains(bool (*fn)(value_type,void*), void* d) const;
Returns true if there exists an association a in self such that the expression ((*fn)(a,d)) is
true, otherwise returns false. fn points to a user-defined tester function which must have
prototype:
bool yourTester(value_type a, void* d);