-- Reducer.mesa
-- Last changed by Doug Wyatt, September 1, 1980 9:43 PM
DIRECTORY
Vector USING [Vec],
Pipe USING [Handle];
Reducer: DEFINITIONS = {
Handle: TYPE = LONG POINTER TO Object;
Pairing: TYPE = {nonzero, odd};
NewReducer: PROCEDURE[pairing: Pairing←nonzero] RETURNS[Handle];
Vertex: PROCEDURE[self: Handle, v: Vector.Vec] = INLINE {
self.procs.Vertex[self,@v]
};
NewBoundary: PROCEDURE[self: Handle] = INLINE {
self.procs.NewBoundary[self]
};
Generate: PROCEDURE[self: Handle, pipe: Pipe.Handle] = INLINE {
self.procs.Generate[self,pipe]
};
Free: PROCEDURE[selfPtr: LONG POINTER TO Handle] = INLINE {
IF selfPtr↑#NIL THEN selfPtr↑.procs.Free[selfPtr]
};
Object: PRIVATE TYPE = RECORD [
procs: LONG POINTER TO READONLY Procs,
data: LONG POINTER TO Data
];
Procs: PRIVATE TYPE = RECORD [
Vertex: PROCEDURE[self: Handle, v: POINTER TO Vector.Vec],
NewBoundary: PROCEDURE[self: Handle],
Generate: PROCEDURE[self: Handle, pipe: Pipe.Handle],
Free: PROCEDURE[selfPtr: LONG POINTER TO Handle]
];
Data: PRIVATE TYPE;
ReducerImpl: PROGRAM;
}.