COVISE Core
|
#include <coMultiHashBase.h>
Public Member Functions | |
coMultiHashBase () | |
constructor More... | |
coMultiHashBase (DATA nullelem) | |
constructor More... | |
const DATA & | getNullElem () const |
get the NULL element More... | |
virtual | ~coMultiHashBase () |
destructor More... | |
virtual int | insert (const KEY &key, const DATA &inData) |
insert an entry (virtual for non-multi hash) More... | |
int | remove (unsigned long hashIndex) |
remove an entry by hashIndex More... | |
void | removeAll () |
remove an entry by hashIndex More... | |
unsigned long | getHash (const KEY &key) const |
get hash index, 0 if no element found More... | |
DATA & | operator[] (unsigned long hashIndex) |
access element by hash index: assert() correct index !! More... | |
const DATA & | operator[] (unsigned long hashIndex) const |
access element by hash index: assert() correct index !! More... | |
virtual unsigned long | nextHash (unsigned long hashIndex) const |
get next hashIndex to given hashIndex More... | |
int | getNumEntries () const |
get number of entries currently in hash More... | |
virtual unsigned long | hash1 (const KEY &) const =0 |
first hash function (pure virtual) More... | |
virtual unsigned long | hash2 (const KEY &) const =0 |
second hash function (pure virtual) More... | |
virtual bool | equal (const KEY &, const KEY &) const =0 |
KEY1 == KEY2 operation (pure virtual) More... | |
Protected Types | |
enum | { EMPTY = 0 , PREVIOUS , USED } |
Protected Attributes | |
KEY * | keys |
unsigned char * | entryFlags |
unsigned int | size |
size of the list More... | |
unsigned int | prime |
the prime currently used as the length of the list More... | |
Private Types | |
enum | { NUMPRIMES = 28 } |
Private Member Functions | |
void | resize (void) |
Private Attributes | |
DATA | d_nullElem |
DATA * | data |
unsigned int | entries |
unsigned int | maxEntries |
int | primeIndex |
Friends | |
class | coHashIter< KEY, DATA > |
class | coHashBase< KEY, DATA > |
Virtual base class implementing the double-hashing algorithm.
Requires:
Users must derive a class and define:
|
inline |
constructor
|
inline |
constructor
|
inlinevirtual |
destructor
|
pure virtual |
KEY1 == KEY2 operation (pure virtual)
Implemented in covise::coHashBase< int, DATA >, covise::coIntHash< DATA >, covise::coIntMultiHash< DATA >, and covise::coHashBase< KEY, DATA >.
|
inline |
get hash index, 0 if no element found
|
inline |
get the NULL element
|
inline |
get number of entries currently in hash
|
pure virtual |
first hash function (pure virtual)
Implemented in covise::coHashBase< int, DATA >, covise::coIntHash< DATA >, covise::coIntMultiHash< DATA >, and covise::coHashBase< KEY, DATA >.
|
pure virtual |
second hash function (pure virtual)
Implemented in covise::coHashBase< int, DATA >, covise::coIntHash< DATA >, covise::coIntMultiHash< DATA >, and covise::coHashBase< KEY, DATA >.
|
inlinevirtual |
insert an entry (virtual for non-multi hash)
Reimplemented in covise::coHashBase< int, DATA >, covise::coMultiHash< int, DATA >, covise::coHash< KEY, DATA >, covise::coHashBase< KEY, DATA >, and covise::coMultiHash< KEY, DATA >.
|
inlinevirtual |
get next hashIndex to given hashIndex
Reimplemented in covise::coHashBase< KEY, DATA >, and covise::coHashBase< int, DATA >.
|
inline |
access element by hash index: assert() correct index !!
|
inline |
access element by hash index: assert() correct index !!
|
inline |
remove an entry by hashIndex
|
inline |
remove an entry by hashIndex
|
inlineprivate |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
protected |
|
protected |
|
private |
|
protected |
the prime currently used as the length of the list
|
private |
|
protected |
size of the list