Next: Creating the New Up: Creating a New Previous: Creating a New

Overview

Many programmers will only use FARFALLA trees which were created by others and written to DSTs. Such programmers need not thoroughly understand the material in this section.

The basic philosophy of creating a FARFALLA tree is that FARFALLA will create the tree in an area of memory that it controls, and return to the programmer pointers to the nodes in the tree. The reason for this is to avoid a number of subtle programming errors that can be made if the tree, or parts of the tree, exist in areas of memory that the user controls. After FARFALLA creates a node for you, you may use the pointer it returns to you to fill the node with data. It is never possible to create a node first and then tell FARFALLA about it; instead, FARFALLA creates the node upon your request and tells you where to access it. Therefore, your program will declare pointers to nodes of different types, but will probably never declare an actual node.

When you want to create a FARFALLA tree in memory, you call a routine that creates the top node. You may then choose to put data into the top node. All other nodes you want to create must be created as children of existing nodes; that is, they will be part of the tree from the moment they are created. You call a routine to create a node of a certain type, and you tell the routine which existing node is to be the new node's parent. You may then put data in the newly-created child.


walter@
Wed Aug 10 11:53:26 PDT 1994