TiogaBasicClass.mesa; Written by Scott McGregor. May 1983
Edited by McGregor. August 10, 1983 4:34 pm
DIRECTORY
TiogaNode;
TiogaBasicClass: CEDAR DEFINITIONS = BEGIN OPEN TiogaNode;
Basic Classes
invalidBasicID: BasicClassID = LAST[BasicClassID];
BasicClass: TYPE = REF BasicClassRec;
BasicClassRec: TYPE = RECORD [
get: BasicGetProc ← NIL,
Fetch the contents of a basic node.
set: BasicSetProc ← NIL,
Set new contents for a basic node.
copy: BasicCopyProc ← NIL,
Copy the relevent data from one basic node to another.
init: BasicInitProc ← NIL,
Called forst thing on node creation.
destroy: BasicDestroyProc ← NIL,
Notification to the implementor that the basic node is being removed from the document tree.
flavor: BasicFlavor ← NIL,
Each basic node class has a unique name to distinguish it from other implementations.
privateOps: REF ANYNIL
Implementor private class operations and data
];
BasicFlavor: TYPE = ATOM ;
Basic: TYPE = RefBasicNode ;
BasicInitProc: TYPE = PROC [self: Basic] ;
BasicDestroyProc: TYPE = PROC [self: Basic] ;
BasicCopyProc: TYPE = PROC [self, new: Basic] ;
BasicSetProc: TYPE = PROC [self: Basic, op: ATOMNIL, data: REF ANY, finalise: BOOLTRUE] ;
If op=$Restore then data is a Rope.ROPE obtained from a previous call on self.get and stored out on disk.
BasicGetProc: TYPE = PROC [self: Basic, op: ATOMNIL] RETURNS [data: REF ANY] ;
If op=$Save then data returned should be a Rope.ROPE representation of the basic's private data in a form suitable for saving on disk and passing to a basic.set with op=$Restore.
See TiogaNodeOps for registration of Basic Classes
END.