-- --
-- S p e c --
-- --
--- Copyright (C) 2004-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 2004-2006, 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 --
with function "=" (Left, Right : Element_Type) return Boolean is <>;
package Ada.Containers.Indefinite_Hashed_Maps is
- pragma Preelaborate (Indefinite_Hashed_Maps);
+ pragma Preelaborate;
type Map is tagged private;
+ pragma Preelaborable_Initialization (Map);
+
type Cursor is private;
+ pragma Preelaborable_Initialization (Cursor);
Empty_Map : constant Map;
No_Element : constant Cursor;
function "=" (Left, Right : Map) return Boolean;
+ function Capacity (Container : Map) return Count_Type;
+
+ procedure Reserve_Capacity
+ (Container : in out Map;
+ Capacity : Count_Type);
+
function Length (Container : Map) return Count_Type;
function Is_Empty (Container : Map) return Boolean;
function Element (Position : Cursor) return Element_Type;
+ procedure Replace_Element
+ (Container : in out Map;
+ Position : Cursor;
+ New_Item : Element_Type);
+
procedure Query_Element
(Position : Cursor;
Process : not null access procedure (Key : Key_Type;
Element : Element_Type));
procedure Update_Element
- (Position : Cursor;
- Process : not null access procedure (Key : Key_Type;
+ (Container : in out Map;
+ Position : Cursor;
+ Process : not null access procedure (Key : Key_Type;
Element : in out Element_Type));
- procedure Replace_Element
- (Position : Cursor;
- By : Element_Type);
-
procedure Move (Target : in out Map; Source : in out Map);
procedure Insert
Key : Key_Type;
New_Item : Element_Type);
- procedure Delete
- (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;
+ procedure Exclude (Container : in out Map; Key : Key_Type);
- function Find
- (Container : Map;
- Key : Key_Type) return Cursor;
+ procedure Delete (Container : in out Map; Key : Key_Type);
- function Element
- (Container : Map;
- Key : Key_Type) return Element_Type;
+ procedure Delete (Container : in out Map; Position : in out Cursor);
function First (Container : Map) return Cursor;
procedure Next (Position : in out Cursor);
+ function Find (Container : Map; Key : Key_Type) return Cursor;
+
+ function Contains (Container : Map; Key : Key_Type) return Boolean;
+
+ function Element (Container : Map; Key : Key_Type) return Element_Type;
+
function Has_Element (Position : Cursor) return Boolean;
- function Equivalent_Keys (Left, Right : Cursor)
- return Boolean;
+ function Equivalent_Keys (Left, Right : Cursor) return Boolean;
- function Equivalent_Keys
- (Left : Cursor;
- Right : Key_Type) return Boolean;
+ function Equivalent_Keys (Left : Cursor; Right : Key_Type) return Boolean;
- function Equivalent_Keys
- (Left : Key_Type;
- Right : Cursor) return Boolean;
+ function Equivalent_Keys (Left : Key_Type; Right : Cursor) return Boolean;
procedure Iterate
(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);
use HT_Types;
use Ada.Finalization;
+ use Ada.Streams;
procedure Adjust (Container : in out Map);
Node : Node_Access;
end record;
+ procedure Write
+ (Stream : access Root_Stream_Type'Class;
+ Item : Cursor);
+
+ 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 :=
(Container => null,
Node => null);
- use Ada.Streams;
-
procedure Write
(Stream : access Root_Stream_Type'Class;
Container : Map);