KDStateMachineEditor  1.0.0
A framework for creating Qt State Machine metacode using a graphical user interface
Public Types | Public Member Functions | List of all members
KDSME::TreeWalker< T > Class Template Reference

#include <treewalker.h>

Public Types

enum  VisitResult { ContinueWalk, RecursiveWalk, StopWalk }
 
enum  TraversalType { PreOrderTraversal, PostOrderTraversal }
 
typedef std::function< VisitResult(T)> VisitFunction
 

Public Member Functions

 TreeWalker (TraversalType type=PreOrderTraversal)
 
bool walkItems (T item, const VisitFunction &visit)
 
bool walkChildren (T item, const VisitFunction &visit)
 

Detailed Description

template<typename T>
class KDSME::TreeWalker< T >

Performs a DFS walk through the hierarchy of T

Note
Specialize TreeWalkerTrait for your type T to get TreeWalker support

Member Enumeration Documentation

template<typename T >
enum KDSME::TreeWalker::VisitResult
Enumerator
ContinueWalk 

Continues traversal with the next sibling of the item just visited, without visiting its children.

RecursiveWalk 

Traverse the children of this item.

StopWalk 

Terminate the traversal.

Member Function Documentation

template<typename T >
bool KDSME::TreeWalker< T >::walkChildren ( item,
const VisitFunction &  visit 
)
inline

Convenience function. Same as walk(), but omits item item

See also
walk()
template<typename T >
bool KDSME::TreeWalker< T >::walkItems ( item,
const VisitFunction &  visit 
)
inline

Walk through all items including the start item itself

Returns
True in case we walked through all items, false otherwise
Parameters
visitFunction called each time a LayoutItem instance is encountered

The documentation for this class was generated from the following file:

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
https://github.com/KDAB/KDStateMachineEditor