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

Generic postorder 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
 
template<class Op >
void operator() (Node *root, Op &&op=Op()) const
 

Static Private Member Functions

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

Detailed Description

template<class Node>
class Aleph::For_Each_Postorder< Node >

Generic postorder traversal of a binary tree.

For_Each_Postorder 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 } };

Definition at line 361 of file tpl_binNodeUtils.H.

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 391 of file tpl_binNodeUtils.H.

References postorder, and root().

◆ operator()() [2/2]

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

Definition at line 384 of file tpl_binNodeUtils.H.

References postorder, and root().

◆ postorder()

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

Definition at line 364 of file tpl_binNodeUtils.H.

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

◆ traverse()

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

Invoke the traversal.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 377 of file tpl_binNodeUtils.H.

References postorder, and root().


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