File: /home/oboss/Users/gec/sources/PUS_Services/Monitor/parameter_monitoring_definitions.ads
1 --% Compilation Unit: Parameter_Monitoring_Definitions
2 --
3 --% Category: Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 2.0 $
8 --
9 --% Author: $Author: gec $
10 --
11 --% Revision Log:
12 -- $Log: parameter_monitoring_definitions.ads,v $
13 -- Revision 2.0 2003/04/04 08:51:15 gec
14 -- Initial release of source files serving as baseline for OBOSS-III project.
15 --
16 -- Revision 1.1.1.1 2003/04/04 08:13:13 gec
17 -- Imported using TkCVS
18 --
19 --
20 --
21 --% Project: OBOSS
22 --
23 --% Copyright (C) 2003 by Terma A/S
24 -- Proprietary and intellectual rights of Terma A/S, Denmark,
25 -- are involved in the subject-matter of this material and
26 -- all manufacturing, reproduction, use, disclosure, and
27 -- sales rights pertaining to such subject-matter are
28 -- expressly reserved. This material is submitted for a
29 -- specific purpose as agreed, and the recipient by
30 -- accepting this material agrees that this material will
31 -- not be used, copied, or reproduced in whole or in part
32 -- nor its contents revealed in any manner or to any person,
33 -- except to meet the purpose for which it was submitted and
34 -- subject to the terms of the agreement.
35 --
36 --% Target Dependencies:
37 -- None
38 --% Compiler Dependencies:
39 -- None
40
41 --~-----------------------------------------------------------------------------
42
43 with Onboard_Monitoring_Types;
44 package Parameter_Monitoring_Definitions is
45
46 --% Library Package:
47 -- Abstract data type implementing an indexed list of limit check
48 --+ definitions and expected value check definitions.
49 -- INVARIANT: Operations shall never be executed concurrently.
50 --% Active Tasks:
51 --> None
52 --% Passive Tasks:
53 --> None
54
55 -- Insertion of check definition failed as total number of definitions would
56 --+ exceed Max_No_Of_Definitions
57 Max_Number_Of_Definitions_Exceeded : exception;
58
59 -- Given index is out of limits according to the current length of the
60 --+ accessed list of limit check definitions or expected value check
61 --+ definitions
62 Index_Out_Of_Limits : exception;
63
64 subtype Check_Definitions_Index is Positive;
65
66 -- We model lists of check definitions as access to first entry in linked
67 --+ list.
68 type Check_Definitions_List is private;
69
70 type Check_Definitions is private;
71 type Check_Definitions_Heap is private;
72
73 Empty_Check_Definitions : constant Check_Definitions;
74 Empty_Check_Definitions_List : constant Check_Definitions_List;
75
76 --% Subprogram:
77 -- Constructor for heap of check definitions capable of containing
78 --+ Max_Number_Of_Checks check definitions.
79 -- Set of check definitions are initally empty.
80 -- NOTE: This functions uses the heap. SHould only be called during
81 --+ system start-up.
82 --% Parameter Constraints:
83 --> parameter_name - Constraints
84 --% Exceptions Raised:
85 --> exception_name - Conditions
86 function Initialise
87 (Max_Number_Of_Checks : Natural)
88 return Check_Definitions_Heap;
89
90 --% Subprogram:
91 -- Update given check definition to be empty.
92 --% Parameter Constraints:
93 --> None
94 --% Exceptions Raised:
95 --> None
96 procedure Empty_Definitions
97 (Defs : in out Check_Definitions;
98 Defs_Heap : in out Check_Definitions_Heap);
99
100 --% Subprogram:
101 -- Returns first element in List.
102 -- Call has no side-effects.
103 --% Parameter Constraints:
104 --> List - May not equal Empty_Check_Definitions_List
105 --% Exceptions Raised:
106 --> None
107 function Head
108 (List : Check_Definitions_List)
109 return Onboard_Monitoring_Types.Parameter_Monitoring_Definition_Ref;
110
111 --% Subprogram:
112 -- Returns all but first element in List.
113 -- Call has no side-effects.
114 --% Parameter Constraints:
115 --> List - May not equal Empty_Check_Definitions_List
116 --% Exceptions Raised:
117 --> None
118 function Tail
119 (List : Check_Definitions_List)
120 return Check_Definitions_List;
121
122 --% Subprogram:
123 -- Returns number of elements in List.
124 -- Call has no side-effects.
125 --% Parameter Constraints:
126 --> None
127 --% Exceptions Raised:
128 --> None
129 function Length
130 (List : Check_Definitions_List)
131 return Natural;
132
133 --% Subprogram:
134 -- Add Check_Def to list of check definitions.
135 -- Defs is updated as a side effect (although being in parameter).
136 --% Parameter Constraints:
137 --> None
138 --% Exceptions Raised:
139 --> Max_Number_Of_Definitions_Exceeded - Defs_Heap is empty.
140 procedure Insert_Check_Definition
141 (Defs : in out Check_Definitions;
142 Defs_Heap : in out Check_Definitions_Heap;
143 Check_Def
144 : in Onboard_Monitoring_Types.
145 Parameter_Monitoring_Definition);
146
147 --% Subprogram:
148 -- Replace Check_Def for entry at index Position in list of check
149 --+ definitions.
150 -- Defs is updated as a side effect.
151 --% Parameter Constraints:
152 --> None
153 --% Exceptions Raised:
154 --> Index_Out_Of_Limits - Position is not in indices of current list of
155 --+ check definitions.
156 procedure Replace_Check_Definition
157 (Defs : in out Check_Definitions;
158 Position : in Check_Definitions_Index;
159 Check_Def
160 : in Onboard_Monitoring_Types.
161 Parameter_Monitoring_Definition);
162
163 --% Subprogram:
164 -- Delete check definition at index Position in list of check definitions
165 --+ given by Check_Type.
166 -- Defs is updated as a side effect.
167 --% Parameter Constraints:
168 --> None
169 --% Exceptions Raised:
170 --> Index_Out_Of_Limits - Position is not in indices of current list of
171 --+ check definitions.
172 procedure Delete_Check_Definition
173 (Defs : in out Check_Definitions;
174 Defs_Heap : in out Check_Definitions_Heap;
175 Check_Type : in Onboard_Monitoring_Types.Check_Definition_Type;
176 Position : in Check_Definitions_Index);
177
178 --% Subprogram:
179 -- Extract list of check definitions represented by Defs and of type
180 --+ Check_Type.
181 -- NOTE: List structure may NOT!! be updated, but list elements may be
182 --+ updated.
183 --% Parameter Constraints:
184 --> None
185 --% Exceptions Raised:
186 --> None
187 function Get_Check_Definitions
188 (Defs : Check_Definitions;
189 Check_Type : Onboard_Monitoring_Types.Check_Definition_Type)
190 return Check_Definitions_List;
191
192 private
193
194 type Check_Definition_Container;
195
196 type Check_Definitions_List is access Check_Definition_Container;
197
198 type Check_Definition_Container is
199 record
200 Tail : Check_Definitions_List :=
201 null;
202 The_Def
203 : Onboard_Monitoring_Types.Parameter_Monitoring_Definition_Ref
204 := null;
205 end record;
206
207 type Check_Definitions is
208 record
209 Limit_Check_Definitions : Check_Definitions_List;
210 Expected_Value_Check_Definitions : Check_Definitions_List;
211 end record;
212
213 type Check_Definitions_Heap is new Check_Definitions_List;
214
215 Empty_Check_Definitions_List : constant Check_Definitions_List := null;
216
217 Empty_Check_Definitions : constant Check_Definitions :=
218 (Limit_Check_Definitions =>
219 Empty_Check_Definitions_List,
220 Expected_Value_Check_Definitions =>
221 Empty_Check_Definitions_List);
222
223 end Parameter_Monitoring_Definitions;
224
225 --~-----------------------------------------------------------------------------
226