Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /charles/src/

charles
Discussion topic

Back to topic list

CVS update: /charles/src/

Reply

Author matthewjheaney
Full name Matthew Heaney
Date 2004-03-04 09:34:04 PST
Message User: matthewjheaney
Date: 04/03/04 09:34:04

Modified:
 /charles/src/
  charles-red_black_trees.adb, charles-red_black_trees.ads

Log:
 added generic_finalize for tree_type

File Changes:

Directory: /charles/src/
========================

File [changed]: charles-red_black_trees.adb
Url: http://charles.tigri​s.org/source/browse/​charles/src/charles-​red_black_trees.adb?​r1=1.1&r2=1.2
Delta lines: +22 -0
--------------------
--- charles-red_black_trees.adb 3 Mar 2004 06:30:06 -0000 1.1
+++ charles-red_black_trees.adb 4 Mar 2004 17:34:02 -0000 1.2
@@ -149,6 +149,28 @@
    end Generic_Adjust;
 
 
+ procedure Generic_Finalize (Tree : in out Tree_Type) is
+
+ Back : Node_Access := Tree.Back;
+ Root : Node_Access;
+
+ begin
+
+ if Back /= Null_Node then
+
+ Root := Red_Black_Trees.Root (Tree);
+
+ Tree.Back := Null_Node;
+ Tree.Length := 0;
+
+ Delete_Tree (Root);
+ Free (Back);
+
+ end if;
+
+ end Generic_Finalize;
+
+
    procedure Generic_Assign
      (Target : in out Tree_Type;
       Source : in Tree_Type) is

File [changed]: charles-red_black_trees.ads
Url: http://charles.tigri​s.org/source/browse/​charles/src/charles-​red_black_trees.ads?​r1=1.1&r2=1.2
Delta lines: +10 -0
--------------------
--- charles-red_black_trees.ads 3 Mar 2004 06:30:06 -0000 1.1
+++ charles-red_black_trees.ads 4 Mar 2004 17:34:02 -0000 1.2
@@ -114,6 +114,16 @@
 
       with procedure Delete_Tree (X : in out Node_Access) is <>;
 
+ with procedure Free (X : in out Node_Access) is <>;
+
+ procedure Generic_Finalize (Tree : in out Tree_Type);
+
+
+
+ generic
+
+ with procedure Delete_Tree (X : in out Node_Access) is <>;
+
       with function Copy_Tree (Node : Node_Access)
         return Node_Access is <>;
 




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@char​les.tigris.org
For additional commands, e-mail: cvs-help at charles dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /charles/src/ matthewjheaney Matthew Heaney 2004-03-04 09:34:04 PST
Messages per page: