Base Framework
Public Member Functions | List of all members
PostfixOrderEnumerator< TRAITS > Class Template Reference

Postfix order enumerator. More...

#include <base/collection/BinaryTree.h>

Inherits Enumerator< TRAITS >.

Public Member Functions

 PostfixOrderEnumerator (Pointer _node) noexcept
 
bool hasNext () const noexcept
 
Reference next ()
 
- Public Member Functions inherited from Enumerator< TRAITS >
virtual ~Enumerator ()
 

Additional Inherited Members

- Public Types inherited from Enumerator< TRAITS >
typedef TRAITS::Value Value
 
typedef TRAITS::Distance Distance
 
typedef TRAITS::Reference Reference
 
typedef TRAITS::Pointer Pointer
 

Detailed Description

template<class TRAITS>
class PostfixOrderEnumerator< TRAITS >

Postfix order enumerator.

Enumeration of all the elements of a binary tree traversed in postfix order.

Constructor & Destructor Documentation

◆ PostfixOrderEnumerator()

template<class TRAITS >
PostfixOrderEnumerator< TRAITS >::PostfixOrderEnumerator ( Pointer  _node)
inlinenoexcept

Initializes enumeration of binary tree specified by the node.

Parameters
nodeThe root node of the binary tree.

Member Function Documentation

◆ hasNext()

template<class TRAITS >
bool PostfixOrderEnumerator< TRAITS >::hasNext ( ) const
inlinevirtualnoexcept

Returns true if there is more elements in this enumeration.

Implements Enumerator< TRAITS >.

◆ next()

template<class TRAITS >
Reference PostfixOrderEnumerator< TRAITS >::next ( )
inlinevirtual

Returns the current value and increments the position. Raises EndOfEnumeration if the end has been reached.

Implements Enumerator< TRAITS >.