(******************************************************************************
*                                DATA11  .DEF                                 *
*                              ABO Software Dep.                              *
*                                                                             *
* Purpose : To provide a simple relational database class                     *
*                                                                             *
*   Notes :                                                                   *
*                                                                             *
*         Version Date : 23/2/92                                              *
******************************************************************************)
DEFINITION MODULE DATA11;

FROM FIO IMPORT File;

CONST
	DBSize = 400;

TYPE
	TuplePtr    = POINTER TO Tuple;
	DBasePtr    = POINTER TO DBase;

CLASS Tuple;
VIRTUAL PROCEDURE store(VAR t:TuplePtr);
VIRTUAL PROCEDURE less(VAR t:Tuple ):BOOLEAN ;
VIRTUAL PROCEDURE more(VAR t:Tuple ):BOOLEAN ;
VIRTUAL PROCEDURE equal(VAR t:Tuple):BOOLEAN ;
VIRTUAL PROCEDURE read(f:File);
VIRTUAL PROCEDURE write(f:File);
VIRTUAL PROCEDURE load(f:File );
VIRTUAL PROCEDURE save(f:File );
END Tuple;

CLASS DBase;
	no    :INTEGER;
	tuples:ARRAY[1..DBSize] OF TuplePtr;
PROCEDURE clear;
PROCEDURE insert(VAR t:Tuple);
PROCEDURE delete(id:CARDINAL);
PROCEDURE sort;
PROCEDURE before(VAR t:Tuple);
PROCEDURE after(VAR  t:Tuple);
PROCEDURE select(VAR t:Tuple);
PROCEDURE reject(VAR t:Tuple);
PROCEDURE merge(VAR d:DBase);
PROCEDURE load(f:File;VAR t:Tuple);
PROCEDURE save(f:File);
PROCEDURE read(f:File;VAR t:Tuple);
PROCEDURE write(f:File);
END DBase;


END DATA11.