In file /home/blah/darwin2k/src/ddcore/misc/ptrList.h:

class ptrHash

a generic hash table class

Public Fields

[more]unsigned int nbins
number of bins
[more]unsigned int mask
bitmask for nbins
[more]ptrList** bins
array of ptrLists for each bin

Public Methods

[more] ptrHash(unsigned int desiredSize)
constructor.
[more] ~ptrHash(void)
destructor.
[more]void computeHashSize(unsigned int desiredSize)
computes the actual hash size based on the desired size
[more]int isPresent(const void* ptr, unsigned long key)
returns 1 if pointer is present, using the given key
[more]inline ptrList* getBin(unsigned long key) const
returns the bin for the given key
[more]ptrList* addBin(unsigned long key, unsigned int size = 10)
adds a bin for the given key
[more]inline ptrHash* getHash(unsigned long key)
returns a hash table for the given key.
[more]ptrHash* addHash(unsigned long key, int size)
adds a ptrHash with desired size of 'size' for the given key.


Documentation

a generic hash table class
ounsigned int nbins
number of bins

ounsigned int mask
bitmask for nbins

optrList** bins
array of ptrLists for each bin

o ptrHash(unsigned int desiredSize)
constructor. Actual size may be greater than desiredSize.

o ~ptrHash(void)
destructor. Deletes any non-null bins, but not their contents.

ovoid computeHashSize(unsigned int desiredSize)
computes the actual hash size based on the desired size

oint isPresent(const void* ptr, unsigned long key)
returns 1 if pointer is present, using the given key

oinline ptrList* getBin(unsigned long key) const
returns the bin for the given key

optrList* addBin(unsigned long key, unsigned int size = 10)
adds a bin for the given key

oinline ptrHash* getHash(unsigned long key)
returns a hash table for the given key. WARNING: this assumes you're doing a multidimensional hash table, in which case each bin has a single element in the list (a ptrHash).

optrHash* addHash(unsigned long key, int size)
adds a ptrHash with desired size of 'size' for the given key. WARNING: this assumes you're doing a multidimensional hash table, so each bin has a single element in the list, which is a ptrHash.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.