Class Dict.

Inherits PatriciaTree

The Dict class provides a simple string-to-object dictionary.

It is optimized for simplicity, and for extremely fast lookups when the number of items can be estimated in advance. Its other facilities are somewhat primitive. There is no iterator, for example, and no way to remove an object from the dictionary.

An item can be added with insert(), retrieved with find() or the presence of an item can be tested with contains(). That's it.


Creates an empty dictionary.

Reimplements PatriciaTree::PatriciaTree().

bool Dict::contains( const EString & s ) const

Returns true if an object identified by s exists in the dictionary, and false otherwise.

T * Dict::find( const EString & s ) const

Looks for the object identified by s in the dictionary, and returns a pointer to it (or 0 if no such object was found).

void Dict::insert( const EString & s, T* r )

Inserts the object r into the dictionary, identified by the string s.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.