![]() |
Public API Reference |
#include <hashmap.h>
Inheritance diagram for csHashMap:
Public Methods | |
csHashMap (uint32 size=53) | |
Constructor. More... | |
virtual | ~csHashMap () |
Destructor. More... | |
void | Put (csHashKey key, csHashObject object) |
Put an object in this map. More... | |
csHashObject | Get (csHashKey key) const |
Get an object from this map. More... | |
void | Delete (csHashKey key, csHashObject object) |
Delete the given key/object from the map. More... | |
void | DeleteAll (csHashKey key) |
Delete all objects from this map with a given key. More... | |
void | DeleteAll () |
Delete all objects from this map. More... | |
void | DumpStats () |
Dump statistics about bucket quality. More... | |
Friends | |
class | csHashIterator |
class | csGlobalHashIterator |
class | csHashMapReversible |
You can put elements in this map using a key. Keys must not be unique. If a key is not unique then you can iterate over all elements with the same key.
Definition at line 160 of file hashmap.h.
|
Constructor.
The parameter for the constructor is the initial size of the hashtable. The best sizes are prime. |
|
Destructor. The objects referenced too in this hash table will not be destroyed. |
|
Delete the given key/object from the map. This function will only delete the object once. If multiple 'Put''s are done with the same object then this function will only delete one of them. |
|
Delete all objects from this map.
|
|
Delete all objects from this map with a given key.
|
|
Dump statistics about bucket quality.
|
|
Get an object from this map. Returns NULL if object is not there. If there are multiple elements with the same key then a random one will be returned. Use an iterator to iterate over all elements with the same key. |
|
Put an object in this map. Use the csHashCompute() function to get a pseudo-unique numeric key from a string. |