ANTLR3C  3.3.1
ANTLR3_HASH_ENTRY_struct Struct Reference

Internal structure representing an element in a hash bucket. More...

#include <antlr3collections.h>

Collaboration diagram for ANTLR3_HASH_ENTRY_struct:

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

voiddata
 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.

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 ;-)


Member Function Documentation

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: