17.2 The TypeAccess System

The TypeAccess system consists of a set of objects that can hold type information about class objects. This type information includes the names and types of all the members and methods in a class, the parents of the class, etc. This information can be used by classes to get information about themselves at run time. In addition, the TypeAccess system provides a set of type-aware base classes and macros for defining derived versions of these that can be used to easily incorporate run-time type information into any C++ system.

In addition to being type-aware, the base classes can use their own type information to save and load themselves automatically to and from ASCII format text files. Further, there is an extensible graphical interface based on InterViews which can automatically build editing dialogs for filling in member values and calling member functions on arbitrary objects. Finally, the type information can be used to provide a transparent script-level interface to the objects from the CSS script language. This provides the benefits of compiled C++ for fast execution, and the ability to perform arbitrary interactive processing in an interpreter using the C++ language supported by CSS.

Many features of the interface and script level interface, as well as various options that affect the way objects are saved and loaded, can be specified in comments that follow the declaration of classes, members, and methods. These comment directives constitute a secondary programming language of sorts, and they greatly increase the flexibility of the interface. They are documented in section 17.3 Standard TypeAccess Comment Directives.

Thus, the PDP++ software gets much of its functionality from the TypeAccess system. It provides all of the basic interface and file-level functionality so that the programmer only needs to worry about defining classes that perform specific tasks. These classes can then be flexibly used and manipulated by the end user with the generic TypeAccess based interface.