|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Inorder iterator on the nodes of a binary tree. More...
#include <tpl_binNodeUtils.H>
Public Member Functions | |
| bool | is_in_first () const noexcept |
Return true if the iterator is on the first node. | |
| bool | is_last () const noexcept |
| void | swap (BinNodeInfixIterator &it) noexcept |
| BinNodeInfixIterator ()=default | |
| BinNodeInfixIterator (Node *r) noexcept | |
| Initialize an iterator on the first node inorder. | |
| BinNodeInfixIterator (const BinNodeInfixIterator &it) | |
| BinNodeInfixIterator (BinNodeInfixIterator &&it) noexcept | |
| void | reset_first () noexcept |
| Reset the iterator to the first node inorder. | |
| void | reset_last () noexcept |
| Reset the iterator to the first node inorder. | |
| void | end () noexcept |
| BinNodeInfixIterator & | operator= (const BinNodeInfixIterator &it) |
| BinNodeInfixIterator & | operator= (BinNodeInfixIterator &&it) noexcept |
| bool | has_curr () const noexcept |
Return true the iterator has current node. | |
| Node * | get_curr_ne () const noexcept |
| Return the current link guaranteeing no exception. Be careful. | |
| Node * | get_curr () const |
Return the current node. Throw overflow_error if there is no current. | |
| size_t | get_pos () const |
| Return the current position of iterator. Only valid if has_curr() == true. | |
| void | next_ne () noexcept |
| void | next () |
| Move the iterator one position forward. | |
Private Member Functions | |
| Node * | advance_to_min (Node *r) noexcept |
| void | init () noexcept |
Static Private Member Functions | |
| static Node * | advance_to_max (Node *r) noexcept |
Private Attributes | |
| Node * | root = Node::NullPtr |
| Node * | curr = Node::NullPtr |
| long | pos = 0 |
| ArrayStack< Node * > | s |
Inorder 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 inorder sense.
Definition at line 2684 of file tpl_binNodeUtils.H.
|
default |
|
inlinenoexcept |
Initialize an iterator on the first node inorder.
Definition at line 2739 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::init().
|
inline |
Definition at line 2745 of file tpl_binNodeUtils.H.
|
inlinenoexcept |
Definition at line 2751 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::swap().
|
inlinestaticprivatenoexcept |
Definition at line 2701 of file tpl_binNodeUtils.H.
References Aleph::RLINK().
Referenced by Aleph::BinNodeInfixIterator< Node >::reset_last().
|
inlineprivatenoexcept |
Definition at line 2691 of file tpl_binNodeUtils.H.
References Aleph::LLINK(), Aleph::ArrayStack< T >::push(), and Aleph::BinNodeInfixIterator< Node >::s.
Referenced by Aleph::BinNodeInfixIterator< Node >::init(), and Aleph::BinNodeInfixIterator< Node >::next_ne().
|
inlinenoexcept |
Definition at line 2775 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr, Aleph::ArrayStack< T >::empty(), Aleph::BinNodeInfixIterator< Node >::pos, and Aleph::BinNodeInfixIterator< Node >::s.
|
inline |
Return the current node. Throw overflow_error if there is no current.
Definition at line 2808 of file tpl_binNodeUtils.H.
References ah_overflow_error_if, Aleph::BinNodeInfixIterator< Node >::curr, Aleph::BinNodeInfixIterator< Node >::has_curr(), and Aleph::maps().
|
inlinenoexcept |
Return the current link guaranteeing no exception. Be careful.
Definition at line 2805 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr.
Referenced by TEST().
|
inline |
Return the current position of iterator. Only valid if has_curr() == true.
Definition at line 2815 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::pos.
|
inlinenoexcept |
Return true the iterator has current node.
Definition at line 2802 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr.
Referenced by Aleph::compute_min_cut(), Aleph::BinNodeInfixIterator< Node >::get_curr(), Aleph::infix_for_each(), Aleph::infix_traverse(), Aleph::Net_Graph< NodeT, ArcT >::make_super_sink(), Aleph::Net_Graph< NodeT, ArcT >::make_super_source(), Aleph::BinNodeInfixIterator< Node >::next(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), Aleph::Net_Graph< NodeT, ArcT >::total_sink_in_flow(), and Aleph::Net_Graph< NodeT, ArcT >::total_source_out_flow().
|
inlineprivatenoexcept |
Definition at line 2709 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::advance_to_min(), Aleph::BinNodeInfixIterator< Node >::curr, Aleph::BinNodeInfixIterator< Node >::pos, and Aleph::BinNodeInfixIterator< Node >::root.
Referenced by Aleph::BinNodeInfixIterator< Node >::BinNodeInfixIterator(), and Aleph::BinNodeInfixIterator< Node >::reset_first().
|
inlinenoexcept |
Return true if the iterator is on the first node.
Definition at line 2718 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr, Aleph::ArrayStack< T >::is_empty(), Aleph::LLINK(), Aleph::maps(), and Aleph::BinNodeInfixIterator< Node >::s.
|
inlinenoexcept |
Definition at line 2723 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr, Aleph::ArrayStack< T >::is_empty(), Aleph::maps(), Aleph::RLINK(), and Aleph::BinNodeInfixIterator< Node >::s.
|
inline |
Move the iterator one position forward.
Throw overflow_error if there is no current
Definition at line 2835 of file tpl_binNodeUtils.H.
References ah_overflow_error_if, Aleph::BinNodeInfixIterator< Node >::has_curr(), Aleph::maps(), and Aleph::BinNodeInfixIterator< Node >::next_ne().
|
inlinenoexcept |
Definition at line 2817 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::advance_to_min(), Aleph::BinNodeInfixIterator< Node >::curr, Aleph::ArrayStack< T >::is_empty(), Aleph::ArrayStack< T >::pop(), Aleph::BinNodeInfixIterator< Node >::pos, Aleph::RLINK(), and Aleph::BinNodeInfixIterator< Node >::s.
Referenced by Aleph::BinNodeInfixIterator< Node >::next(), and TEST().
|
inlinenoexcept |
Definition at line 2794 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::swap().
|
inline |
Definition at line 2782 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr, Aleph::BinNodeInfixIterator< Node >::pos, Aleph::BinNodeInfixIterator< Node >::root, and Aleph::BinNodeInfixIterator< Node >::s.
|
inlinenoexcept |
Reset the iterator to the first node inorder.
Definition at line 2754 of file tpl_binNodeUtils.H.
References Aleph::ArrayStack< T >::empty(), Aleph::BinNodeInfixIterator< Node >::init(), and Aleph::BinNodeInfixIterator< Node >::s.
|
inlinenoexcept |
Reset the iterator to the first node inorder.
Definition at line 2761 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::advance_to_max(), Aleph::BinNodeInfixIterator< Node >::curr, Aleph::ArrayStack< T >::empty(), Aleph::BinNodeInfixIterator< Node >::pos, Aleph::BinNodeInfixIterator< Node >::root, Aleph::BinNodeInfixIterator< Node >::s, and Aleph::size().
|
inlinenoexcept |
Definition at line 2728 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::curr, Aleph::BinNodeInfixIterator< Node >::pos, Aleph::BinNodeInfixIterator< Node >::root, Aleph::BinNodeInfixIterator< Node >::s, and Aleph::ArrayStack< T >::swap().
Referenced by Aleph::BinNodeInfixIterator< Node >::BinNodeInfixIterator(), and Aleph::BinNodeInfixIterator< Node >::operator=().
|
private |
Definition at line 2687 of file tpl_binNodeUtils.H.
Referenced by Aleph::BinNodeInfixIterator< Node >::end(), Aleph::BinNodeInfixIterator< Node >::get_curr(), Aleph::BinNodeInfixIterator< Node >::get_curr_ne(), Aleph::BinNodeInfixIterator< Node >::has_curr(), Aleph::BinNodeInfixIterator< Node >::init(), Aleph::BinNodeInfixIterator< Node >::is_in_first(), Aleph::BinNodeInfixIterator< Node >::is_last(), Aleph::BinNodeInfixIterator< Node >::next_ne(), Aleph::BinNodeInfixIterator< Node >::operator=(), Aleph::BinNodeInfixIterator< Node >::reset_last(), and Aleph::BinNodeInfixIterator< Node >::swap().
|
private |
Definition at line 2688 of file tpl_binNodeUtils.H.
Referenced by Aleph::BinNodeInfixIterator< Node >::end(), Aleph::BinNodeInfixIterator< Node >::get_pos(), Aleph::BinNodeInfixIterator< Node >::init(), Aleph::BinNodeInfixIterator< Node >::next_ne(), Aleph::BinNodeInfixIterator< Node >::operator=(), Aleph::BinNodeInfixIterator< Node >::reset_last(), and Aleph::BinNodeInfixIterator< Node >::swap().
|
mutableprivate |
Definition at line 2686 of file tpl_binNodeUtils.H.
Referenced by Aleph::BinNodeInfixIterator< Node >::init(), Aleph::BinNodeInfixIterator< Node >::operator=(), Aleph::BinNodeInfixIterator< Node >::reset_last(), and Aleph::BinNodeInfixIterator< Node >::swap().
|
private |
Definition at line 2689 of file tpl_binNodeUtils.H.
Referenced by Aleph::BinNodeInfixIterator< Node >::advance_to_min(), Aleph::BinNodeInfixIterator< Node >::end(), Aleph::BinNodeInfixIterator< Node >::is_in_first(), Aleph::BinNodeInfixIterator< Node >::is_last(), Aleph::BinNodeInfixIterator< Node >::next_ne(), Aleph::BinNodeInfixIterator< Node >::operator=(), Aleph::BinNodeInfixIterator< Node >::reset_first(), Aleph::BinNodeInfixIterator< Node >::reset_last(), and Aleph::BinNodeInfixIterator< Node >::swap().