|
GClasses
|
The base class of hash tables.
#include <GHashTable.h>
Public Member Functions | |
| 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 Member Functions | |
| 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) |
| virtual bool | areKeysEqual (const char *pKey1, const char *pKey2)=0 |
| Returns true iff the keys compare equal. More... | |
| virtual size_t | hash (const char *pKey, size_t nBucketCount)=0 |
| Returns a hash of the key. More... | |
Protected Attributes | |
| size_t | m_nBucketCount |
| size_t | m_nCount |
| size_t | m_nModCount |
| struct HashBucket * | m_pBuckets |
| struct HashBucket * | m_pFirstEmpty |
Friends | |
| class | GHashTableEnumerator |
|
protected |
|
virtual |
|
protected |
Adds a key/value pair to the hash table.
|
protected |
Returns the number of values with the specified key.
|
protected |
Returns true and the first occurrence of a value with the specified key if one exists.
|
protected |
Removes the first found occurrence of the specified key.
|
protected |
|
protectedpure virtual |
Returns true iff the keys compare equal.
Implemented in GClasses::GNodeHashTable, GClasses::GConstStringToIndexHashTable, GClasses::GConstStringHashTable, and GClasses::GHashTable.
|
protectedpure virtual |
Returns a hash of the key.
Implemented in GClasses::GNodeHashTable, GClasses::GConstStringToIndexHashTable, GClasses::GConstStringHashTable, and GClasses::GHashTable.
|
inline |
Returns a number that changes when the contents of this table are modified (This is useful for detecting invalidated iterators)
|
inline |
Returns the number of items in this hash table.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |