Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

tables.h File Reference

Basis for hash tables. More...

#include "base/intutils.h"
#include "base/Enumerator.h"

Go to the source code of this file.

Namespaces

namespace  hash

Functions

void rehash (SingleBucket_t ***tablePtr, uint32_t *maskPtr)
 Rehashing for singled linked buckets.
void rehash (DoubleBucket_t ***tablePtr, uint32_t *maskPtr)
 Rehashing for double linked buckets.


Detailed Description

Basis for hash tables.

To get a working hash table one has to implement the insert/delete that is dependant on the data type, in particular to test for equality.


Function Documentation

void hash::rehash DoubleBucket_t ***  oldTablePtr,
uint32_t *  maskPtr
 

Rehashing for double linked buckets.

Same as the previous rehash with the difference on the type of the buckets: { bucket_t *next; bucket_t **previous; uint info; custom data }

void hash::rehash SingleBucket_t ***  tablePtr,
uint32_t *  maskPtr
 

Rehashing for singled linked buckets.

In practice, the hash value is not recomputed since it is stored in the 'info' field of the buckets.

Parameters:
tablePtr,: where the table of bucket* to rehash is. The table will be reallocated.
maskPtr,: the mask used to access the indices it will be read and written.
Precondition:
the size of the table is a power of 2 and size = mask + 1
Postcondition:
*tablePtr is deallocated (delete) and the new table is newly allocated (new).


Generated on Fri Jun 30 00:03:00 2006 for Module hash by  doxygen 1.4.2