Compounds | |
class | IterNodeTraversal |
Produces a traversal using the given Iterator. More... | |
class | NodeTraversal |
Base class for Traversal classes, that walks through a tree and returns a container with all visited nodes. More... | |
class | PostOrderNodeTraversal |
Produces a traversal in postorder. Descends first recursively and visits node then. More... | |
class | PreOrderNodeTraversal |
Produces a traversal in preorder. Visits node first and descends then recursively. More... |
NodeTraversal classes are functors and thus used via the operator() function.
_Node: | nodes type that are traversed |
_Container: | container type that is used to collect the nodes. Default is vector<_Node*> |
vector<Node<string> > traversal = PreNodeTraversal()(pointer_to_tree);
PreNodeTraversal pretraversal; vector<Node<string> > nodevector = pretraversal(pointer_to_tree);