The DictBase class is the foundation for Dict.
It has no own API, it merely provides the member functions used in Dict. Dict, as befits a template, has only small, inline members. Whenever something big is required, Dict calls a DictBase function.
Constructs an empty dictionary optimsed for up to size items. The dictionary will be really fast up to around size items, then it grows slower.
Empties this Dict object. The referenced objects are not deleted, merely forgotten.
Returns true only if the Dict contains the key s.
Returns a pointer to the object whose key is s, or a null pointer if there is no such object.
Returns a 32-bit has of the string key. key is viewed as a series of numbers, so the algorithm can easily be used on either UString or String.
This code uses the algorithm djb described on comp.lang.c in 1990, message-id <6429:Dec500:37:email@example.com>.
http://www.cse.yorku.ca/~oz/hash.html contains a good overview of simple hash functions.
Inserts r to the dictionary based on key s, replacing any previous object with key s.
The previous object is not deleted, merely removed from the dictionary.
Returns true if empty, false if not.
Returns a list of all the keys in this dictionary.
Changes the number of buckets in the dictionary to size, resorting all the contained objects. This function is necessarily slow.
Removes the object with key s from the dictionary. The object is not deleted, merely removed from the dictionary.
If there is no such object, insert() does nothing.
This web page based on source code belonging to Oryx Mail Systems GmbH. All rights reserved.