Hosted by
 |
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Hash_Tables;
generic
type Item_Type is private;
package String_Hash_Tables is
function Hash
(Key : in Unbounded_String;
Max : in Positive)
return Positive;
package US_Hash_Tables is
new Hash_Tables(Unbounded_String, Item_Type, Hash, "=");
subtype Hash_Table is US_Hash_Tables.Hash_Table;
Key_Exists : exception
renames US_Hash_Tables.Key_Exists;
procedure Put
(Table : in out Hash_Table;
Key : in String;
Item : in Item_Type);
procedure Get
(Table : in Hash_Table;
Key : in String;
Item : out Item_Type;
Found : out Boolean);
Key_Not_Found : exception
renames US_Hash_Tables.Key_Not_Found;
function Get
(Table : in Hash_Table;
Key : in String)
return Item_Type;
procedure Get_Next
(Table : in Hash_Table;
Index : in out Natural;
Key : out Unbounded_String;
Item : out Item_Type)
renames US_Hash_Tables.Get_Next;
procedure Print_Usage
(Table : in Hash_Table)
renames US_Hash_Tables.Print_Usage;
end String_Hash_Tables;
|