Next: Introduction to C++ Up: Member Functions of Previous: int numTypesChildren()

F_NodeTypechildType(int index)

Returns the node type of the index-th type of child the node has.

The following code can be used to traverse all the children of a node, with no prior knowledge of the possible types.


eventNode *parentPtr;
...
for (int iType = 0; iType < parentPtr->numTypesChildren(); iType++)
{
  F_NodeType currentType = parentPtr->childType(iType);
  for (int iChild = 0; iChild < parentPtr->numChildren(currentType); iChild++)
  {
    F_Node *childPtr;
    childPtr = parentPtr->getChild(currentType,iChild);
    ...
  }
}


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