NiceImpl.mesa
Last Edited by: Swinehart, December 15, 1983 10:31 am
DIRECTORY
Atom, IO, LarkControl, Log, Nice, -- PrettyPrinTV, PrinTV, -- Rope, RPCPkt, PrincOpsUtils, VBag, ViewRec, ViewerClasses;
NiceImpl:
CEDAR
PROGRAM
IMPORTS Atom, LarkControl, Log, PrincOpsUtils, -- PrinTV, PrettyPrinTV,-- VBag, ViewRec
SHARES VBag = {
BeNiceDo:
PROC[r:
REF, d:
INT, how:
ATOM←$System, howD:
REF←
NIL] =
TRUSTED {
Log.Report["Sorry, PrettyPrintTV stuff not available", how, howD];
out: IO.STREAM ← Log.FindWhere[how, howD];
put: PrinTV.PutClosure ← PrettyPrinTV.StreamToPrettyPutClosure[out, 60];
PrinTV.Print[
tv: AMBridge.TVForReferent[r], put: put, depth: d, maxLength: 32, verbose: FALSE];
PrettyPrinTV.Flush[put];
};
ViewDo:
PROC[r:
REF, name: Rope.
ROPE] =
TRUSTED {
IF ~PrincOpsUtils.IsBound[VBag.Start] THEN RETURN;
IF recTable=NIL THEN recTable←VBag.Create["Program Management Variables"];
[]←VBag.Start[recTable, r, name];
};
LarkConLogStreamDo:
PROC[machine: RPCPkt.Machine]
RETURNS [log:
IO.
STREAM] =
TRUSTED {
RETURN[
IF PrincOpsUtils.IsBound[LarkControl.GetLogStream]
THEN
LarkControl.GetLogStream[machine] ELSE NIL];
};
recTable: ViewerClasses.Viewer←NIL;
Atom.PutProp[$IRNice, $BeNice, NEW[Nice.BeNiceProcNiceDo]];
Atom.PutProp[$IRNice, $LarkConLogStream, NEW[Nice.LarkConLogStreamProc←LarkConLogStreamDo]];
Atom.PutProp[$IRNice, $View, NEW[Nice.ViewProc←ViewDo]];
TRUSTED {
IF PrincOpsUtils.IsBound[ViewRec.SetBehavior]
THEN ViewRec.SetBehavior[newBehavior: [delayParms: [min: 1000]]];
-- Reduce sampling load
};
}.