-- $Source: /commtar/monoBANK/CICS_INTF/trace.ada,v $ -- $Revision: 1.1 $ $Date: 88/03/17 15:40:51 $ $Author: chris $ ---------------------- package Trace_task_pkg ---------------------- is subtype Mark_type is string(1..2); task type Trace_task is entry Init; entry Mark(S:Mark_type); entry Get(From_first:integer :=0; S: out Mark_type); entry Stop; end; end; --------------------------- package body Trace_task_pkg --------------------------- is task body Trace_task is Blank_it : Mark_type := (others=> ' '); Trace_array : array (integer range 0..10) of Mark_type; Index : Integer; Still_testing : boolean := true; begin while Still_testing loop select accept Init do Index := 0; for i in Trace_array'first..Trace_array'last loop Trace_array(i) := Blank_it; end loop; end Init; or accept Mark(S:Mark_type) do Index := Index + 1; Trace_array(Index) := S; end Mark; or accept Get(From_first:integer := 0; S: out Mark_type) do S := Trace_array(From_first); end Get; or accept Stop do Still_testing := false; end Stop; or terminate; end select; end loop; end Trace_task; end Trace_task_pkg; with Trace_task_pkg; Use Trace_task_pkg; ------------- package Trace ------------- is procedure Init; procedure Mark(S:Mark_type); function Get(From_first:integer :=0) return Mark_type; procedure Stop; end; ------------------ package body Trace ------------------ is type Access_trace_task is access Trace_task; The_tracer : Access_trace_task ; -------------- procedure Init -------------- is begin The_tracer := new Trace_task; The_tracer.Init; end; ------------------------------ procedure Mark(S:Mark_type) ------------------------------ is begin The_tracer.Mark(S); end; ------------------------------------ function Get(From_first:integer :=0) ------------------------------------ return Mark_type is S:Mark_type; begin The_tracer.Get(From_first, S); return S; end; -------------- procedure Stop -------------- is begin The_tracer.Stop; end; end Trace;