VIPER REFERENCE MANUAL


NAME
iflDictionary - implements a dictionary of named elements

INHERITS FROM
iflHashTable

HEADER FILE
#include <ifl/iflDictionary.h>

PUBLIC METHOD SUMMARY
iflDictionary ( int size=0, int caseSensitive=TRUE);
int insert ( iflName* elem);
iflName* find ( const char* s, int insertIfNeeded=FALSE);

INHERITED PUBLIC METHODS

   Inherited from iflHashTable
void clear (  );
void clearStats (  );
iflHashElem* find ( unsigned int index, const void* key);
float getFullFraction (  ) const;
int getNumEntries (  ) const;
int insert ( iflHashElem* elem);
iflHashElem* next ( int& index);
int remove ( iflHashElem* elem);
void setFullFraction ( const float fraction);

INHERITED PROTECTED METHODS

   Inherited from iflHashTable
virtual int match ( const void* key, const iflHashElem* elem);

CLASS DESCRIPTION
iflDictionary is used to create a dictionary of named elements. It is derived from iflHashTable, and supplies appropriate hash function and key matching methods for name strings. The elements of the dictionary must be, or be derived from, iflName.

METHOD DESCRIPTIONS

   iflDictionary()
iflDictionary ( int size=0, int caseSensitive=TRUE);

Creates an iflDictionary with initial capacity, size. The default value of zero creates a table with 131 slots. The name lookup can either be case-sensitive or case-insensitive, depending on whether caseSensitive is TRUE or FALSE, respectively.

   find()
iflName* find ( const char* s, int insertIfNeeded=FALSE);

Tries to locate the element with name string s in the dictionary. If unsuccessful and if insertIfNeeded is TRUE then an element of type iflName, with name string s, is inserted into the dictionary, a value of NULL is returned otherwise.

   insert()
int insert ( iflName* elem);

Returns TRUE if elem is successfully inserted into the dictionary; FALSE otherwise.

SEE ALSO
iflHashTable