Class Dict.

Inherits DictBase

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.

Dict::Dict()

Creates an empty dictionary.

Reimplements Garbage::Garbage().

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

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

T * Dict::find( const String & 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 String & s, T* r )

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

This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.