This class implements a fast hashtable. primes for special tables sizes: size 1.000, 10.000, 100.000, 1.000.000, 10.000.000 prime 1.009, 10.007, 100.003, 1.000.003, 10.000.019.
More...
#include <hashtable.h>
List of all members.
Detailed Description
This class implements a fast hashtable. primes for special tables sizes: size 1.000, 10.000, 100.000, 1.000.000, 10.000.000 prime 1.009, 10.007, 100.003, 1.000.003, 10.000.019.
HashTable
Member Enumeration Documentation
Description of the Enumeration HashType
- Enumerator:
-
Constructor & Destructor Documentation
HashTable::HashTable |
( |
int |
iSize = 1000003 ) |
|
Constructor of the hashtable. You can initialize the max size of the table. You can fill in even more the max elements, but then there must be collision and perfomance is decreasing.
- Parameters:
-
iSize | max number of entries. You should choose a prime here to reduce collisions. |
HashTable::~HashTable |
( |
) |
|
The descructor cleans up its resources. It does not delete the referenced objects.
Member Function Documentation
Adds a new ChainEntry object with a correspondig key. You can use this key to lookup the object.
- Parameters:
-
key | a unicode string |
pValue | the value to store |
void HashTable::clear |
( |
bool |
bDelete = true ) |
|
Clears the Hashtable.
- Parameters:
-
bDelete | true if everything is cleared false if not. |
int HashTable::hash |
( |
const unsigned char * |
pData, |
|
|
unsigned int |
iLen |
|
) |
| [protected] |
Create a new Hash with specified length and data.
- Parameters:
-
pData | the data to put into the hash. |
iLen | the length of the Hash. |
- Returns:
- the created Hash.
Looks up the value object identified by the passed string.
- Parameters:
-
- Returns:
- the found object or NULL if not found
Removes an object from the hashtable identified by the passed string.
- Parameters:
-
- Returns:
- the removed object or NULL if not found
int HashTable::rotating_hash |
( |
const unsigned char * |
pData, |
|
|
unsigned int |
iLen |
|
) |
| [protected] |
Rotating hash
- Parameters:
-
pData | the data to put into the hash. |
iLen | the length of the Hash. |
- Returns:
- the created rotating_hash.
void HashTable::setHashType |
( |
HashType |
type ) |
|
Sets the HashType.
- Parameters:
-
type | a Variable filled with the HashType (e.g. rotating_hash). |
The documentation for this class was generated from the following files:
- /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/hashtable.h
- /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/hashtable.cpp