summaryrefslogtreecommitdiff
path: root/gcc/ada/a-coorse.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:56:24 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:56:24 +0000
commitca64eb07de27f9c20b0b5b909f314afaae888e81 (patch)
tree60bbc3a40631ce4a825ff74330cd04720cf0d624 /gcc/ada/a-coorse.ads
parentd25effa88fc45b26bb1ac6135a42785ddb699037 (diff)
downloadgcc-ca64eb07de27f9c20b0b5b909f314afaae888e81.tar.gz
2005-06-14 Matthew Heaney <heaney@adacore.com>
* a-swunha.ads, a-swunha.adb: Removed. Replaced by a-swuwha.ad[sb] * a-swuwha.ads, a-swuwha.adb: New files * a-szunha.ads, a-szunha.adb: Removed, replaced by a-szuzha.ad[sb] * a-szuzha.ads, a-szuzha.adb: New files. * a-rbtgso.adb, a-crbtgo.ads, a-crbtgo.adb, a-crbtgk.ads, a-crbtgk.adb, a-crbltr.ads, a-coorse.ads, a-coorse.adb, a-convec.ads, a-convec.adb, a-coinve.ads, a-coinve.adb, a-cohata.ads, 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-chtgop.ads, a-chtgop.adb, a-cdlili.ads, a-cdlili.adb, a-coormu.adb, a-ciormu.adb, a-cihase.adb, a-cohase.adb, a-cohase.ads, a-ciorma.ads, a-coorma.ads, a-ciormu.ads, a-coormu.ads, a-swunha.adb, a-stunha.adb, a-ciorma.adb, a-coorma.adb, a-shcain.ads, a-shcain.adb, a-chtgke.ads, a-chtgke.adb, a-stwiha.ads, a-stwiha.adb, a-strhas.adb, a-stzhas.adb: synchronized to the latest version of the Ada 2005 RM. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-coorse.ads')
-rw-r--r--gcc/ada/a-coorse.ads73
1 files changed, 44 insertions, 29 deletions
diff --git a/gcc/ada/a-coorse.ads b/gcc/ada/a-coorse.ads
index 1dca837ccb6..17994951713 100644
--- a/gcc/ada/a-coorse.ads
+++ b/gcc/ada/a-coorse.ads
@@ -2,11 +2,11 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- ADA.CONTAINERS.ORDERED_SETS --
+-- A D A . C O N T A I N E R S . O R D E R E D _ S E T S --
-- --
-- S p e c --
-- --
--- Copyright (C) 2004 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 --
@@ -57,6 +57,8 @@ pragma Preelaborate (Ordered_Sets);
function "=" (Left, Right : Set) return Boolean;
+ function Equivalent_Sets (Left, Right : Set) return Boolean;
+
function Length (Container : Set) return Count_Type;
function Is_Empty (Container : Set) return Boolean;
@@ -69,11 +71,10 @@ pragma Preelaborate (Ordered_Sets);
(Position : Cursor;
Process : not null access procedure (Element : Element_Type));
--- TODO: resolve in Atlanta. ???
--- procedure Replace_Element
--- (Container : in out Set;
--- Position : Cursor;
--- By : Element_Type);
+ procedure Replace_Element
+ (Container : Set; -- TODO: need ARG ruling
+ Position : Cursor;
+ By : Element_Type);
procedure Move
(Target : in out Set;
@@ -94,17 +95,13 @@ pragma Preelaborate (Ordered_Sets);
New_Item : Element_Type);
procedure Replace
- (Container : in out Set;
+ (Container : in out Set; -- TODO: need ARG ruling
New_Item : Element_Type);
procedure Delete
(Container : in out Set;
Item : Element_Type);
- procedure Exclude
- (Container : in out Set;
- Item : Element_Type);
-
procedure Delete
(Container : in out Set;
Position : in out Cursor);
@@ -113,6 +110,10 @@ pragma Preelaborate (Ordered_Sets);
procedure Delete_Last (Container : in out Set);
+ procedure Exclude
+ (Container : in out Set;
+ Item : Element_Type);
+
procedure Union (Target : in out Set; Source : Set);
function Union (Left, Right : Set) return Set;
@@ -160,10 +161,10 @@ pragma Preelaborate (Ordered_Sets);
function Next (Position : Cursor) return Cursor;
- function Previous (Position : Cursor) return Cursor;
-
procedure Next (Position : in out Cursor);
+ function Previous (Position : Cursor) return Cursor;
+
procedure Previous (Position : in out Cursor);
function Has_Element (Position : Cursor) return Boolean;
@@ -215,11 +216,10 @@ pragma Preelaborate (Ordered_Sets);
function Element (Container : Set; Key : Key_Type) return Element_Type;
--- TODO: resolve in Atlanta ???
--- procedure Replace
--- (Container : in out Set;
--- Key : Key_Type;
--- New_Item : Element_Type);
+ procedure Replace
+ (Container : in out Set; -- TODO: need ARG ruling
+ Key : Key_Type;
+ New_Item : Element_Type);
procedure Delete (Container : in out Set; Key : Key_Type);
@@ -233,8 +233,7 @@ pragma Preelaborate (Ordered_Sets);
function ">" (Left : Key_Type; Right : Cursor) return Boolean;
--- TODO: resolve name in Atlanta. Should name be just "Update_Element" ???
- procedure Checked_Update_Element
+ procedure Update_Element_Preserving_Key
(Container : in out Set;
Position : Cursor;
Process : not null access
@@ -247,21 +246,32 @@ private
type Node_Type;
type Node_Access is access Node_Type;
- package Tree_Types is
- new Red_Black_Trees.Generic_Tree_Types (Node_Access);
+ type Node_Type is limited record
+ Parent : Node_Access;
+ Left : Node_Access;
+ Right : Node_Access;
+ Color : Red_Black_Trees.Color_Type := Red_Black_Trees.Red;
+ Element : Element_Type;
+ end record;
- use Tree_Types;
- use Ada.Finalization;
+ package Tree_Types is new Red_Black_Trees.Generic_Tree_Types
+ (Node_Type,
+ Node_Access);
- type Set is new Controlled with record
- Tree : Tree_Type := (Length => 0, others => null);
+ type Set is new Ada.Finalization.Controlled with record
+ Tree : Tree_Types.Tree_Type;
end record;
procedure Adjust (Container : in out Set);
procedure Finalize (Container : in out Set) renames Clear;
- type Set_Access is access constant Set;
+ use Red_Black_Trees;
+ use Tree_Types;
+ use Ada.Finalization;
+
+ type Set_Access is access all Set;
+ for Set_Access'Storage_Size use 0;
type Cursor is record
Container : Set_Access;
@@ -285,6 +295,11 @@ private
for Set'Read use Read;
Empty_Set : constant Set :=
- (Controlled with Tree => (Length => 0, others => null));
+ (Controlled with Tree => (First => null,
+ Last => null,
+ Root => null,
+ Length => 0,
+ Busy => 0,
+ Lock => 0));
end Ada.Containers.Ordered_Sets;