Simple C++ Macro Library

Thomas Wang, July 1997

Introduction

With the completion of the macro processor , I can start on the design of my macro library. The macro library has a number of container classes that are required by my project. My design goals are for the library to be fast, general purpose, and easy to use.

Macro Library

The library consists of the following classes: Pair, Array, Single Linked List, Double Linked List, and Map.

Please send bug reports or comments to my e-mail address listed at the end of the page.

Pair

A Pair is a structure of two items of type $T1 and $T2.

* Read uuPair.h source

Array

The Array is an expandable array of type $T. One can dynamically add or remove from the end of the array.

* Read uuArray.h source
* Read uuArray.cc source

Single Linked List

The single linked list is a structure carrying a data item of type $T, in addition to the next pointer.

* Read uuSlink.h source
* Read uuSlink.cc source

Double Linked List

The double linked list has two parts: the double linked node, and the double linked list.

The double linked node is a structure carrying a data item of type $T, in addition to the previous and next pointer.

The double linked list consisted of a sequence of double linked nodes. The nodes can be inserted or removed from the two ends of the list. There is an operation to tell if a node is currently in a list.

* Read uuDlist.h source
* Read uuDlist.cc source

Map

The Map provides quick lookup capability mapping from a key to a value. Its implementation uses the Sorted Linear Hash Table algorithm.

* Read uuMap.h source
* Read uuMap.cc source

HOME

Give feedbacks to wang@cup.hp.com