Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::For_Each_Preorder< Node > Class Template Reference

Generic preorder traversal of a binary tree. More...

#include <tpl_binNodeUtils.H>

Public Member Functions

template<class Op >
void traverse (Node *root, Op &&op) const
 Invoke the traversal.
 
template<class Op >
void operator() (Node *root, Op &op) const
 See traverse(Node * root, Op && op).
 
template<class Op >
void operator() (Node *root, Op &&op=Op()) const
 See traverse(Node * root, Op && op).
 

Static Private Member Functions

template<class Op >
static void preorder (Node *root, Op &&op)
 

Detailed Description

template<class Node>
class Aleph::For_Each_Preorder< Node >

Generic preorder traversal of a binary tree.

For_Each_Preorder traverses a binary tree in preorder. For each is node is called an operation with the following signature:

struct Op
{
  void operator () (Node * p)
  {

operation } };

Author
Leandro Rabindranath León

Definition at line 378 of file tpl_binNodeUtils.H.

Member Function Documentation

◆ operator()() [1/2]

template<class Node >
template<class Op >
void Aleph::For_Each_Preorder< Node >::operator() ( Node *  root,
Op &&  op = Op() 
) const
inline

See traverse(Node * root, Op && op).

Definition at line 408 of file tpl_binNodeUtils.H.

References preorder, and root().

◆ operator()() [2/2]

template<class Node >
template<class Op >
void Aleph::For_Each_Preorder< Node >::operator() ( Node *  root,
Op &  op 
) const
inline

See traverse(Node * root, Op && op).

Definition at line 401 of file tpl_binNodeUtils.H.

References preorder, and root().

◆ preorder()

template<class Node >
template<class Op >
static void Aleph::For_Each_Preorder< Node >::preorder ( Node *  root,
Op &&  op 
)
inlinestaticprivate

Definition at line 381 of file tpl_binNodeUtils.H.

References LLINK, preorder, RLINK, and root().

◆ traverse()

template<class Node >
template<class Op >
void Aleph::For_Each_Preorder< Node >::traverse ( Node *  root,
Op &&  op 
) const
inline

Invoke the traversal.

Definition at line 394 of file tpl_binNodeUtils.H.

References preorder, and root().

Referenced by Aleph::for_each_preorder().


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