DIRECTORY Rope, TiogaNode; TiogaBranchClass: CEDAR DEFINITIONS = BEGIN BranchClass: TYPE = REF BranchClassRec; defaultBranchClass: BranchClass; -- default flavor = $Branch branchContentsAtom, branchChildrenAtom: ATOM; BranchClassRec: TYPE = RECORD [ setContents: BranchSetContentsProc _ NIL, getContents: BranchGetContentsProc _ NIL, setChildren: BranchSetChildrenProc _ NIL, getChildren: BranchGetChildrenProc _ NIL, flavor: BranchFlavor _ NIL, privateData: REF ANY _ NIL, privateOps: REF ANY _ NIL ]; BranchFlavor: TYPE = ATOM; RefBranchNode: TYPE = TiogaNode.RefBranchNode; RefItemNode: TYPE = TiogaNode.RefItemNode; ROPE: TYPE = Rope.ROPE; BranchSetContentsProc: TYPE = PROC [ br: RefBranchNode, specsRope: ROPE, start, len: INT, insert: InsertContentsProc]; InsertContentsProc: TYPE = PROC [item: RefItemNode, previous: RefItemNode _ NIL]; BranchSetChildrenProc: TYPE = PROC [ br: RefBranchNode, specsRope: ROPE, start, len: INT, insert: InsertChildrenProc]; InsertChildrenProc: TYPE = PROC [child: RefBranchNode, previous: RefBranchNode _ NIL]; BranchGetContentsProc: TYPE = PROC [br: RefBranchNode] RETURNS [specs: ROPE]; BranchGetChildrenProc: TYPE = PROC [br: RefBranchNode] RETURNS [specs: ROPE]; Lookup: PROC [flavor: BranchFlavor] RETURNS [BranchClass]; AlreadyRegistered: SIGNAL; -- raised by Register if class with same name already exists. Register: PROC [classRec: BranchClassRec] RETURNS [BranchClass]; END. rTiogaBranchClass.mesa; Written by Paxton. August 1983 Edited by Paxton. August 26, 1983 1:29 pm Branch Classes Called when creating internal representation for branch. If leave this NIL, system will process the contents in the usual manner. Called when creating external representation for branch. If leave this NIL, system will save the contents in the usual manner. Called when creating internal representation for branch. If leave this NIL, system will process the children in the usual manner. Called when creating external representation for branch. If leave this NIL, system will save the children in the usual manner. Each branch class has a unique name to distinguish it from other implementations. Implementor private class operations and data start and len indicate where in the specsRope the information is actually stored. These parameters are included so that the file reader doesn't have to create a rope substring just to pass the specs to the set proc. Implementor calls the insert proc for each of the contents item nodes. If you can pass the previous item, the insert will run faster. If previous is nil, the insert proc will simply set it to last contents of the branch. Implementor typically will not use the branch arg to the set proc. start and len indicate where in the specsRope the information is actually stored. These parameters are included so that the file reader doesn't have to create a rope substring just to pass the specs to the set proc. Implementor calls the insert proc for each of the children branch nodes. If you can pass the previous child, the insert will run faster. If previous is nil, the insert proc will simply set it to last child of the branch. Implementor typically will not use the branch arg to the set proc. The specs will be written on the file instead of the usual representation for the contents. If returns NIL specs, contents will be saved in standard manner. The specs will be written on the file instead of the usual representation for the children. If returns NIL specs, contents will be saved in standard manner. if you continue, it will simply overwrite the old class definition. ΚŠ˜Jšœ5™5Jšœ)™)J˜šΟk ˜ Iproc˜Kšœ ˜ J˜—Jšœœ œ˜+J˜™K˜Kšœ œœ˜'Kšœ!Οc˜