GClasses
|
This is a hash table that uses any object which inherits from HashTableNode as the key.
#include <GHashTable.h>
Public Member Functions | |
GNodeHashTable (bool bOwnNodes, size_t nInitialBucketCount) | |
virtual | ~GNodeHashTable () |
void | add (HashTableNode *pRec) |
Adds an object to this hash table. More... | |
virtual bool | areKeysEqual (const char *pKey1, const char *pKey2) |
Returns true iff the two keys are equal. More... | |
HashTableNode * | get (HashTableNode *pLikeMe) |
Gets the value for the specified key. More... | |
virtual size_t | hash (const char *pKey, size_t nBucketCount) |
Computes a hash of the key. More... | |
Public Member Functions inherited from GClasses::GHashTableBase | |
virtual | ~GHashTableBase () |
size_t | revisionNumber () |
Returns a number that changes when the contents of this table are modified (This is useful for detecting invalidated iterators) More... | |
size_t | size () |
Returns the number of items in this hash table. More... | |
Protected Attributes | |
std::vector< HashTableNode * > * | m_pNodes |
Protected Attributes inherited from GClasses::GHashTableBase | |
size_t | m_nBucketCount |
size_t | m_nCount |
size_t | m_nModCount |
struct HashBucket * | m_pBuckets |
struct HashBucket * | m_pFirstEmpty |
Additional Inherited Members | |
Protected Member Functions inherited from GClasses::GHashTableBase | |
GHashTableBase (size_t nInitialBucketCount) | |
void | _Add (const char *pKey, const void *pValue) |
Adds a key/value pair to the hash table. More... | |
size_t | _Count (const char *pKey) |
Returns the number of values with the specified key. More... | |
template<class T > | |
bool | _Get (const char *pKey, T **pOutValue) |
Returns true and the first occurrence of a value with the specified key if one exists. More... | |
void | _Remove (const char *pKey) |
Removes the first found occurrence of the specified key. More... | |
void | _Resize (size_t nNewSize) |
GClasses::GNodeHashTable::GNodeHashTable | ( | bool | bOwnNodes, |
size_t | nInitialBucketCount | ||
) |
|
virtual |
void GClasses::GNodeHashTable::add | ( | HashTableNode * | pRec | ) |
Adds an object to this hash table.
|
inlinevirtual |
Returns true iff the two keys are equal.
Implements GClasses::GHashTableBase.
|
inline |
Gets the value for the specified key.
|
inlinevirtual |
Computes a hash of the key.
Implements GClasses::GHashTableBase.
|
protected |