[libgfc Index] [libgfc Hierarchy] [Headers]
Mother of all GFC ADTs More...
#include <src/gadt.h>
Inherits: GObject
Mother of all GFC ADTs.
This is an abstract base class derived by all GFC ADTs.
Important public methods includ conversion routines between
secondary storage, main memory and ASCII string formats of
the same ADT object, as well as other run-time type information
such as the type and the name of the ADTs.
From GFC's point of view, the secondary storage (mostly in the
form of a database or a file) format is simply a block of binary
data (a serialized version of all the useful data members that
need to be persistent). The serialization is achieved by a pair of
virtual functions pack() and unpack(). Both
functions take a reference to a DataPipe object, where
the binary chunk of data are hold. The DataPipe class supports a
dynamic binary data array with intelligent memory allocations.
The use of DataPipe simplifies the passing-around of individual data
objects which usualy are of of variable length.
Most of the ADT objects can accept a user string (with an
agreed format per ADT) and initialize the data members out of the
string. This is done by the input() method. Naturally there
is an output() function that converts data members into
an ASCII string.
Besides converting routines mentioned above, each ADT class
has the following common methods:
has same run-time type of 'this'. The new
object is initialized (i.e. its NOT a copy
of the the generating object).
[public virtual]
return the dynamic type
[public virtual]
return a new (clean) ADT object with same type
[public virtual]
comparing two objects (of same type) -- not supported
[public static]
for testing only
Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999 | Kdoc |