diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 13:54:02 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-15 13:54:02 +0000 |
commit | 2c3d0a6d737c0b55769f8e2169bc210b85575f72 (patch) | |
tree | 129bc8844811a17598b415668a54b3f7b4c278d7 /gcc/ada/a-ciormu.ads | |
parent | 2223c320c98d0169cd39be0b8842e53b93656706 (diff) | |
download | gcc-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-ciormu.ads')
-rw-r--r-- | gcc/ada/a-ciormu.ads | 89 |
1 files changed, 49 insertions, 40 deletions
diff --git a/gcc/ada/a-ciormu.ads b/gcc/ada/a-ciormu.ads index d2bf68dfd68..1240aca4d66 100644 --- a/gcc/ada/a-ciormu.ads +++ b/gcc/ada/a-ciormu.ads @@ -7,7 +7,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 -- @@ -47,6 +47,8 @@ generic package Ada.Containers.Indefinite_Ordered_Multisets is pragma Preelaborate; + function Equivalent_Elements (Left, Right : Element_Type) return Boolean; + type Set is tagged private; type Cursor is private; @@ -59,6 +61,8 @@ package Ada.Containers.Indefinite_Ordered_Multisets is function Equivalent_Sets (Left, Right : Set) return Boolean; + function To_Set (New_Item : Element_Type) return Set; + function Length (Container : Set) return Count_Type; function Is_Empty (Container : Set) return Boolean; @@ -67,15 +71,15 @@ package Ada.Containers.Indefinite_Ordered_Multisets is function Element (Position : Cursor) return Element_Type; + procedure Replace_Element + (Container : in out Set; + Position : Cursor; + New_Item : Element_Type); + procedure Query_Element (Position : Cursor; Process : not null access procedure (Element : Element_Type)); - procedure Replace_Element - (Container : Set; - Position : Cursor; - By : Element_Type); - procedure Move (Target : in out Set; Source : in out Set); procedure Insert @@ -85,6 +89,14 @@ package Ada.Containers.Indefinite_Ordered_Multisets is procedure Insert (Container : in out Set; New_Item : Element_Type); +-- TODO: include Replace too??? +-- +-- procedure Replace +-- (Container : in out Set; +-- New_Item : Element_Type); + + procedure Exclude (Container : in out Set; Item : Element_Type); + procedure Delete (Container : in out Set; Item : Element_Type); procedure Delete (Container : in out Set; Position : in out Cursor); @@ -93,10 +105,7 @@ package Ada.Containers.Indefinite_Ordered_Multisets is procedure Delete_Last (Container : in out Set); - procedure Exclude (Container : in out Set; Item : Element_Type); - - procedure Union (Target : in out Set; - Source : Set); + procedure Union (Target : in out Set; Source : Set); function Union (Left, Right : Set) return Set; @@ -124,14 +133,6 @@ package Ada.Containers.Indefinite_Ordered_Multisets is function Is_Subset (Subset : Set; Of_Set : Set) return Boolean; - function Contains (Container : Set; Item : Element_Type) return Boolean; - - function Find (Container : Set; Item : Element_Type) return Cursor; - - function Floor (Container : Set; Item : Element_Type) return Cursor; - - function Ceiling (Container : Set; Item : Element_Type) return Cursor; - function First (Container : Set) return Cursor; function First_Element (Container : Set) return Element_Type; @@ -148,6 +149,14 @@ package Ada.Containers.Indefinite_Ordered_Multisets is procedure Previous (Position : in out Cursor); + function Find (Container : Set; Item : Element_Type) return Cursor; + + function Floor (Container : Set; Item : Element_Type) return Cursor; + + function Ceiling (Container : Set; Item : Element_Type) return Cursor; + + function Contains (Container : Set; Item : Element_Type) return Boolean; + function Has_Element (Position : Cursor) return Boolean; function "<" (Left, Right : Cursor) return Boolean; @@ -181,42 +190,31 @@ package Ada.Containers.Indefinite_Ordered_Multisets is Process : not null access procedure (Position : Cursor)); generic - - type Key_Type (<>) is limited private; + type Key_Type (<>) is private; with function Key (Element : Element_Type) return Key_Type; - with function "<" (Left : Key_Type; Right : Element_Type) - return Boolean is <>; - - with function ">" (Left : Key_Type; Right : Element_Type) - return Boolean is <>; + with function "<" (Left, Right : Key_Type) return Boolean is <>; package Generic_Keys is - function Contains (Container : Set; Key : Key_Type) return Boolean; - - function Find (Container : Set; Key : Key_Type) return Cursor; - - function Floor (Container : Set; Key : Key_Type) return Cursor; - - function Ceiling (Container : Set; Key : Key_Type) return Cursor; + function Equivalent_Keys (Left, Right : Key_Type) return Boolean; function Key (Position : Cursor) return Key_Type; function Element (Container : Set; Key : Key_Type) return Element_Type; - procedure Delete (Container : in out Set; Key : Key_Type); - procedure Exclude (Container : in out Set; Key : Key_Type); - function "<" (Left : Cursor; Right : Key_Type) return Boolean; + procedure Delete (Container : in out Set; Key : Key_Type); - function ">" (Left : Cursor; Right : Key_Type) return Boolean; + function Find (Container : Set; Key : Key_Type) return Cursor; - function "<" (Left : Key_Type; Right : Cursor) return Boolean; + function Floor (Container : Set; Key : Key_Type) return Cursor; - function ">" (Left : Key_Type; Right : Cursor) return Boolean; + function Ceiling (Container : Set; Key : Key_Type) return Cursor; + + function Contains (Container : Set; Key : Key_Type) return Boolean; procedure Update_Element_Preserving_Key (Container : in out Set; @@ -266,6 +264,7 @@ private use Red_Black_Trees; use Tree_Types; use Ada.Finalization; + use Ada.Streams; type Set_Access is access all Set; for Set_Access'Storage_Size use 0; @@ -275,9 +274,19 @@ private Node : Node_Access; end record; - No_Element : constant Cursor := Cursor'(null, null); + procedure Write + (Stream : access Root_Stream_Type'Class; + Item : Cursor); - use Ada.Streams; + for Cursor'Write use Write; + + procedure Read + (Stream : access Root_Stream_Type'Class; + Item : out Cursor); + + for Cursor'Read use Read; + + No_Element : constant Cursor := Cursor'(null, null); procedure Write (Stream : access Root_Stream_Type'Class; Container : Set); |