lace_0.1.0_347e4627/source/events/utility/lace-event-utility.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
with
     lace.Observer,
     lace.Subject,
     lace.Response,
     lace.Event.Logger,

     ada.Tags;


package lace.Event.utility
--
--  Provides convenience subprograms for working with events.
--
is
   --------------
   -- Event Kinds
   --

   function Name_of (Kind : in Event.Kind)   return String;

   function to_Kind (From : in ada.Tags.Tag) return Event.Kind;
   function "+"     (From : in ada.Tags.Tag) return Event.Kind
                     renames to_Kind;

   ---------
   -- Events
   --

   function Name_of (the_Event : in Event.item'Class) return String;
   function Kind_of (the_Event : in Event.item'Class) return Event.Kind;


   --------------
   -- Connections
   --

   procedure connect    (the_Observer  : in Observer.view;
                         to_Subject    : in Subject .view;
                         with_Response : in Response.view;
                         to_Event_Kind : in Event.Kind);

   procedure disconnect (the_Observer  : in Observer.view;
                         from_Subject  : in Subject .view;
                         for_Response  : in Response.view;
                         to_Event_Kind : in Event.Kind;
                         subject_Name  : in String);

   ----------
   -- Logging
   --

   procedure use_text_Logger (log_Filename : in String);
   --
   --  Requests activation of the default text file logger.


   function Logger return lace.Event.Logger.view;
   --
   --  Returns the Logger currently in use.
   --  Returns null, if no Logger is in use.


   --------------
   -- Termination
   --

   procedure close;
   --
   --  Ensures any registered event logger is destroyed.

end lace.Event.utility;