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

Preorder iterator on the nodes of a binary tree. More...

#include <tpl_binNodeUtils.H>

Collaboration diagram for Aleph::BinNodePrefixIterator< Node >:
[legend]

Public Member Functions

void swap (BinNodePrefixIterator &it) noexcept
 Swap thiswith it
 
 BinNodePrefixIterator ()=default
 
 BinNodePrefixIterator (Node *r) noexcept
 Initialize an iterator on the first node in preorder for the tree with root r
 
 BinNodePrefixIterator (const BinNodePrefixIterator &it)
 
 BinNodePrefixIterator (BinNodePrefixIterator &&it) noexcept
 
void reset_first () noexcept
 Reset the iterator to the first node in preorder sense.
 
void reset_last () noexcept
 Reset the iterator to the last node in preorder.
 
void end () noexcept
 Put the iterator in end state.
 
BinNodePrefixIteratoroperator= (const BinNodePrefixIterator &it)
 
BinNodePrefixIteratoroperator= (BinNodePrefixIterator &&it) noexcept
 
bool has_curr () const noexcept
 Return true if iterator has current node.
 
Nodeget_curr_ne () const noexcept
 Return the current link guaranteeing no exception. Be careful.
 
Nodeget_curr () const
 Return a pointer to current node.
 
void next_ne () noexcept
 Move the iterator one position forward guaranteeing no exception.
 
void next ()
 Move the iterator one position forward.
 

Static Private Member Functions

static Nodelast (Node *p) noexcept
 

Private Attributes

Noderoot = nullptr
 
Nodecurr = Node::NullPtr
 
ArrayStack< Node * > s
 

Detailed Description

template<class Node>
class Aleph::BinNodePrefixIterator< Node >

Preorder iterator on the nodes of a binary tree.

This class export a full iterator for the nodes of a binary tree where the visit order corresponds to a preorder sense.

Definition at line 2477 of file tpl_binNodeUtils.H.

Constructor & Destructor Documentation

◆ BinNodePrefixIterator() [1/4]

◆ BinNodePrefixIterator() [2/4]

Initialize an iterator on the first node in preorder for the tree with root r

Definition at line 2496 of file tpl_binNodeUtils.H.

◆ BinNodePrefixIterator() [3/4]

◆ BinNodePrefixIterator() [4/4]

Member Function Documentation

◆ end()

template<class Node >
void Aleph::BinNodePrefixIterator< Node >::end ( )
inlinenoexcept

◆ get_curr()

template<class Node >
Node * Aleph::BinNodePrefixIterator< Node >::get_curr ( ) const
inline

◆ get_curr_ne()

template<class Node >
Node * Aleph::BinNodePrefixIterator< Node >::get_curr_ne ( ) const
inlinenoexcept

Return the current link guaranteeing no exception. Be careful.

Definition at line 2575 of file tpl_binNodeUtils.H.

References Aleph::BinNodePrefixIterator< Node >::curr.

Referenced by Aleph::BinNodePrefixIterator< Node >::get_curr().

◆ has_curr()

template<class Node >
bool Aleph::BinNodePrefixIterator< Node >::has_curr ( ) const
inlinenoexcept

◆ last()

◆ next()

template<class Node >
void Aleph::BinNodePrefixIterator< Node >::next ( )
inline

◆ next_ne()

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ reset_first()

template<class Node >
void Aleph::BinNodePrefixIterator< Node >::reset_first ( )
inlinenoexcept

◆ reset_last()

◆ swap()

Member Data Documentation

◆ curr

◆ root

◆ s


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