FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
cpp::TreeBfsExplorer< NODE, TREE_MODEL > Class Template Reference

#include <cpptools/tree_bfs_explorer.h>

Public Member Functions

 TreeBfsExplorer ()
 
void begin (NODE *node=nullptr)
 Prepares exploration to start from tree node. More...
 
void goNext ()
 Move exploration to the next tree node. More...
 
bool atEnd () const
 Is exploration beyond the last tree node (ended) ? More...
 
NODE * current () const
 Current explored tree node. More...
 
unsigned depth () const
 Depth of the current tree node. More...
 

Detailed Description

template<typename NODE, typename TREE_MODEL>
class cpp::TreeBfsExplorer< NODE, TREE_MODEL >

Generic class for the exploration of trees using BFS (breadth-first search) algorithm

TREE_MODEL type must be a model of TreeBfsConcept :

struct TreeBfsConcept
{
// Is current tree node deeper (depth value) than tree node previous ?
static bool isDeeper(const NODE* current, const NODE* previous);
// Enqueue all first-level (direct) children of tree node parentNode
// using output iterator
template<typename OUTPUT_ITERATOR>
static void enqueueChildren(OUTPUT_ITERATOR out, NODE* parentNode);
};

Constructor & Destructor Documentation

template<typename NODE , typename TREE_MODEL >
cpp::TreeBfsExplorer< NODE, TREE_MODEL >::TreeBfsExplorer ( )

Member Function Documentation

template<typename NODE , typename TREE_MODEL >
bool cpp::TreeBfsExplorer< NODE, TREE_MODEL >::atEnd ( ) const

Is exploration beyond the last tree node (ended) ?

template<typename NODE, typename TREE_MODEL >
void cpp::TreeBfsExplorer< NODE, TREE_MODEL >::begin ( NODE *  node = nullptr)

Prepares exploration to start from tree node.

template<typename NODE , typename TREE_MODEL >
NODE * cpp::TreeBfsExplorer< NODE, TREE_MODEL >::current ( ) const

Current explored tree node.

template<typename NODE , typename TREE_MODEL >
unsigned cpp::TreeBfsExplorer< NODE, TREE_MODEL >::depth ( ) const

Depth of the current tree node.

template<typename NODE , typename TREE_MODEL >
void cpp::TreeBfsExplorer< NODE, TREE_MODEL >::goNext ( )

Move exploration to the next tree node.


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