summaryrefslogtreecommitdiff
path: root/gcc/ada/a-chtgke.ads
blob: 704c653f730bc6244cf03c93def20ba460e8142c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
------------------------------------------------------------------------------
--                                                                          --
--                         GNAT LIBRARY COMPONENTS                          --
--                                                                          --
--                 ADA.CONTAINERS.HASH_TABLES.GENERIC_KEYS                  --
--                                                                          --
--                                 S p e c                                  --
--                                                                          --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT.  In accordance with the copyright of that document, you can freely --
-- copy and modify this specification,  provided that if you redistribute a --
-- modified version,  any changes that you have made are clearly indicated. --
--                                                                          --
------------------------------------------------------------------------------

generic
   with package HT_Types is
     new Generic_Hash_Table_Types (<>);

   type HT_Type is new HT_Types.Hash_Table_Type with private;

   use HT_Types;

   Null_Node : Node_Access;

   with function Next (Node : Node_Access) return Node_Access;

   with procedure Set_Next
     (Node : Node_Access;
      Next : Node_Access);

   type Key_Type (<>) is limited private;

   with function Hash (Key : Key_Type) return Hash_Type;

   with function Equivalent_Keys
     (Key  : Key_Type;
      Node : Node_Access) return Boolean;

package Ada.Containers.Hash_Tables.Generic_Keys is
   pragma Preelaborate;

   function Index
     (HT  : HT_Type;
      Key : Key_Type) return Hash_Type;
   pragma Inline (Index);

   procedure Delete_Key_Sans_Free
     (HT   : in out HT_Type;
      Key  : Key_Type;
      X    : out Node_Access);

   function Find (HT  : HT_Type; Key : Key_Type) return Node_Access;

   generic
      with function New_Node
        (Next : Node_Access) return Node_Access;
   procedure Generic_Conditional_Insert
     (HT      : in out HT_Type;
      Key     : Key_Type;
      Node    : out Node_Access;
      Success : out Boolean);

end Ada.Containers.Hash_Tables.Generic_Keys;