File: /home/oboss/Users/gec/sources/Basic_Services/Control_Structures/timeout_control.ads

1     --% Compilation Unit: Timeout_Control
2     --
3     --% Category: Generic Package Declaration
4     --
5     --% Release:  $Name:  $
6     --
7     --% Version:  $Revision: 1.3 $
8     --
9     --% Author:   $Author: jhl $
10     --
11     --% Revision Log:
12     --    $Log: timeout_control.ads,v $
13     --    Revision 1.3  2003/10/29 13:02:33  jhl
14     --    - Comitted Robustness Assertions Baseline to Main Trunk
15     --    - Added My_Application_ID to Timeout_Control spec
16     --
17     --    Revision 1.2  2003/10/09 11:05:15  jhl
18     --    Added Service 13 And 19
19     --
20     --    Revision 1.1.2.1  2003/10/01 11:54:20  jhl
21     --    Initial version of service 13 Event Action, and 19 Large Data Transfer.
22     --
23     --    Revision 2.0  2003/04/04 10:08:58  gec
24     --    Initial release serving as baseline for OBOSS-III project.
25     --
26     --    Revision 1.1.1.1  2003/04/04 07:19:20  gec
27     --    Imported using TkCVS
28     --
29     --
30     --
31     --% Project: OBOSS
32     --
33     --% Copyright (C) 2003 by Terma A/S
34     --  Proprietary and intellectual rights of Terma A/S, Denmark,
35     --  are involved in the subject-matter of this material and
36     --  all manufacturing, reproduction, use, disclosure, and
37     --  sales rights pertaining to such subject-matter are
38     --  expressly reserved. This material is submitted for a
39     --  specific purpose as agreed, and the recipient by
40     --  accepting this material agrees that this material will
41     --  not be used, copied, or reproduced in whole or in part
42     --  nor its contents revealed in any manner or to any person,
43     --  except to meet the purpose for which it was submitted and
44     --  subject to the terms of the agreement.
45     --
46     --% Target Dependencies:
47     --    None
48     --% Compiler Dependencies:
49     --    None
50     
51     --~-----------------------------------------------------------------------------
52     
53     with Task_Priority_Control;
54     with Mission_Parameters;
55     
56     --With's for absolute time delays
57     with Ada.Real_Time;
58     
59     generic
60     
61        --% Generic Parameter Constraints:
62        -->   None
63     
64        --  Application Process ID of application process to which this
65        --+  service is associated.
66        My_Application_ID : in     Mission_Parameters.APID;
67     
68        -- Timeout time length
69        Timeout_Milliseconds : in     Integer;
70     
71        -- Timeout is called whenever a timeout occurs
72        with procedure Timeout
73              (Abs_Timeout_Time : in     Ada.Real_Time.Time);
74     
75        -- Priority of proteceted object encapsulating the timout control
76        Protected_Timer_Control_Priority
77            : in     Task_Priority_Control.Passive_Task_Priority;
78     
79        -- Priority of the actual timer task for timeout
80        Active_Timer_Priority : in     Task_Priority_Control.Active_Task_Priority;
81     
82     package Timeout_Control is
83     
84        --% Library Package:
85        --    Generic timeout control package
86        --    A timeout is started by the Start procedure, which returns the
87        --+    calculated timeout time.
88        --    A timeout is stopped by the Stop procedure.
89        --    If Start is called while a timeout is running, the running timeout is
90        --+    cancelled and the new timeout is started.
91        --    It should be noted that the actual generic timeout procedure is called
92        --+    by a separate task, i.e. Timeout might be called while
93        --+    executing Start or Stop, depending on the priority of the Timer task.
94        --+    This is to avoid deadlock.
95        --% Active Tasks:
96        -->   The_Timer_Task - Timer task for timeout, the task calling the actual
97        --+    generic Timeout procedure.
98        --% Passive Tasks:
99        -->   The_Timeout_Control - Protected object encapsulating the timout
100        --+    control
101     
102        --% Subprogram:
103        --    Starts the timer for a new timeout event. The calculated next timeout
104        --+    time is returned.
105        --    If the timer is already running, the current timeout is cancelled, and
106        --+    procedure Timeout is NOT called, and the new timeout is started.
107        --    As the <Timeout_Milliseconds> is an actual generic parameter a new
108        --+    timeout time will always be _later_ than a previous timeout time,
109        --+    giving sequential timeout times.
110        --% Parameter Constraints:
111        -->   None
112        --% Exceptions Raised:
113        -->   None
114     
115        procedure Start
116              (Abs_Timeout_Time :    out Ada.Real_Time.Time);
117     
118        --% Subprogram:
119        --    Stops the current timeout.
120        --    If a timeout is running it is stopped, and procedure Timeout is NOT
121        --+    called.
122        --% Parameter Constraints:
123        -->   None
124        --% Exceptions Raised:
125        -->   None
126     
127        procedure Stop;
128     
129     end Timeout_Control;
130     
131     --~-----------------------------------------------------------------------------
132     
133     
134     
135