
Go up to RT++ Type Declarations
Go forward to Example
Type Constructors
We distinguish two classes of types that may be used as base types of
RT++ type constructors:
- Atomic Types. These are types that do not make use of any
RT++ types. Examples of such types are C++ integers, floating points, and also
classes provided that they do not contain RT++ types as components. For
each such type T, the following global
declaration must be provided:
Atom(T);
Atom
is a macro whose application declares some externally visible
symbols in the corresponding object file. For each type T,
Atom
(T) must therefore appear in one C++ source file only.
- Reference Types. These are C++ classes that
contain at least one RT++ type as component. For each such type T, two
public member functions have to be defined:
init()
. This function must call the init()
function of
each RT++ type component.
scan()
. This function must call the scan()
function of
each RT++ type component.
Furthermore, in one C++ source file the following global declaration
must be provided:
Ref(T);
Implementation Note: On compilers that support static member
initializers for template classes (which is required by the ANSI C++ standard
but not yet supported by the GNU g++ compiler),
Ref
becomes superfluous by uncommenting a few lines
in the RT++ header file rt++/rt_type.h. This makes virtually all of
the following declarations redundant.
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: main.tex,v 1.10 1996/04/04 11:45:47 schreine Exp