The following are a few general-purpose classes used in my implementation:
- Dump. This class forms a wrapper around malloc. It provides for automatic freeing of allocated memory in the destructor and a few common methods such as create and destroy. All these methods are safe. It is not necessary to worry about memory allocation and deallocation.
- LstList. This class implements a double linked list. Member function attach adds an element and detach detaches it. getFirst returns a pointer to the first element; getNext returns a pointer to the element following the given element.
- LstLink0. This is the base class for list elements.
- MemBuf. This class provides dynamically growing storage for strings and byte arrays. It also provides the operators << and >>. The most commonly used methods are insert, which inserts or adds a block; squeeze, which truncates a block; getBuf, which returns a pointer to the character string; and getLength, which returns the length of the data.
- DynArray. This class defines an array of elements accessible using a character string as a key. Each element of this array is inherited from DynArrayItem, which is basically the key of the associated string. The main methods are find and add. This class accelerates access to objects that are accessed via a key string. o