GADT Class Reference

[libgfc Index] [libgfc Hierarchy] [Headers]


Mother of all GFC ADTs More...

#include <src/gadt.h>

Inherits: GObject

Public Members

Protected Members


Detailed Description

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:

operator=()
the assignment operator

type()
returns the GType number

clone()
return a heap-based GADT object which

has same run-time type of 'this'. The new

object is initialized (i.e. its NOT a copy

of the the generating object).


GType type(void) const [public virtual]

return the dynamic type

GADT* clone() const [public virtual]

return a new (clean) ADT object with same type

int cmp(const GADT& ) const [public virtual]

comparing two objects (of same type) -- not supported

void statRep() [public static]

for testing only


Documentation generated by lqian@lqian-sun on Wed Jul 14 09:36:10 EDT 1999
Kdoc