********************************************************************
* NOTE: This file is generated automatically from the event * definition file ZPaper.evt. ********************************************************************<* PRAGMA LL *> MODULE; <*NOWARN*> IMPORT ZPaperViewClass, ZeusClass, Zeus, Algorithm; <*NOWARN*> IMPORT ZPaperAlgClass, View, Thread, AlgorithmClass; <* FATAL Zeus.Error, Zeus.Locked *> ZPaperIE If you get either of these errors, contact a Zeus implementor.TYPE InitArgs = BRANDED REF RECORD N: INTEGER; k: INTEGER; END; SetArgs = BRANDED REF RECORD x: INTEGER; y: INTEGER; val: INTEGER; END;Zeus calls the following to invoke vbt v's event handler:<*NOWARN*> PROCEDUREOEDispatcher (v: ZeusClass.T; evt: REFANY) RAISES {Thread.Alerted} = <* LL <= VBT.mu *> (* LL = {} if event style is output, LL = VBT.mu if event style is update. *) BEGIN TYPECASE v OF | ZPaperViewClass.T (view) => <*NOWARN*> TYPECASE evt OF | InitArgs(varInitArgs) => <*NOWARN*> view.oeInit ( varInitArgs.N , varInitArgs.k ) | SetArgs(varSetArgs) => <*NOWARN*> view.oeSet ( varSetArgs.x , varSetArgs.y , varSetArgs.val ) ELSE <* ASSERT FALSE *> END; ELSE (* this view isn't a ZPaperViewClass, so just ignore *) END END OEDispatcher; <*NOWARN*> PROCEDUREFEDispatcher (v: ZeusClass.T; evt: REFANY) = <* LL = VBT.mu *> BEGIN TYPECASE v OF | ZPaperAlgClass.T (alg) => <*NOWARN*> TYPECASE evt OF ELSE <* ASSERT FALSE *> END; ELSE (* this alg isn't a ZPaperAlgClass, so just ignore *) END END FEDispatcher; PROCEDUREInit ( initiator: Algorithm.T; N, k: INTEGER ) RAISES {Thread.Alerted} = <* LL = {} *> VAR zumeArgRec := NEW(InitArgs , N := N , k := k ); alg := NARROW(initiator, ZPaperAlgClass.T); BEGIN LOCK alg.evtMu DO INC(alg.eventDataRec.ctOfInit); alg.stopAtEvent := alg.eventDataRec.stopAtInit; alg.waitAtEvent := alg.eventDataRec.waitAtInit; Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1, "Init", OEDispatcher, zumeArgRec); END; END Init; PROCEDURESet ( initiator: Algorithm.T; x, y, val: INTEGER ) RAISES {Thread.Alerted} = <* LL = {} *> VAR zumeArgRec := NEW(SetArgs , x := x , y := y , val := val ); alg := NARROW(initiator, ZPaperAlgClass.T); BEGIN LOCK alg.evtMu DO INC(alg.eventDataRec.ctOfSet); alg.stopAtEvent := alg.eventDataRec.stopAtSet; alg.waitAtEvent := alg.eventDataRec.waitAtSet; Zeus.Dispatch(initiator, Zeus.EventStyle.Output, 1, "Set", OEDispatcher, zumeArgRec); END; END Set; BEGIN END ZPaperIE.