SPARK
0.1.0
A general purpose game engine written in C++.
|
A generic tree traverser caller that can be used to traverse any Composite. More...
#include <Traverser.h>
Static Public Member Functions | |
template<typename Traverser > | |
static void | exec (NodeType *container, Traverser &traverser, FnArgsTypes &&... args) |
Traverses the given tree using the given traverser. | |
A generic tree traverser caller that can be used to traverse any Composite.
This traverser operates on a Composite data structure by recursively traversing its elements and performing designated operations. To use this, you need to provide a Traverser implementation that defines the pre/post/apply functions.
The apply function is called on every element of the tree except the root, while the pre/post functions are called only on the elements that can have children.
NodeType | Type of the nodes of the tree. |
FnArgsTypes | The types of arguments that will be passed to the pre/post/apply functions. |
|
inlinestatic |
Traverses the given tree using the given traverser.
container | The tree to visit. |
traverser | The traverser implementation with the pre/post/apply functions. |
args | The arguments to pass to the pre/post/apply functions. |