Note: Unlike most of the other documents in this SDK, this document is purely for educational purposes. You should not sub-class the TreeNode, nor access its members. You should instead use the standard commands available in FlexSim for manipulating and traversing FlexSim's tree.
The TreeNode class is the structure that makes up the backbone of FlexSim's tree structure. The treenode (all lower-case) type is defined (using a typedef) as a TreeNode*, so that the following lines are exactly equivalent.
TreeNode* someNode; treenode someNode;
An extremely simplified version of the TreeNode class is shown below.
A TreeNode object contains several pointers to other TreeNodes, including:
Below is an example diagram of a node with three sub-nodes.
A TreeNode object also contains a void* called data that can point to any of the following types:
|Data Type||Associated Macro|
Below is an example of a TreeNode pointing to number data. However, the number in this example could be replaced with any of the types listed above.