summaryrefslogtreecommitdiff
path: root/gcc/ada/a-convec.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 13:54:02 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 13:54:02 +0000
commit2c3d0a6d737c0b55769f8e2169bc210b85575f72 (patch)
tree129bc8844811a17598b415668a54b3f7b4c278d7 /gcc/ada/a-convec.ads
parent2223c320c98d0169cd39be0b8842e53b93656706 (diff)
downloadgcc-2c3d0a6d737c0b55769f8e2169bc210b85575f72.tar.gz
2005-11-14 Matthew Heaney <heaney@adacore.com>
* a-crbtgo.ads, a-crbtgo.adb, a-coorse.ads, a-coorse.adb, a-convec.ads, a-convec.adb, a-coinve.ads, a-coinve.adb, a-cohama.ads, a-cohama.adb, a-ciorse.ads, a-ciorse.adb, a-cihama.ads, a-cihama.adb, a-cidlli.ads, a-cidlli.adb, a-cdlili.ads, a-cdlili.adb, a-coormu.adb, a-ciormu.adb, a-cihase.adb, a-cihase.ads, a-cohase.adb, a-cohase.ads, a-ciorma.ads, a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-ciorma.adb, a-coorma.adb: Compiles against the spec for ordered maps described in sections A.18.6 of the most recent (August 2005) AI-302 draft. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106962 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-convec.ads')
-rw-r--r--gcc/ada/a-convec.ads107
1 files changed, 66 insertions, 41 deletions
diff --git a/gcc/ada/a-convec.ads b/gcc/ada/a-convec.ads
index 9b5c9bb82cf..5b268b5e3f0 100644
--- a/gcc/ada/a-convec.ads
+++ b/gcc/ada/a-convec.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2005, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -50,8 +50,6 @@ package Ada.Containers.Vectors is
No_Index : constant Extended_Index := Extended_Index'First;
- subtype Index_Subtype is Index_Type;
-
type Vector is tagged private;
type Cursor is private;
@@ -60,6 +58,8 @@ package Ada.Containers.Vectors is
No_Element : constant Cursor;
+ function "=" (Left, Right : Vector) return Boolean;
+
function To_Vector (Length : Count_Type) return Vector;
function To_Vector
@@ -74,8 +74,6 @@ package Ada.Containers.Vectors is
function "&" (Left, Right : Element_Type) return Vector;
- function "=" (Left, Right : Vector) return Boolean;
-
function Capacity (Container : Vector) return Count_Type;
procedure Reserve_Capacity
@@ -84,6 +82,10 @@ package Ada.Containers.Vectors is
function Length (Container : Vector) return Count_Type;
+ procedure Set_Length
+ (Container : in out Vector;
+ Length : Count_Type);
+
function Is_Empty (Container : Vector) return Boolean;
procedure Clear (Container : in out Vector);
@@ -100,6 +102,16 @@ package Ada.Containers.Vectors is
function Element (Position : Cursor) return Element_Type;
+ procedure Replace_Element
+ (Container : in out Vector;
+ Index : Index_Type;
+ New_Item : Element_Type);
+
+ procedure Replace_Element
+ (Container : in out Vector;
+ Position : Cursor;
+ New_Item : Element_Type);
+
procedure Query_Element
(Container : Vector;
Index : Index_Type;
@@ -110,22 +122,14 @@ package Ada.Containers.Vectors is
Process : not null access procedure (Element : Element_Type));
procedure Update_Element
- (Container : Vector;
+ (Container : in out Vector;
Index : Index_Type;
Process : not null access procedure (Element : in out Element_Type));
procedure Update_Element
- (Position : Cursor;
- Process : not null access procedure (Element : in out Element_Type));
-
- procedure Replace_Element
- (Container : Vector;
- Index : Index_Type;
- By : Element_Type);
-
- procedure Replace_Element (Position : Cursor; By : Element_Type);
-
- procedure Assign (Target : in out Vector; Source : Vector);
+ (Container : in out Vector;
+ Position : Cursor;
+ Process : not null access procedure (Element : in out Element_Type));
procedure Move (Target : in out Vector; Source : in out Vector);
@@ -164,6 +168,17 @@ package Ada.Containers.Vectors is
Position : out Cursor;
Count : Count_Type := 1);
+ procedure Insert
+ (Container : in out Vector;
+ Before : Extended_Index;
+ Count : Count_Type := 1);
+
+ procedure Insert
+ (Container : in out Vector;
+ Before : Cursor;
+ Position : out Cursor;
+ Count : Count_Type := 1);
+
procedure Prepend
(Container : in out Vector;
New_Item : Vector);
@@ -193,10 +208,6 @@ package Ada.Containers.Vectors is
Position : out Cursor;
Count : Count_Type := 1);
- procedure Set_Length
- (Container : in out Vector;
- Length : Count_Type);
-
procedure Delete
(Container : in out Vector;
Index : Extended_Index;
@@ -215,6 +226,12 @@ package Ada.Containers.Vectors is
(Container : in out Vector;
Count : Count_Type := 1);
+ procedure Reverse_Elements (Container : in out Vector);
+
+ procedure Swap (Container : in out Vector; I, J : Index_Type);
+
+ procedure Swap (Container : in out Vector; I, J : Cursor);
+
function First_Index (Container : Vector) return Index_Type;
function First (Container : Vector) return Cursor;
@@ -227,21 +244,13 @@ package Ada.Containers.Vectors is
function Last_Element (Container : Vector) return Element_Type;
- procedure Swap (Container : Vector; I, J : Index_Type);
-
- procedure Swap (I, J : Cursor);
-
- generic
- with function "<" (Left, Right : Element_Type) return Boolean is <>;
- package Generic_Sorting is
-
- function Is_Sorted (Container : Vector) return Boolean;
+ function Next (Position : Cursor) return Cursor;
- procedure Sort (Container : in out Vector);
+ procedure Next (Position : in out Cursor);
- procedure Merge (Target, Source : in out Vector);
+ function Previous (Position : Cursor) return Cursor;
- end Generic_Sorting;
+ procedure Previous (Position : in out Cursor);
function Find_Index
(Container : Vector;
@@ -267,14 +276,6 @@ package Ada.Containers.Vectors is
(Container : Vector;
Item : Element_Type) return Boolean;
- function Next (Position : Cursor) return Cursor;
-
- function Previous (Position : Cursor) return Cursor;
-
- procedure Next (Position : in out Cursor);
-
- procedure Previous (Position : in out Cursor);
-
function Has_Element (Position : Cursor) return Boolean;
procedure Iterate
@@ -285,6 +286,18 @@ package Ada.Containers.Vectors is
(Container : Vector;
Process : not null access procedure (Position : Cursor));
+ generic
+ with function "<" (Left, Right : Element_Type) return Boolean is <>;
+ package Generic_Sorting is
+
+ function Is_Sorted (Container : Vector) return Boolean;
+
+ procedure Sort (Container : in out Vector);
+
+ procedure Merge (Target : in out Vector; Source : in out Vector);
+
+ end Generic_Sorting;
+
private
pragma Inline (First_Index);
@@ -340,6 +353,18 @@ private
Index : Index_Type := Index_Type'First;
end record;
+ procedure Write
+ (Stream : access Root_Stream_Type'Class;
+ Position : Cursor);
+
+ for Cursor'Write use Write;
+
+ procedure Read
+ (Stream : access Root_Stream_Type'Class;
+ Position : out Cursor);
+
+ for Cursor'Read use Read;
+
No_Element : constant Cursor := Cursor'(null, Index_Type'First);
end Ada.Containers.Vectors;