Specification of generic package Tgx.Avl_Tree_Generic







 ========================================================================= --
 ===                                                                   === --
 ===                 Top Graph'X CORBA Implementation                  === --
 ===                                                                   === --
 ===                 Copyright (c) 1996, Top Graph'X.                  === --
 ===                                                                   === --
 ===                     --- Copyright Notice ---                      === --
 ===                                                                   === --
 ===    This software is protected as an unpublished work under the    === --
 ===     Copyright Act of 1976.  All rights reserved.  Top Graph'X.    === --
 ===                                                                   === --
 ========================================================================= --
generic
   type Key is private;
   type Element is private;
   Null_Element : in Element ;
   with function "<" (Left, Right : Key) return Boolean;
   with function ">" (Left, Right : Key) return Boolean;
   with procedure Print_Node ( The_Key : in Key;
                               The_Element : in Element;
                               Indentation : in Positive;
                               Verbose : in Boolean);
package Tgx.Avl_Tree_Generic is

   Bad_Balance_Factor : exception;
   Element_Not_In_Tree : exception;

   type Node is private;
   type Handle is access Node;


   procedure Insert ( The_Key : in Key;
                      Tree : in out Handle;
                      Inserted_Node : out Handle);
   procedure Delete (The_Key : in Key; Tree : in out Handle);
   function Search (The_Key : in Key; Tree : in Handle) return Element;
   function Search (The_Key : in Key; Tree : in Handle) return Handle;
   procedure Make_Empty (Tree : in out Handle);
   function Get_Value (This : Node) return Element;
   procedure Set_Value (This : in out Node; To : Element);
   procedure Print_Tree (The_Tree : in Handle;
                          Indentation : in Positive;
                          Verbose : in Boolean);
private

   type Balance_Factor is (Is_Left_Weighted, Is_Balanced, Is_Right_Weighted);
   type Node is
   record
      K : Key;
      Value : Element;
      Count : Natural;
      Balance : Balance_Factor;
      Left, Right : Handle;
   end record;
end Tgx.Avl_Tree_Generic;



List of definition uses










This page was generated by PrismTech's ada2html on Friday Mai 12 2006 16:18