Hosted by
|
package body Hash_Tables is
procedure Put
(This : in out Hash_Table_Access;
Key : in Key_Type;
Item : in Item_Type)
is
Pair : Inner_Tables.Pair_Access := new Inner_Tables.Pair;
begin
Pair.Key := Key;
Pair.Item := Item;
Inner_Tables.Put(This, Pair);
end Put;
function Get
(This : access Hash_Table;
Key : in Key_Type)
return Item_Type is
begin
return Inner_Tables.Get_Item(This, Inner_Tables.Get_Index(This, Key));
end Get;
procedure Get_Next
(This : access Hash_Table;
Index : in out Natural;
Key : out Key_Type;
Item : out Item_Type)
is
Pair : Inner_Tables.Pair_Access;
begin
Inner_Tables.Get_Next(This, Index, Pair);
Key := Pair.Key;
Item := Pair.Item;
end Get_Next;
end Hash_Tables;
|