#include <stdio.h>#include <stdlib.h>#include <string.h>#include "epDefs.h"#include "epUtils.h"#include "epHash.h"Include dependency graph for epHash.c:

Go to the source code of this file.
Functions | |
| epHash_t* | epHash_create (const ulong numOfBuckets, boolean_t (*keyComparisonFunction)(const void *key1, const void *key2), uint (*hashFunction)(const void *key), int (*keyDeallocatorFunction)(void *key), int (*valueDeallocatorFunction)(void *value)) |
| int | epHash_destroy (epHash_t *hashTable) |
| uint | epHash_size (epHash_t *hashTable) |
| boolean_t | epHash_isEmpty (epHash_t *hashTable) |
| uint | epHash_getNumOfBuckets (epHash_t *hashTable) |
| int | epHash_put (epHash_t *hashTable, const void *key, const void *value) |
| void* | epHash_get (const epHash_t *hashTable, const void *key) |
| int | epHash_remove (epHash_t *hashTable, const void *key) |
| boolean_t | epHash_containsKey (epHash_t *hashTable, const void *key) |
| int | epHash_rehash (epHash_t *hashTable, uint numOfBuckets) |
| void | epHash_setIdealRatio (epHash_t *hashTable, double idealRatio, double lowerRehashThreshold, double upperRehashThreshold) |
| uint | calculateIdealNumOfBuckets (const epHash_t *hashTable) |
A IMPLEMENTER: 1)autoriser ou non 2 clé de même valeur de hashage. si interdit et autorehash -> alors rehash si interdit et pas autorehash -> alors erreur et pas d'insertion 2)pouvoir connaitre la valeur de hashage d'une clé 3)retourver une valeur(parcours) 4)savoir si l'autorehash est activé
Definition in file epHash.c.
|
|
Calculate the optimal number of buckets, based on the ideal ratio. visibility :: private
|
|
|
Return <true> if the key is present into the hastable, <false> else. visibility :: public
|
|
|
Create & initialize a new hashtable. visibility :: public
|
|
|
Destroy the hashtable and all the couples key/value contained into. visibility :: public
|
|
|
Return the key-associated value of the hashtable. visibility :: public
|
|
|
Return the bucket number of the hashtable. visibility :: public
|
|
|
Return <true> is the hashtable is empty, <false> else. visibility :: public
|
|
|
Insert a new key/value couple into the hashtable. visibility :: public
|
|
|
Rehash the hastable. It is used to optimized the access time and the memory space using. visibility :: public
|
|
|
Remove the key/value couple from the hashtable. visibility :: public
|
|
|
fixe les ratio de rehashage. les différentes valeurs sont: + ratio idéal. c'est le nombre idéal d'éléments par bucket (celui que cherche à atteindre lors d'un rehashage) + ratio moyen minimal avant rehash décrémentiel. (nombre total d'éléments/nombre de buckets). En dessous de cette valeur, un rehashage négatif sera effectué (on diminue le nombre de buckets) Pour désactiver le rehashage négatif automatique, on mettra la valeur 0.0 + ratio moyen maximal avant rehash incrémentiel (nombre total d'éléments/nombre de buckets) Au dessus de cette valeur, on rehash la table en augmentant son nombre de buckets ! Doit être supérieur au ratio minimal moyen Pour désactiver le rehashage automatique incrémentiel, on lui affectera la valeur 0.0 valeurs par défaut: resp. 3.0, 0.0 et 15.0 visibility :: public
|
|
|
Return the size of the hashtable (the number of elements contained into). visibility :: public
|
1.2.1 written by Dimitri van Heesch,
© 1997-2000