Next: int numTypesChildren() Up: Member Functions of Previous: void deleteChildrenOfType(F_NodeTypetypeWanted)

void deleteSubtree()

This function deletes the subtree (consisting of the node and all its descendants) from the tree and makes the memory the nodes had been using available for nodes that will be allocated in the future. If this is called for the top node in the tree, the entire tree disappears. If the node has no children, this function just deletes the node.

In the following code, all erp hits on supermodule 4 are deleted from the tree.


eventNode *ev;
erpNode *erpPtr;
...
for (int i = 0; i < ev->numChildren(erpType); i++)
{
  F_getChild(ev,erpPtr,i);
  if (erpPtr->boxnum.gt.300.and.erpPtr->boxnum.lt.400) erpPtr->deleteSubtree();
}


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