Next: Declaration Object Up: Creating a New Previous: IOData()

The Creation Function

Outside of the class definition, you must define a function that creates a new object of the class. FARFALLA may sometimes call the function when a new node of the class is needed. The function is quite simple; it simply uses the C++ builtin function new to create a new object in a space of memory called the free store. The function returns a pointer (actually a generic F_Nodestar rather than a specific erpNode*) to the newly created object. In erpNode.h, the function looks like this:


inline F_Node* newErpNode() {return new erpNode;}


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