ANTLR3_HASH_ENTRY_struct Struct Reference

#include <antlr3collections.h>

Collaboration diagram for ANTLR3_HASH_ENTRY_struct:

Collaboration graph
[legend]

Detailed Description

Internal structure representing an element in a hash bucket.

Stores the original key so that duplicate keys can be rejected if necessary, and contains function can be supported. If the hash key could be unique I would have invented the perfect compression algorithm ;-)

Public Member Functions

 void (ANTLR3_CDECL *free)(void *data)
 Pointer to routine that knows how to release the memory structure pointed at by data.

Data Fields

void * data
 Pointer to the data for this particular entry.
ANTLR3_HASH_KEY keybase
 Key that created this particular entry.
struct ANTLR3_HASH_ENTRY_structnextEntry
 Pointer to the next entry in this bucket if there is one.


Member Function Documentation

ANTLR3_HASH_ENTRY_struct::void ( ANTLR3_CDECL *  free  ) 

Pointer to routine that knows how to release the memory structure pointed at by data.

If this is NULL then we assume that the data pointer does not need to be freed when the entry is deleted from the table.


Field Documentation

Pointer to the next entry in this bucket if there is one.

Sometimes different keys will hash to the same bucket (especially if the number of buckets is small). We could implement dual hashing algorithms to minimize this, but that seems over the top for what this is needed for.

Referenced by antlr3EnumNextEntry(), antlr3HashFree(), antlr3HashGet(), antlr3HashGetI(), antlr3HashPut(), antlr3HashPutI(), antlr3HashRemove(), and antlr3HashRemoveI().


The documentation for this struct was generated from the following file:

Generated on Mon Nov 29 17:24:04 2010 for ANTLR3C by  doxygen 1.5.5