********************************************************************
* NOTE: This file is generated automatically from the event * definition file Hash.evt. ********************************************************************<* PRAGMA LL *> MODULEevent handling methods:; <*NOWARN*> IMPORT HashViewClass, TextPort, Rd, IntList, ZeusClass; <*NOWARN*> IMPORT Filter, TextEditVBT, Fmt, HashFmt, ZFmt, Wr; <*NOWARN*> IMPORT ZeusPanel, FormsVBT, VBT, View; <* FATAL FormsVBT.Error, FormsVBT.Unimplemented *> REVEAL T = Public BRANDED OBJECT fv: FormsVBT.T := NIL; te: TextEditVBT.T := NIL; OVERRIDES init := TViewInit; install := TViewInstall; delete := TViewDelete; snapshot := TViewSnapshot; restore := TViewRestore; config := TViewConfig; reactivity := TViewReactivity; startrun := TViewStartrun; endrun := TViewEndrun; oeSetup := Setup; oeInsert := Insert; oeFind := Find; oeDelete := Delete; oeCompare := Compare; oeCheckDeletable := CheckDeletable; oeCheckHashPosition := CheckHashPosition; oeAddToBucket := AddToBucket; oeDeleteFromBucket := DeleteFromBucket; ueFindReport := FindReport; ueStopFindReport := StopFindReport; END; PROCEDURE HashTranscriptView TViewInit (view: T): T = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "init"); RETURN HashViewClass.T.init (view, NIL); END TViewInit; PROCEDUREClear (<* UNUSED *> fv : FormsVBT.T; <* UNUSED *> name: TEXT; cl : REFANY; <* UNUSED *> time: VBT.TimeStamp) = BEGIN TextPort.SetText(NARROW(cl, T).te.tp, "") END Clear; PROCEDURETViewInstall (view: T) = <* LL = VBT.mu *> BEGIN view.fv := ZeusPanel.NewForm("HashTranscriptView.fv"); view.te := FormsVBT.GetVBT(view.fv, "transcript"); TViewZTrace (view, "install"); FormsVBT.AttachProc(view.fv, "clear", Clear, view); EVAL Filter.Replace (view, view.fv); HashViewClass.T.install (view); END TViewInstall; PROCEDURETViewDelete (view: T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "delete"); HashViewClass.T.delete (view); END TViewDelete; PROCEDURETViewSnapshot (view: T; wr: Wr.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "snapshot"); HashViewClass.T.snapshot (view, wr); END TViewSnapshot; PROCEDURETViewRestore (view: T; rd: Rd.T) RAISES {ZeusClass.Error} = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "restore"); HashViewClass.T.restore (view, rd); END TViewRestore; PROCEDURETViewConfig ( view: T; state: ZeusClass.StateChange; o: ZeusClass.T) = <* LL = VBT.mu *> BEGIN TViewZTrace (view, "config"); HashViewClass.T.config (view, state, o); END TViewConfig; PROCEDURETViewReactivity (view: T; <*UNUSED*> on: BOOLEAN) = <* LL = VBT.mu *> BEGIN TViewZTrace(view, "reactivity"); HashViewClass.T.reactivity (view, TRUE); END TViewReactivity; PROCEDURETViewStartrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "startrun"); HashViewClass.T.startrun (view); END TViewStartrun; PROCEDURETViewEndrun (view: T) = <* LL = {} *> BEGIN TViewZTrace (view, "endrun"); HashViewClass.T.endrun (view); END TViewEndrun;PROCEDURESetup (view: T; data: FormsVBT.T; nBuckets: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Setup ...") ELSE TViewTrace (view, "Setup " & HashFmt.FormsVBT(data) & " " & Fmt.Int(nBuckets) ) END END END END Setup; PROCEDUREInsert (view: T; key: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Insert ...") ELSE TViewTrace (view, "Insert " & (key) ) END END END END Insert; PROCEDUREFind (view: T; key: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Find ...") ELSE TViewTrace (view, "Find " & (key) ) END END END END Find; PROCEDUREDelete (view: T; key: TEXT) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Delete ...") ELSE TViewTrace (view, "Delete " & (key) ) END END END END Delete; PROCEDURECompare (view: T; bucket: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "Compare ...") ELSE TViewTrace (view, "Compare " & Fmt.Int(bucket) ) END END END END Compare; PROCEDURECheckDeletable (view: T; bucket: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "CheckDeletable ...") ELSE TViewTrace (view, "CheckDeletable " & Fmt.Int(bucket) ) END END END END CheckDeletable; PROCEDURECheckHashPosition (view: T; bucket: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "CheckHashPosition ...") ELSE TViewTrace (view, "CheckHashPosition " & Fmt.Int(bucket) ) END END END END CheckHashPosition; PROCEDUREAddToBucket (view: T; key: TEXT; bucket: INTEGER) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "AddToBucket ...") ELSE TViewTrace (view, "AddToBucket " & (key) & " " & Fmt.Int(bucket) ) END END END END AddToBucket; PROCEDUREDeleteFromBucket (view: T; key: TEXT; bucket: INTEGER; markEmpty: BOOLEAN) = <* LL = {} *> BEGIN LOCK VBT.mu DO IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "DeleteFromBucket ...") ELSE TViewTrace (view, "DeleteFromBucket " & (key) & " " & Fmt.Int(bucket) & " " & Fmt.Bool(markEmpty) ) END END END END DeleteFromBucket; PROCEDUREFindReport (view: T; buckets: IntList.T) = <* LL = VBT.mu *> BEGIN IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "FindReport ...") ELSE TViewTrace (view, "FindReport " & HashFmt.IntList(buckets) ) END END END FindReport; PROCEDUREStopFindReport (view: T; ) = <* LL = VBT.mu *> BEGIN IF FormsVBT.GetBoolean(view.fv, "alg") THEN IF NOT FormsVBT.GetBoolean(view.fv, "args") THEN TViewTrace (view, "StopFindReport ...") ELSE TViewTrace (view, "StopFindReport " ) END END END StopFindReport; PROCEDURETViewZTrace (view: T; t: TEXT) = BEGIN IF view.fv # NIL THEN IF FormsVBT.GetBoolean(view.fv, "zeus") THEN TextPort.PutText(view.te.tp, "**zeus: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END END END TViewZTrace; PROCEDURETViewTrace (view: T; t: TEXT) = BEGIN TextPort.PutText(view.te.tp, "--event: " & t & "\n"); TextPort.Normalize(view.te.tp, LAST(INTEGER)) END TViewTrace; PROCEDURETViewNew (): View.T = BEGIN RETURN NEW(T).init() END TViewNew; BEGIN ZeusPanel.RegisterView (TViewNew, "Hash Transcript View", "Hash"); END HashTranscriptView.