16 #ifndef KDSME_UTIL_TREEWALKER_H 17 #define KDSME_UTIL_TREEWALKER_H 19 #include "kdsme_core_export.h" 53 typedef std::function<VisitResult(T)> VisitFunction;
55 explicit TreeWalker(TraversalType type = PreOrderTraversal)
56 : m_traversalType(type) {}
70 bool continueWalk =
true;
71 if (m_traversalType == PreOrderTraversal) {
76 if (!walkItems(child, visit))
79 if (m_traversalType == PostOrderTraversal) {
96 if (!walkItems(child, visit))
103 TraversalType m_traversalType;
108 #endif // TREEWALKER_H bool walkItems(T item, const VisitFunction &visit)
Definition: treewalker.h:65
bool walkChildren(T item, const VisitFunction &visit)
Definition: treewalker.h:90
Definition: treewalker.h:28
Traverse the children of this item.
Definition: treewalker.h:44
VisitResult
Definition: treewalker.h:42
Definition: treewalker.h:39
Continues traversal with the next sibling of the item just visited, without visiting its children...
Definition: treewalker.h:43
Definition: mainwindow.h:21