OSDN Git Service

2007-01-26 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-rbtgso.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT LIBRARY COMPONENTS                          --
4 --                                                                          --
5 --       A D A . C O N T A I N E R S . R E D _ B L A C K _ T R E E S .      --
6 --               G E N E R I C _ S E T _ O P E R A T I O N S                --
7 --                                                                          --
8 --                                 S p e c                                  --
9 --                                                                          --
10 --          Copyright (C) 2004-2006, Free Software Foundation, Inc.         --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
21 -- Boston, MA 02110-1301, USA.                                              --
22 --                                                                          --
23 -- As a special exception,  if other files  instantiate  generics from this --
24 -- unit, or you link  this unit with other files  to produce an executable, --
25 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
26 -- covered  by the  GNU  General  Public  License.  This exception does not --
27 -- however invalidate  any other reasons why  the executable file  might be --
28 -- covered by the  GNU Public License.                                      --
29 --                                                                          --
30 -- This unit was originally developed by Matthew J Heaney.                  --
31 ------------------------------------------------------------------------------
32
33 --  Tree_Type is used to implement ordered containers. This package declares
34 --  set-based tree operations.
35
36 with Ada.Containers.Red_Black_Trees.Generic_Operations;
37
38 generic
39    with package Tree_Operations is new Generic_Operations (<>);
40
41    use Tree_Operations.Tree_Types;
42
43    with procedure Insert_With_Hint
44      (Dst_Tree : in out Tree_Type;
45       Dst_Hint : Node_Access;
46       Src_Node : Node_Access;
47       Dst_Node : out Node_Access);
48
49    with function Copy_Tree (Source_Root : Node_Access)
50        return Node_Access;
51
52    with procedure Delete_Tree (X : in out Node_Access);
53
54    with function Is_Less (Left, Right : Node_Access) return Boolean;
55
56    with procedure Free (X : in out Node_Access);
57
58 package Ada.Containers.Red_Black_Trees.Generic_Set_Operations is
59    pragma Pure;
60
61    procedure Union (Target : in out Tree_Type; Source : Tree_Type);
62
63    function Union (Left, Right : Tree_Type) return Tree_Type;
64
65    procedure Intersection (Target : in out Tree_Type; Source : Tree_Type);
66
67    function Intersection (Left, Right : Tree_Type) return Tree_Type;
68
69    procedure Difference (Target : in out Tree_Type; Source : Tree_Type);
70
71    function Difference (Left, Right : Tree_Type) return Tree_Type;
72
73    procedure Symmetric_Difference
74      (Target : in out Tree_Type;
75       Source : Tree_Type);
76
77    function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type;
78
79    function Is_Subset (Subset : Tree_Type; Of_Set : Tree_Type) return Boolean;
80
81    function Overlap (Left, Right : Tree_Type) return Boolean;
82
83 end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;