25 #ifndef KDSME_UTIL_TREEWALKER_H
26 #define KDSME_UTIL_TREEWALKER_H
28 #include "kdsme_core_export.h"
39 static QList<T> children(T item) { Q_UNUSED(item);
return QList<T>(); }
62 typedef std::function<VisitResult(T)> VisitFunction;
64 explicit TreeWalker(TraversalType type = PreOrderTraversal)
65 : m_traversalType(type) {}
79 bool continueWalk =
true;
80 if (m_traversalType == PreOrderTraversal) {
88 if (m_traversalType == PostOrderTraversal) {
112 TraversalType m_traversalType;
117 #endif // TREEWALKER_H
bool walkItems(T item, const VisitFunction &visit)
Definition: treewalker.h:74
bool walkChildren(T item, const VisitFunction &visit)
Definition: treewalker.h:99
Definition: treewalker.h:37
Terminate the traversal.
Definition: treewalker.h:54
Traverse the children of this item.
Definition: treewalker.h:53
VisitResult
Definition: treewalker.h:51
Definition: treewalker.h:48
Continues traversal with the next sibling of the item just visited, without visiting its children...
Definition: treewalker.h:52
Definition: abstractexporter.h:33