TreeComp is developed at the Control Theory and Robotics Lab. It contains ANSI C++ classes for handling tree structures. This documentation is based on the thesis of Ingo Herwig who also implemented the first version of TreeComp.
A tree is a construct with nodes, which contain pointers to other nodes (children). Each node has one parent and zero or any number of children. A node without children is also called leave. The nodes have an hierarchical order, without circles.
The central element is the class Node which is the interface to the tree component. Node is the physical representation of the tree, consisting of nodes and subtrees. For traversing a tree the classes NodeIterator and NodeTraversal can be used.
In order to execute certain operations on the tree these can be encapsulated in the visitor class NodeVisitor.
The output of trees takes place in the strategy classes (OutputStrategy). For each output format is done by a specialized subclass.
This library makes heavy use of design patterns as described by Gamma et. al. and some other widely used software techniques. To understand this lib you should be familiar with the concepts of
See the following pages for documentation about the design of this library:
Node
NodeIterator
NodeVisitor
OutputStrategy
NodeTraversal
An example for the usage of the classes can be found in main.cpp .