aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/a-cihama.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/a-cihama.ads')
-rw-r--r--gcc/ada/a-cihama.ads69
1 files changed, 47 insertions, 22 deletions
diff --git a/gcc/ada/a-cihama.ads b/gcc/ada/a-cihama.ads
index 7769cbb..1f15c58 100644
--- a/gcc/ada/a-cihama.ads
+++ b/gcc/ada/a-cihama.ads
@@ -2,11 +2,12 @@
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
--- ADA.CONTAINERS.INDEFINITE_HASHED_MAPS --
+-- A D A . C O N T A I N E R S . --
+-- I N D E F I N I T E _ H A S H E D _ M A P 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 --
@@ -35,6 +36,7 @@
with Ada.Containers.Hash_Tables;
with Ada.Streams;
+with Ada.Finalization;
generic
type Key_Type (<>) is private;
@@ -61,6 +63,8 @@ package Ada.Containers.Indefinite_Hashed_Maps is
procedure Clear (Container : in out Map);
+ function Key (Position : Cursor) return Key_Type;
+
function Element (Position : Cursor) return Element_Type;
procedure Query_Element
@@ -105,14 +109,14 @@ package Ada.Containers.Indefinite_Hashed_Maps is
(Container : in out Map;
Key : Key_Type);
- procedure Exclude
- (Container : in out Map;
- Key : Key_Type);
-
procedure Delete
(Container : in out Map;
Position : in out Cursor);
+ procedure Exclude
+ (Container : in out Map;
+ Key : Key_Type);
+
function Contains
(Container : Map;
Key : Key_Type) return Boolean;
@@ -125,12 +129,6 @@ package Ada.Containers.Indefinite_Hashed_Maps is
(Container : Map;
Key : Key_Type) return Element_Type;
- function Capacity (Container : Map) return Count_Type;
-
- procedure Reserve_Capacity
- (Container : in out Map;
- Capacity : Count_Type);
-
function First (Container : Map) return Cursor;
function Next (Position : Cursor) return Cursor;
@@ -139,8 +137,6 @@ package Ada.Containers.Indefinite_Hashed_Maps is
function Has_Element (Position : Cursor) return Boolean;
- function Key (Position : Cursor) return Key_Type;
-
function Equivalent_Keys (Left, Right : Cursor)
return Boolean;
@@ -156,16 +152,48 @@ package Ada.Containers.Indefinite_Hashed_Maps is
(Container : Map;
Process : not null access procedure (Position : Cursor));
+ function Capacity (Container : Map) return Count_Type;
+
+ procedure Reserve_Capacity
+ (Container : in out Map;
+ Capacity : Count_Type);
+
private
+ pragma Inline ("=");
+ pragma Inline (Length);
+ pragma Inline (Is_Empty);
+ pragma Inline (Clear);
+ pragma Inline (Key);
+ pragma Inline (Element);
+ pragma Inline (Move);
+ pragma Inline (Contains);
+ pragma Inline (Capacity);
+ pragma Inline (Reserve_Capacity);
+ pragma Inline (Has_Element);
+ pragma Inline (Equivalent_Keys);
+
type Node_Type;
type Node_Access is access Node_Type;
- package HT_Types is
- new Hash_Tables.Generic_Hash_Table_Types (Node_Access);
+ type Key_Access is access Key_Type;
+ type Element_Access is access Element_Type;
- use HT_Types;
+ type Node_Type is limited record
+ Key : Key_Access;
+ Element : Element_Access;
+ Next : Node_Access;
+ end record;
+
+ package HT_Types is new Hash_Tables.Generic_Hash_Table_Types
+ (Node_Type,
+ Node_Access);
+
+ type Map is new Ada.Finalization.Controlled with record
+ HT : HT_Types.Hash_Table_Type;
+ end record;
- type Map is new Hash_Table_Type with null record;
+ use HT_Types;
+ use Ada.Finalization;
procedure Adjust (Container : in out Map);
@@ -198,9 +226,6 @@ private
for Map'Read use Read;
- Empty_Map : constant Map := (Hash_Table_Type with null record);
+ Empty_Map : constant Map := (Controlled with HT => (null, 0, 0, 0));
end Ada.Containers.Indefinite_Hashed_Maps;
-
-
-