File: /home/oboss/Users/gec/sources/Basic_Services/Containers/passive_queue.ads
1 --% Compilation Unit: Passive_Queue
2 --
3 --% Category: Generic Package Declaration
4 --
5 --% Release: $Name: $
6 --
7 --% Version: $Revision: 2.1 $
8 --
9 --% Author: $Author: jhl $
10 --
11 --% Revision Log:
12 -- $Log: passive_queue.ads,v $
13 -- Revision 2.1 2003/10/09 11:05:15 jhl
14 -- Added Service 13 And 19
15 --
16 -- Revision 2.0.4.2 2003/10/03 10:11:49 jhl
17 -- Large Data Transfer post review updates
18 --
19 -- Revision 2.0.4.1 2003/10/01 11:54:19 jhl
20 -- Initial version of service 13 Event Action, and 19 Large Data Transfer.
21 --
22 -- Revision 2.0 2003/04/04 08:49:57 gec
23 -- Initial release of source files serving as baseline for OBOSS-III project.
24 --
25 -- Revision 1.1.1.1 2003/04/04 08:13:00 gec
26 -- Imported using TkCVS
27 --
28 --
29 --
30 --% Project: OBOSS
31 --
32 --% Copyright (C) 2003 by Terma A/S
33 -- Proprietary and intellectual rights of Terma A/S, Denmark,
34 -- are involved in the subject-matter of this material and
35 -- all manufacturing, reproduction, use, disclosure, and
36 -- sales rights pertaining to such subject-matter are
37 -- expressly reserved. This material is submitted for a
38 -- specific purpose as agreed, and the recipient by
39 -- accepting this material agrees that this material will
40 -- not be used, copied, or reproduced in whole or in part
41 -- nor its contents revealed in any manner or to any person,
42 -- except to meet the purpose for which it was submitted and
43 -- subject to the terms of the agreement.
44 --
45 --% Target Dependencies:
46 -- None
47 --% Compiler Dependencies:
48 -- None
49
50 --~-----------------------------------------------------------------------------
51
52 generic
53
54 --% Generic Parameter Constraints:
55 --> None
56
57 -- Element type stored in queue
58 type Element_Type is private;
59
60 -- Size of queue
61 -- Size 0 is possible.
62 Queue_Size : in Natural;
63
64 package Passive_Queue is
65
66 --% Library Package:
67 -- Management of a queue of Element_Type values. The queue implements a
68 --+ passive HRT-HOOD object.
69 --% Active Tasks:
70 --> None
71 --% Passive Tasks:
72 --> None
73
74 -- Raised iff an extract operation is requuested on an empty queue.
75 Extract_From_Empty_Queue : exception;
76
77 --% Subprogram:
78 -- Add an element to the queue and report on the success or failure. When
79 --+ the number of elements in the queue equals Queue_Size, calls to
80 --+ Deposit return False and the element will not be inserted in the
81 --+ queue; if the insertion is successful True is returned.
82 --% Parameter Constraints:
83 --> None
84 --% Exceptions Raised:
85 --> None
86
87 function Deposit
88 (Element : in Element_Type)
89 return Boolean;
90
91
92 --% Subprogram:
93 -- Extract the first element from the queue.
94 -- Precondition: Queue must not be empty. If this is violated, then the
95 --+ exception Extract_From_Empty_Queue is raised.
96 --% Parameter Constraints:
97 --> None
98 --% Exceptions Raised:
99 --> Extract_From_Empty_Queue - Raised iff Queue_Is_Empty() = True.
100
101 function Extract
102 return Element_Type;
103
104 --% Subprogram:
105 -- Predicate being true iff the queue is empty.
106 --% Parameter Constraints:
107 --> None
108 --% Exceptions Raised:
109 --> None
110
111 function Queue_Is_Empty
112 return Boolean;
113
114 end Passive_Queue;
115
116 --~-----------------------------------------------------------------------------
117