CVS difference for ai05s/ai05-0159-1.txt
--- ai05s/ai05-0159-1.txt 2010/06/13 04:41:19 1.11
+++ ai05s/ai05-0159-1.txt 2010/08/05 05:18:00 1.12
@@ -1,5 +1,12 @@
-!standard A.18.27 10-06-07 AI05-0159-1/08
+!standard A.18.27 10-08-04 AI05-0159-1/09
+!standard A.18.28
+!standard A.18.29
+!standard A.18.30
+!standard A.18.31
+!standard A.18.32
!class Amendment 05-10-24
+!status Amendment 2012 10-08-04
+!status ARG Approved 10-0-0 10-06-18
!status work item 10-04-29
!status ARG Approved 11-0-0 10-02-27
!status work item 06-03-15
@@ -29,7 +36,7 @@
!wording
-A.18.27 Containers.Synchronized_Queue_Interfaces
+A.18.27 The Generic Package Containers.Synchronized_Queue_Interfaces
The language-defined generic package Containers.Synchronized_Queue_Interfaces
provides interface type Queue, and a set of operations for that type.
@@ -50,12 +57,12 @@
procedure Enqueue
(Container : in out Queue;
- New_Item : Element_Type) is abstract;
+ New_Item : in Element_Type) is abstract;
pragma Implemented (Enqueue, By_Entry);
procedure Dequeue
(Container : in out Queue;
- Element : out Element_Type) is abstract;
+ Element : out Element_Type) is abstract;
pragma Implemented (Dequeue, By_Entry);
function Current_Use (Container : Queue) return Count_Type is abstract;
@@ -91,7 +98,7 @@
any one time.
-A.18.28 Containers.Unbounded_Synchronized_Queues
+A.18.28 The Generic Package Containers.Unbounded_Synchronized_Queues
Static Semantics
@@ -111,10 +118,14 @@
new Queue_Interfaces.Queue with
pragma Priority(Ceiling);
- entry Enqueue(New_Item: Queue_Interfaces.Element_Type);
- entry Dequeue(Element: out Queue_Interfaces.Element_Type);
+ overriding
+ entry Enqueue (New_Item: in Queue_Interfaces.Element_Type);
+ overriding
+ entry Dequeue (Element: out Queue_Interfaces.Element_Type);
+ overriding
function Current_Use return Count_Type;
+ overriding
function Peak_Use return Count_Type;
private
@@ -134,7 +145,7 @@
Queue needs finalization, because it is visibly protected.
-A.18.29 Containers.Bounded_Synchronized_Queues
+A.18.29 The Generic Package Containers.Bounded_Synchronized_Queues
Static Semantics
@@ -157,10 +168,14 @@
new Queue_Interfaces.Queue with
pragma Priority(Ceiling);
- entry Enqueue(New_Item: Queue_Interfaces.Element_Type);
- entry Dequeue(Element: out Queue_Interfaces.Element_Type);
+ overriding
+ entry Enqueue (New_Item: in Queue_Interfaces.Element_Type);
+ overriding
+ entry Dequeue (Element: out Queue_Interfaces.Element_Type);
+ overriding
function Current_Use return Count_Type;
+ overriding
function Peak_Use return Count_Type;
private
@@ -186,7 +201,7 @@
allocation.
-A.18.30 Containers.Unbounded_Priority_Queues
+A.18.30 The Generic Package Containers.Unbounded_Priority_Queues
Static Semantics
@@ -212,14 +227,19 @@
new Queue_Interfaces.Queue with
pragma Priority(Ceiling);
- entry Enqueue(New_Item: Queue_Interfaces.Element_Type);
- entry Dequeue(Element: out Queue_Interfaces.Element_Type);
+ overriding
+ entry Enqueue (New_Item: in Queue_Interfaces.Element_Type);
+ overriding
+ entry Dequeue (Element: out Queue_Interfaces.Element_Type);
+ not overriding
entry Dequeue_Only_High_Priority
- (Minimum_Priority : Queue_Priority;
- Element : out Queue_Interfaces.Element_Type);
+ (Low_Priority : in Queue_Priority;
+ Element : out Queue_Interfaces.Element_Type);
+ overriding
function Current_Use return Count_Type;
+ overriding
function Peak_Use return Count_Type;
private
@@ -249,16 +269,16 @@
Dequeue_Only_High_Priority is the same as Dequeue, except that it
blocks until the element E at the head of the queue satisfies
-Before(Get_Priority(E), Minimum_Priority).
+Before(Get_Priority(E), Low_Priority).
The actual functions for Get_Priority and Before are expected to return the
same value each time they are called with the same actuals, and should not
-modify their actuals. Before should define a strict weak ordering relationship
+modify their actuals. Before should define a strict weak ordering relationship
(see A.18). If the actual functions behave in some other manner, the behavior
of Unbounded_Priority_Queues is unspecified.
-A.18.31 Containers.Bounded_Priority_Queues
+A.18.31 The Generic Package Containers.Bounded_Priority_Queues
Static Semantics
@@ -286,14 +306,19 @@
new Queue_Interfaces.Queue with
pragma Priority(Ceiling);
- entry Enqueue(New_Item: Queue_Interfaces.Element_Type);
- entry Dequeue(Element: out Queue_Interfaces.Element_Type);
+ overriding
+ entry Enqueue (New_Item: in Queue_Interfaces.Element_Type);
+ overriding
+ entry Dequeue (Element: out Queue_Interfaces.Element_Type);
+ not overriding
entry Dequeue_Only_High_Priority
- (Minimum_Priority : Queue_Priority;
- Element : out Queue_Interfaces.Element_Type);
+ (Low_Priority : in Queue_Priority;
+ Element : out Queue_Interfaces.Element_Type);
+ overriding
function Current_Use return Count_Type;
+ overriding
function Peak_Use return Count_Type;
private
@@ -322,11 +347,11 @@
There are three generic packages
Containers.Indefinite_Synchronized_Queue_Interfaces,
Containers.Indefinite_Unbounded_Synchronized_Queues, and
-Containers.Indefinite_Unbounded_Priority_Queues. These are identical to
+Containers.Indefinite_Unbounded_Priority_Queues. These are identical to
Containers.Synchronized_Queue_Interfaces,
Containers.Unbounded_Synchronized_Queues, and
-Containers.Unbounded_Priority_Queues, respectively, except that Element_Type is
-indefinite.
+Containers.Unbounded_Priority_Queues, respectively, except except that the
+generic formal Element_Type is indefinite.
!discussion
@@ -445,6 +470,322 @@
begin -- activate tasks
null;
end;
+
+!corrigendum A.18.27
+
+The language-defined generic package Containers.Synchronized_Queue_Interfaces
+provides interface type Queue, and a set of operations for that type.
+Interface Queue specifies a first-in, first-out queue.
+
+@s8<@i<Static Semantics>>
+
+The generic library package Containers.Synchronized_Queue_Interfaces has the
+following declaration:
+
+@xcode<@b<generic>
+ @b<type> Element_Type @b<is private>;
+@b<package> Ada.Containers.Synchronized_Queue_Interfaces @b<is>
+ @b<pragma> Pure(Synchronized_Queue_Interfaces);
+
+ @b<type> Queue @b<is synchronized interface>;
+
+ @b<procedure> Enqueue
+ (Container : @b<in out> Queue;
+ New_Item : @b<in> Element_Type) @b<is abstract>;
+ @b<pragma> Implemented (Enqueue, By_Entry);
+
+ @b<procedure> Dequeue
+ (Container : @b<in out> Queue;
+ Element : @b<out> Element_Type) @b<is abstract>;
+ @b<pragma> Implemented (Dequeue, By_Entry);
+
+ @b<function> Current_Use (Container : Queue) @b<return> Count_Type @b<is abstract>;
+ @b<function> Peak_Use (Container : Queue) @b<return> Count_Type @b<is abstract>;
+
+@b<end> Ada.Containers.Synchronized_Queue_Interfaces;>
+
+@xcode<@b<procedure> Enqueue
+ (Container : @b<in out> Queue;
+ New_Item : @b<in> Element_Type) @b<is abstract>;>
+
+@xindent<A queue type that implements this interface may have a bounded @i<capacity>. If
+the queue object has a bounded capacity, and the number of existing elements
+equals the capacity, then Enqueue blocks until storage becomes available;
+otherwise Enqueue does not block. In any case, it then copies New_Item onto the
+queue.>
+
+@xcode<@b<procedure> Dequeue
+ (Container : @b<in out> Queue;
+ Element : @b<out> Element_Type) @b<is abstract>;>
+
+@xindent<If the queue is empty, then Dequeue blocks until an item becomes
+available. In any case, it then returns a copy of the element at the head of the
+queue, and removes it from the container.>
+
+@xcode<@b<function> Current_Use (Container : Queue) @b<return> Count_Type @b<is abstract>;>
+
+@xindent<Returns the number of elements currently in the queue.>
+
+@xcode<@b<function> Peak_Use (Container : Queue) @b<return> Count_Type @b<is abstract>;>
+
+@xindent<Returns the maximum number of elements that have been in the queue at
+any one time.>
+
+
+!corrigendum A.18.28
+
+@dinsc
+@s8<@i<Static Semantics>>
+
+The language-defined generic package Containers.Unbounded_Synchronized_Queues
+provides type Queue, which implements the interface type
+Containers.Synchronized_Queue_Interfaces.Queue.
+
+@xcode<@b<with> System;
+@b<with> Ada.Containers.Synchronized_Queue_Interfaces;
+@b<generic>
+ @b<with package> Queue_Interfaces @b<is new> Ada.Containers.Synchronized_Queue_Interfaces (<@>);
+ Default_Ceiling: System.Any_Priority := System.Priority'Last;
+@b<package> Ada.Containers.Unbounded_Synchronized_Queues @b<is>
+ @b<pragma> Preelaborate(Unbounded_Synchronized_Queues);
+
+ @b<protected type> Queue (Ceiling: System.Any_Priority := Default_Ceiling) @b<is>
+ @b<new> Queue_Interfaces.Queue @b<with>
+ @b<pragma> Priority(Ceiling);
+
+ @b<overriding>
+ @b<entry> Enqueue (New_Item: @b<in> Queue_Interfaces.Element_Type);
+ @b<overriding>
+ @b<entry> Dequeue (Element: @b<out> Queue_Interfaces.Element_Type);
+
+ @b<overriding>
+ @b<function> Current_Use @b<return> Count_Type;
+ @b<overriding>
+ @b<function> Peak_Use @b<return> Count_Type;
+
+ @b<private>
+ ... -- not specified by the language
+ @b<end> Queue;
+
+@b<private>
+
+ ... -- not specified by the language
+
+@b<end> Ada.Containers.Unbounded_Synchronized_Queues;>
+
+The type Queue is used to represent task-safe queues.
+
+The capacity for instances of type Queue is unbounded.
+
+
+!corrigendum A.18.29
+
+@dinsc
+@s8<@i<Static Semantics>>
+
+The language-defined generic package Containers.Bounded_Synchronized_Queues
+provides type Queue, which implements the interface type
+Containers.Synchronized_Queue_Interfaces.Queue.
+
+@xcode<@b<with> System;
+@b<with> Ada.Containers.Synchronized_Queue_Interfaces;
+@b<generic>
+ @b<with package> Queue_Interfaces @b<is new> Ada.Containers.Synchronized_Queue_Interfaces (<@>);
+ Default_Capacity : Count_Type;
+ Default_Ceiling: System.Any_Priority := System.Priority'Last;
+@b<package> Ada.Containers.Bounded_Synchronized_Queues @b<is>
+ @b<pragma> Preelaborate(Bounded_Synchronized_Queues);
+
+ @b<protected type> Queue
+ (Capacity : Count_Type := Default_Capacity;
+ Ceiling: System.Any_Priority := Default_Ceiling) @b<is>
+ @b<new> Queue_Interfaces.Queue @b<with>
+ @b<pragma> Priority(Ceiling);
+
+ @b<overriding>
+ @b<entry> Enqueue (New_Item: @b<in> Queue_Interfaces.Element_Type);
+ @b<overriding>
+ @b<entry> Dequeue (Element: @b<out> Queue_Interfaces.Element_Type);
+
+ @b<overriding>
+ @b<function> Current_Use @b<return> Count_Type;
+ @b<overriding>
+ @b<function> Peak_Use @b<return> Count_Type;
+
+ @b<private>
+ ... -- not specified by the language
+ @b<end> Queue;
+
+@b<private>
+
+ ... -- not specified by the language
+
+@b<end> Ada.Containers.Bounded_Synchronized_Queues;>
+
+The semantics are the same as for Unbounded_Synchronized_Queues,
+except:
+
+@xbullet<The capacity for instances of type Queue is bounded and specified by
+the discriminant Capacity.>
+
+@s8<@i<Implementation Advice>>
+
+Bounded queue objects should be implemented without implicit pointers or dynamic
+allocation.
+
+
+!corrigendum A.18.30
+
+@dinsc
+@s8<@i<Static Semantics>>
+
+The language-defined generic package Containers.Unbounded_Priority_Queues
+provides type Queue, which implements the interface type
+Containers.Synchronized_Queue_Interfaces.Queue.
+
+@xcode<@b<with> System;
+@b<with> Ada.Containers.Synchronized_Queue_Interfaces;
+@b<generic>
+ @b<with package> Queue_Interfaces @b<is new> Ada.Containers.Synchronized_Queue_Interfaces (<@>);
+ type Queue_Priority is @b<private>;
+ @b<with function> Get_Priority
+ (Element: Queue_Interfaces.Element_Type) @b<return> Queue_Priority is <@>;
+ @b<with> @b<function> Before
+ (Left, Right : Queue_Priority) @b<return> Boolean @b<is> <@>;
+ Default_Ceiling: System.Any_Priority := System.Priority'Last;
+@b<package> Ada.Containers.Unbounded_Priority_Queues @b<is>
+ @b<pragma> Preelaborate(Unbounded_Priority_Queues);
+
+ @b<protected type> Queue
+ (Ceiling: System.Any_Priority := Default_Ceiling) @b<is>
+ @b<new> Queue_Interfaces.Queue @b<with>
+ @b<pragma> Priority(Ceiling);
+
+ @b<overriding>
+ @b<entry> Enqueue (New_Item: @b<in> Queue_Interfaces.Element_Type);
+ @b<overriding>
+ @b<entry> Dequeue (Element: @b<out> Queue_Interfaces.Element_Type);
+
+ @b<not overriding>
+ @b<entry> Dequeue_Only_High_Priority
+ (Low_Priority : @b<in> Queue_Priority;
+ Element : @b<out> Queue_Interfaces.Element_Type);
+
+ @b<overriding>
+ @b<function> Current_Use @b<return> Count_Type;
+ @b<overriding>
+ @b<function> Peak_Use @b<return> Count_Type;
+
+ @b<private>
+ ... -- not specified by the language
+ @b<end> Queue;
+
+@b<private>
+
+ ... -- not specified by the language
+
+@b<end> Ada.Containers.Unbounded_Priority_Queues;>
+
+The type Queue is used to represent task-safe priority queues.
+
+The capacity for instances of type Queue is unbounded.
+
+Two elements @i<E1> and @i<E2> are equivalent if Before(Get_Priority(@i<E1>),
+Get_Priority(@i<E2>)) and Before(Get_Priority(@i<E2>), Get_Priority(@i<E1>))
+both return False.
+
+Enqueue inserts an item according to the order specified by the Before function
+on the result of Get_Priority on the elements. If the queue already contains
+elements equivalent to New_Item, then it is inserted after the existing
+equivalent elements.
+
+Dequeue_Only_High_Priority is the same as Dequeue, except that it
+blocks until the element @i<E> at the head of the queue satisfies
+Before(Get_Priority(@i<E>), Low_Priority).
+
+The actual functions for Get_Priority and Before are expected to return the
+same value each time they are called with the same actuals, and should not
+modify their actuals. Before should define a strict weak ordering relationship
+(see A.18). If the actual functions behave in some other manner, the behavior
+of Unbounded_Priority_Queues is unspecified.
+
+
+!corrigendum A.18.31
+
+@dinsc
+@s8<@i<Static Semantics>>
+
+The language-defined generic package Containers.Bounded_Priority_Queues provides
+type Queue, which implements the interface type
+Containers.Synchronized_Queue_Interfaces.Queue.
+
+@xcode<@b<with> System;
+@b<with> Ada.Containers.Synchronized_Queue_Interfaces;
+generic
+ @b<with package> Queue_Interfaces @b<is new> Ada.Containers.Synchronized_Queue_Interfaces (<@>);
+ type Queue_Priority is @b<private>;
+ @b<with function> Get_Priority
+ (Element: Queue_Interfaces.Element_Type) @b<return> Queue_Priority is <@>;
+ @b<with function> Before
+ (Left, Right : Queue_Priority) @b<return> Boolean is <@>;
+ Default_Capacity : Count_Type;
+ Default_Ceiling: System.Any_Priority := System.Priority'Last;
+@b<package> Ada.Containers.Bounded_Priority_Queues @b<is>
+ @b<pragma> Preelaborate(Bounded_Priority_Queues);
+
+ @b<protected type> Queue
+ (Capacity : Count_Type := Default_Capacity;
+ Ceiling: System.Any_Priority := Default_Ceiling) is
+ new Queue_Interfaces.Queue @b<with>
+ @b<pragma> Priority(Ceiling);
+
+ @b<overriding>
+ @b<entry> Enqueue (New_Item: @b<in> Queue_Interfaces.Element_Type);
+ @b<overriding>
+ @b<entry> Dequeue (Element: @b<out> Queue_Interfaces.Element_Type);
+
+ @b<not overriding>
+ @b<entry> Dequeue_Only_High_Priority
+ (Low_Priority : @b<in> Queue_Priority;
+ Element : @b<out> Queue_Interfaces.Element_Type);
+
+ @b<overriding>
+ @b<function> Current_Use @b<return> Count_Type;
+ @b<overriding>
+ @b<function> Peak_Use @b<return> Count_Type;
+
+ @b<private>
+ ... -- not specified by the language
+ @b<end> Queue;
+
+@b<private>
+
+ ... -- not specified by the language
+
+@b<end> Ada.Containers.Bounded_Priority_Queues;>
+
+The semantics are the same as for Unbounded_Priority_Queues, except:
+
+@xbullet<The capacity for instances of type Queue is bounded and specified by the
+discriminant Capacity.>
+
+@s8<@i<Implementation Advice>>
+
+Bounded priority queue objects should be implemented without implicit
+pointers or dynamic allocation.
+
+!corrigendum A.18.32
+
+@dinsc
+There are three generic packages
+Containers.Indefinite_Synchronized_Queue_Interfaces,
+Containers.Indefinite_Unbounded_Synchronized_Queues, and
+Containers.Indefinite_Unbounded_Priority_Queues. These are identical to
+Containers.Synchronized_Queue_Interfaces,
+Containers.Unbounded_Synchronized_Queues, and
+Containers.Unbounded_Priority_Queues, respectively, except except that the
+generic formal Element_Type is indefinite.
+
!ACATS test
Questions? Ask the ACAA Technical Agent