Share via


CMapStringToOb::InitHashTable

Initialise la table de hachage.

void InitHashTable(
   UINT hashSize,
   BOOL bAllocNow = TRUE
);

Paramètres

  • hashSize
    Nombre d'entrées dans la table de hachage.

  • bAllocNow
    Si TRUE, alloue la table de hachage lors de l'initialisation ; sinon le tableau est alloué lorsque cela est nécessaire.

Notes

Pour optimiser les performances, la taille de table de hachage doit être un nombre premier.Pour éviter les collisions, la taille doit être environ 20 % supérieure au plus grand groupe de données anticipée.

Le tableau suivant indique les autres fonctions membres similaires à CMapStringToOb::InitHashTable.

Classe

Fonction membre

CMapPtrToPtr

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

CMapPtrToWord

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

CMapStringToString

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

CMapStringToPtr

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

CMapWordToOb

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

CMapWordToPtr

void InitHashTable( UINT hashSize, BOOL bAllocNow = TRUE );

Configuration requise

Header: afxcoll.h

Voir aussi

Référence

Classe de CMapStringToOb

Graphique de la hiérarchie