Next: F_NodestarF_inputSubtree(F_NodestarparentPtriostream&infile) Up: Nonmember Functions Previous: void F_getChild(parentNodePtrnodeWantedPtr,int index)

void F_inputTree(topNodePtr,iostream&infile)

This routine reads one tree off of disk (from the file described by the iostream variable infile) and makes topNodePtr point at the top node of the tree. The tree must have been written by the outputSubtree() command documented below in Section . topNodePtr must be a pointer to the proper type of node; i.e. the type of the top node in the tree that is going to be read. If you do not know the type, you must use the more general F_inputSubtree() function documented in the next section.

The following reads one event tree from a file.


fstream infile;                 // declare the fstream variable
infile.open("infile.dst",ios::in);

eventNode *ev;
F_inputTree(ev,infile);         // ev points at the top of a new tree
if (ev->run > 1000) ...

Note that you may pass an fstream instead of an iostream as the second argument to F_inputTree().


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