ANTLR3_VECTOR_struct Struct Reference

#include <antlr3collections.h>

Collaboration diagram for ANTLR3_VECTOR_struct:

Collaboration graph
[legend]

Public Member Functions

 void (ANTLR3_CDECL *free)(struct ANTLR3_VECTOR_struct *vector)

Data Fields

ANTLR3_UINT32(* add )(struct ANTLR3_VECTOR_struct *vector, void *element, void(ANTLR3_CDECL *freeptr)(void *))
void(* clear )(struct ANTLR3_VECTOR_struct *vector)
ANTLR3_UINT32 count
 Number of entries currently in the list;.
void(* del )(struct ANTLR3_VECTOR_struct *vector, ANTLR3_UINT32 entry)
pANTLR3_VECTOR_ELEMENT elements
 Array of pointers to vector elements.
ANTLR3_UINT32 elementsSize
 Total number of entries in elements at any point in time.
ANTLR3_BOOLEAN factoryMade
 Indicates if the structure was made by a factory, in which case only the factory can free the memory for the actual vector, though the vector free function is called and will recurse through its entries calling any free pointers for each entry.
void *(* get )(struct ANTLR3_VECTOR_struct *vector, ANTLR3_UINT32 entry)
ANTLR3_VECTOR_ELEMENT internal [ANTLR3_VECTOR_INTERNAL_SIZE]
 Many times, a vector holds just a few nodes in an AST and it is too much overhead to malloc the space for elements so at the expense of a few bytes of memory, we hold the first few elements internally.
void *(* remove )(struct ANTLR3_VECTOR_struct *vector, ANTLR3_UINT32 entry)
ANTLR3_UINT32(* set )(struct ANTLR3_VECTOR_struct *vector, ANTLR3_UINT32 entry, void *element, void(ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting)
ANTLR3_UINT32(* size )(struct ANTLR3_VECTOR_struct *vector)
ANTLR3_BOOLEAN(* swap )(struct ANTLR3_VECTOR_struct *, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2)

Member Function Documentation

ANTLR3_VECTOR_struct::void ( ANTLR3_CDECL *  free  ) 


Field Documentation

ANTLR3_UINT32(* ANTLR3_VECTOR_struct::add)(struct ANTLR3_VECTOR_struct *vector, void *element, void(ANTLR3_CDECL *freeptr)(void *))

Total number of entries in elements at any point in time.

Referenced by antlr3SetVectorApi(), antlr3VectorAdd(), antlr3VectorFree(), antlr3VectorResize(), antlr3VectorSet(), antlr3VectorSwap(), and closeVectorFactory().

Indicates if the structure was made by a factory, in which case only the factory can free the memory for the actual vector, though the vector free function is called and will recurse through its entries calling any free pointers for each entry.

Referenced by antlr3RewriteRuleElementStreamNewAEV(), antlr3SetVectorApi(), antlr3VectorFactoryNew(), antlr3VectorFree(), closeVectorFactory(), freeNodeRS(), freeRS(), and newVector().

Many times, a vector holds just a few nodes in an AST and it is too much overhead to malloc the space for elements so at the expense of a few bytes of memory, we hold the first few elements internally.

It means we must copy them when we grow beyond this initial size, but that is less overhead than the malloc/free callas we would otherwise require.

Referenced by antlr3SetVectorApi(), antlr3VectorResize(), and newVector().

ANTLR3_UINT32(* ANTLR3_VECTOR_struct::set)(struct ANTLR3_VECTOR_struct *vector, ANTLR3_UINT32 entry, void *element, void(ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting)

Referenced by antlr3SetVectorApi(), and sortVector().


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

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