B Narrators and Listeners

B.1 The Narrator Module

'class'

Narrator.'class'

Methods

init(?PrivateNarratorO)

register(+Port)

newListener(+Port)

unregister(+Port)

tell(X)

B.2 The PrivateNarrator Class

Methods

setLogPhases(+B)

setMaxNumberOfErrors(+I)

tell(X)

startBatch()

startPhase(+V)

startSubPhase(+V)

endBatch(+A)

error(coord: +Coord <= unit 
      kind:  
+KindV <= unit 
      msg:   
+MsgV  <= unit 
      items: 
+Ts    <= unit 
      abort: 
+B     <= true)

warn(coord: +Coord <= unit 
     kind:  
+KindV <= unit 
     msg:   
+MsgV  <= unit 
     items: 
+Ts    <= unit)

hasSeenError(?B)

B.3 The Listener Module

Methods

init(+NarratorO +ServeL)

initializes a listener with a narrator and the label of a unary method. The listener creates a port, registers this with NarratorO, and creates a thread in which the ServeL method is applied to the port's stream.

close()

undoes all effects of the init method: The server thread is terminated and the listener's port is unregistered.

getNarrator(?NarratorO)

returns the narrator with which the listener's port is currently registered.

getPort(?Port)

returns the associated port.

B.4 The ErrorListener Module

Methods

init(+NarratorO +ServeOneL <= unit ?L <= unit)

reset()

setVerbosity(+L)

hasErrors(?B)

isActive(?B)

getVS(?B)

getMessages(?Xs)

formatMessages(+Xs ?V)

B.5 Example


Leif Kornstaedt
Version 1.1.0 (20000207)