Tools.h++ Class Reference

Table Of Contents
This Tools.h++ 6.x style constructor creates an empty hashed map which uses the hash
object h and has an initial capacity of sz.
RWTPtrHashMap<K,T,H,EQ>
(const value_type* first,value_type* last);
Constructs a map by copying elements from the array of pairs pointed to by first, up to,
but not including, the pair pointed to by last.
Public Member Operators
RWTPtrHashMap<K,T,H,EQ>&
operator=(const container_type& m);
RWTPtrHashMap<K,T,H,EQ>&
operator=(const RWTPtrHashMap<K,T,H,EQ>& m);
Destroys all associations in self and replaces them by copying all associations from m.
bool
operator==(const RWTPtrHashMap<K,T,H,EQ>& m) const;
Returns true if self compares equal to m, otherwise returns false. Two collections are
equal if both have the same number of entries, and iterating through both collections
produces, in turn, individual keys that compare equal to each other. Keys are
dereferenced before being compared.
T*&
operator[](K* key);
Looks up key and returns a reference to its associated item. If the key is not in the
dictionary, then it will be added with an associated uninitialized pointer of type T*.
Because of this, if there is a possibility that a key will not be in the dictionary, then this
operator should only be used as an lvalue.
Public Member Functions
void
apply(void (*fn)(const K*, T*&,void*),void* d);
void
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.
self 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