DIRECTORY Feedback, FeedbackTypes, IO, Rope, SimpleFeedback; FeedbackClasses: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; MsgType: TYPE = SimpleFeedback.MsgType; MsgClass: TYPE = SimpleFeedback.MsgClass; MsgRouter: TYPE = REF MsgRouterObj; MsgRouterObj: TYPE = FeedbackTypes.MsgRouterObj; MsgHandler: TYPE ~ REF MsgHandlerObj; MsgHandlerObj: TYPE ~ Feedback.MsgHandlerObj; CreateHandler: PROC [ PutF: PROC [mh: MsgHandler, msgType: MsgType, msgClass: MsgClass, format: ROPE, v1, v2, v3, v4, v5: IO.Value _ [null[]] ], ClearHerald: PROC [mh: MsgHandler, msgClass: MsgClass], Blink: PROC [mh: MsgHandler, msgClass: MsgClass], data: REF ANY _ NIL] RETURNS [MsgHandler]; GetHandlerData: PROC [MsgHandler] RETURNS [REF ANY]; doNothing: READONLY MsgHandler; CreateHandlerOnRouter: PROC [MsgRouter] RETURNS [MsgHandler]; IsHandlerOnRouter: PROC [MsgHandler] RETURNS [is: BOOL, router: MsgRouter]; CreateSplittingHandler: PROC [h1, h2: MsgHandler] RETURNS [MsgHandler]; IsSplittingHandler: PROC [MsgHandler] RETURNS [is: BOOL, h1, h2: MsgHandler]; CreateHandlerOnStream: PROC [to: IO.STREAM, nlAsap: BOOL, Blink: PROC [IO.STREAM, MsgClass] _ NIL] RETURNS [MsgHandler]; SendAsciiBell: PROC [IO.STREAM, MsgClass]; IsHandlerOnStream: PROC [MsgHandler] RETURNS [is: BOOL, to: IO.STREAM, nlAsap: BOOL, Blink: PROC [IO.STREAM, MsgClass]]; CreateStoringHandler: PROC [buffsize: INT _ INT.LAST] RETURNS [MsgHandler]; IsStoringHandler: PROC [MsgHandler] RETURNS [is: BOOL, buffsize: INT]; GetStore: PROC [from: MsgHandler] RETURNS [msgs: LIST OF ROPE, lastIsComplete: BOOL]; PlayStore: PROC [from, to: MsgHandler, withClass: MsgClass, thenClear: BOOL]; handleByProblem: READONLY MsgHandler; CreateStreamOnRouter: PROC [msgRouter: MsgRouter, msgClass: MsgClass] RETURNS [IO.STREAM]; IsStreamOnRouter: PROC [IO.STREAM] RETURNS [is: BOOL, msgRouter: MsgRouter, msgClass: MsgClass]; END. >FeedbackClasses.mesa Copyright Σ 1986, 1990 by Xerox Corporation. All rights reserved. Bier, August 23, 1989 7:06:25 pm PDT Pier, October 23, 1987 3:20:56 pm PDT Last tweaked by Mike Spreitzer on May 3, 1990 7:20:21 am PDT Contents: Various kinds of MsgHandlers, and connectivity between MsgRouter, MsgHandler, and IO.STREAM. This is a general-purpose facility that most clients will not need to use, because they can usually get what they need from the specific kinds of handlers provided below and in other interfaces. The class procs usually have no need for the MsgClass, but it's there for completeness. The class procs can get that data by calling the following: All its operations are no-ops. Operations on the handler are implemented by operations on the router. Reveals whether the given handler is the result of CreateHandlerOnRouter. Each operation on the result is implemented by that operation on each of the arguments. Reveals whether the given handler is a splitter. If nlAsap, a newline is output as soon as an end or oneLiner is output; otherwise, the newline is delayed until the next line begins to be output. If Blink=NIL, then this handler's Blink is a no-op. This handler's ClearHerald is a no-op. A plausible Blink proc. Creates a handler that simply stores its messages (forgetting msgClass), up to a given number of characters, after which it simply discards output. ClearHerald and Blink are no-ops. from is a storing handler. Please don't side-effect result. lastIsComplete=typeBreaksAt[latest msgType].end when msgs#NIL. from is a storing handler. All past messages are played. Messages are played with the given class. Raises Problem with each output string; ClearHerald and Blink are no-ops. Linebreaks sent to this stream become message boundaries. Except that %-Value pairs are sent through uninterpreted. Κb˜code™KšœB™BK™$K™%K™<—K˜KšΟnœ^™fK™KšΟk œžœ˜—K˜š œžœ8žœ˜MKšŸœ`™d—K˜šœžœ ˜%K™I—K˜š œžœ,žœžœžœ˜ZK™t—K˜Kš œžœžœžœžœžœ,˜`K˜Kšžœ˜K˜—…—h