3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
33 -- This test consists of the following files:
42 -- 06 Dec 94 SAIC ACVC 2.0
43 -- 04 Jun 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
49 pragma Elaborate
(Ada
.Calendar
);
51 package C3900060
is -- Alert system abstraction.
54 -- Declarations used by component Arrival_Time.
56 Default_Time
: constant Ada
.Calendar
.Time
:=
57 Ada
.Calendar
.Time_Of
(1901, 1, 1);
58 Alert_Time
: constant Ada
.Calendar
.Time
:=
59 Ada
.Calendar
.Time_Of
(1991, 6, 15);
62 -- Declarations used by component Display_On and procedure Display.
64 type Device_Enum
is (Null_Device
, Teletype
, Console
, Big_Screen
);
65 type Display_Counters
is array (Device_Enum
) of Natural;
67 Display_Count_For
: Display_Counters
:= (others => 0);
71 type Alert_Type
is tagged private; -- Root tagged type.
73 procedure Set_Display
(A
: in out Alert_Type
; -- To be inherited by
74 D
: in Device_Enum
); -- all derivatives.
76 procedure Display
(A
: in Alert_Type
); -- To be inherited by
79 procedure Handle
(A
: in out Alert_Type
); -- To be overridden by
83 -- The following functions are needed to verify the values of the
84 -- root tagged type's private components.
86 function Get_Time
(A
: Alert_Type
) return Ada
.Calendar
.Time
;
88 function Get_Display
(A
: Alert_Type
) return Device_Enum
;
90 function Initial_Values_Okay
(A
: in Alert_Type
)
93 function Bad_Final_Values
(A
: in Alert_Type
)
98 type Alert_Type
is tagged record -- Root tagged type.
99 Arrival_Time
: Ada
.Calendar
.Time
:= Default_Time
;
100 Display_On
: Device_Enum
:= Null_Device
;
107 --==================================================================--
110 package body C3900060
is
113 procedure Set_Display
(A
: in out Alert_Type
;
114 D
: in Device_Enum
) is
120 procedure Display
(A
: in Alert_Type
) is
122 Display_Count_For
(A
.Display_On
) := Display_Count_For
(A
.Display_On
) + 1;
126 procedure Handle
(A
: in out Alert_Type
) is
128 A
.Arrival_Time
:= Alert_Time
;
133 function Get_Time
(A
: Alert_Type
) return Ada
.Calendar
.Time
is
135 return A
.Arrival_Time
;
139 function Get_Display
(A
: Alert_Type
) return Device_Enum
is
145 function Initial_Values_Okay
(A
: in Alert_Type
) return Boolean is
147 return (A
= (Arrival_Time
=> Default_Time
, -- Check "=" operator
148 Display_On
=> Null_Device
)); -- availability.
149 end Initial_Values_Okay
; -- Aggregate with
150 -- named associations.
152 function Bad_Final_Values
(A
: in Alert_Type
) return Boolean is
154 return (A
/= (Alert_Time
, Null_Device
)); -- Check "/=" operator
156 end Bad_Final_Values
; -- Aggregate with