summaryrefslogtreecommitdiff
path: root/gcc/ada/a-ciorse.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-ciorse.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-ciorse.ads')
-rw-r--r--gcc/ada/a-ciorse.ads73
1 files changed, 45 insertions, 28 deletions
diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads
index e05dc1a6638..0841bc74560 100644
--- a/gcc/ada/a-ciorse.ads
+++ b/gcc/ada/a-ciorse.ads
@@ -2,11 +2,12 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- ADA.CONTAINERS.INDEFINITE_ORDERED_SETS --
+-- A D A . C O N T A I N E R S . --
+-- I N D E F I N I T E _ 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 --
@@ -56,6 +57,8 @@ pragma Preelaborate (Indefinite_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;
@@ -68,11 +71,10 @@ pragma Preelaborate (Indefinite_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 ruling from ARG
+ Position : Cursor;
+ By : Element_Type);
procedure Move (Target : in out Set; Source : in out Set);
@@ -98,10 +100,6 @@ pragma Preelaborate (Indefinite_Ordered_Sets);
(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);
@@ -110,6 +108,10 @@ pragma Preelaborate (Indefinite_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;
@@ -157,10 +159,10 @@ pragma Preelaborate (Indefinite_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;
@@ -220,11 +222,10 @@ pragma Preelaborate (Indefinite_Ordered_Sets);
(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 ruling from ARG
+ Key : Key_Type;
+ New_Item : Element_Type);
procedure Delete (Container : in out Set; Key : Key_Type);
@@ -238,8 +239,7 @@ pragma Preelaborate (Indefinite_Ordered_Sets);
function ">" (Left : Key_Type; Right : Cursor) return Boolean;
- -- TODO: resolve name in Atlanta???
- procedure Checked_Update_Element
+ procedure Update_Element_Preserving_Key
(Container : in out Set;
Position : Cursor;
Process : not null access
@@ -252,21 +252,33 @@ 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 Element_Access is access Element_Type;
- use Tree_Types;
- use Ada.Finalization;
+ 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_Access;
+ end record;
+
+ 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
@@ -291,6 +303,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.Indefinite_Ordered_Sets;