Next: Inheritance from F_NodeClass Up: Creating a New Previous: Creating a New

The F_NodeType

As discussed in Section , each node type has a four-letter identifier called its node type. When you define a new node class, you should also create a variable containing the node type; this is done in the example by the line


static F_NodeType erpType = "Erp ";

before the class definition of erpNode. Here the new F_NodeType variable erpType is initialized. You should provide exactly four characters to initialize the F_NodeType. Note that in the example we add one blank to pad the string out to four characters.

FARFALLA uses the F_NodeType of nodes on disk to decode the disk file. If you are careful with F_NodeTypes, your programs will have a kind of robustness. As you recompile your FARFALLA applications, defining new node types and adding new functionality to old node types, your old FARFALLA files can still be read by your new applications as long as the data format for all old node types (as determined by the IOData() member function) does not change. Also, your application may work on files produced by other collaborators who use some node types you know about and some types that are unknown to your application. However, if the same F_NodeType string is used by different users, or the same user at different times, to refer to different data formats all of this compatibility will be lost. Therefore, if you find it necessary to change a data format, you should seriously consider either using versioning (discussed below in Section ) or defining a new node type, with a new F_NodeType string.


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