|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Base iterator template for ranked binary search trees. More...
#include <tpl_binNodeXt.H>
Public Member Functions | |
| BinTreeXt_Iterator () noexcept | |
| BinTreeXt_Iterator (const TreeType &__tree) noexcept | |
| BinTreeXt_Iterator (const TreeType &__tree, Node *__curr) noexcept | |
| BinTreeXt_Iterator (const TreeType &__tree, const size_t pos) noexcept | |
| BinTreeXt_Iterator (const BinTreeXt_Iterator &itor) noexcept | |
| BinTreeXt_Iterator & | operator= (const BinTreeXt_Iterator &itor) noexcept |
| void | reset_first () noexcept |
| void | reset_last () noexcept |
| void | end () noexcept |
| void | reset_to_key (const Key &key) noexcept |
| void | reset_to_node (Node *node) noexcept |
| void | reset_to_pos (const size_t pos) noexcept |
| Node * | get_curr_ne () const noexcept |
| Node * | get_curr () const noexcept |
| size_t | get_current_position () const |
| size_t | get_pos () const |
| bool | has_curr () const noexcept |
| void | prev () |
| void | next_ne () noexcept |
| void | next () |
| Node * | del () |
| bool | operator== (const BinTreeXt_Iterator &itor) const noexcept |
| bool | operator!= (const BinTreeXt_Iterator &itor) const |
Protected Attributes | |
| TreeType * | tree_ptr |
| Node * | curr |
| int | curr_pos |
Static Protected Attributes | |
| static constexpr int | Pos_Not_Current = -1 |
| static constexpr int | Pos_Empty_Container = -2 |
| static constexpr int | Pos_Not_Updated = -3 |
Private Member Functions | |
| bool | is_container_empty () const noexcept |
| bool | pos_updated () const noexcept |
| bool | curr_updated () const noexcept |
| void | update_pos () const noexcept |
| void | update_curr () const noexcept |
Base iterator template for ranked binary search trees.
This template provides a common implementation for iterators on trees that support O(log n) select and position operations via subtree counters.
The TreeType must provide:
| TreeType | the tree class type |
| Node | the node type |
| Key | the key type |
| Compare | comparison functor |
Definition at line 1037 of file tpl_binNodeXt.H.
|
inlinenoexcept |
Definition at line 1086 of file tpl_binNodeXt.H.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1096 of file tpl_binNodeXt.H.
|
inlinenoexcept |
Definition at line 1101 of file tpl_binNodeXt.H.
|
inlinenoexcept |
Definition at line 1106 of file tpl_binNodeXt.H.
|
inlineprivatenoexcept |
Definition at line 1061 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::del(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_curr_ne(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==().
|
inline |
Definition at line 1212 of file tpl_binNodeXt.H.
References ah_underflow_error_if, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), KEY, Aleph::maps(), Aleph::DynList< T >::remove(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr().
|
inlinenoexcept |
Definition at line 1135 of file tpl_binNodeXt.H.
References put_itor_at_the_end().
|
inlinenoexcept |
Definition at line 1165 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_curr_ne().
|
inlinenoexcept |
Definition at line 1158 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_updated(), Aleph::maps(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr().
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_curr().
|
inline |
Definition at line 1170 of file tpl_binNodeXt.H.
References ah_range_error_if, Aleph::COUNT(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::maps(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::pos_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_pos().
|
inline |
Definition at line 1182 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_current_position().
|
inlinenoexcept |
Definition at line 1184 of file tpl_binNodeXt.H.
References Aleph::COUNT(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::maps(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::pos_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::del(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::next(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::prev().
|
inlineprivatenoexcept |
Definition at line 1051 of file tpl_binNodeXt.H.
References Aleph::COUNT(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::BinTreeXt_Iterator(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_first(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_last().
|
inline |
Definition at line 1206 of file tpl_binNodeXt.H.
References ah_overflow_error_if, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), Aleph::maps(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::next_ne().
|
inlinenoexcept |
Definition at line 1200 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::next().
|
inline |
Definition at line 1246 of file tpl_binNodeXt.H.
References Aleph::maps().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1225 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::is_container_empty(), Aleph::maps(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::pos_updated(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().
|
inlineprivatenoexcept |
Definition at line 1056 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Not_Updated.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_current_position(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==().
|
inline |
Definition at line 1193 of file tpl_binNodeXt.H.
References ah_underflow_error_if, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), and Aleph::maps().
|
inlinenoexcept |
Definition at line 1122 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::is_container_empty(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Empty_Container.
|
inlinenoexcept |
Definition at line 1128 of file tpl_binNodeXt.H.
References Aleph::COUNT(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::is_container_empty(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Empty_Container, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr.
|
inlinenoexcept |
Definition at line 1140 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1152 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos.
|
inlineprivatenoexcept |
Definition at line 1073 of file tpl_binNodeXt.H.
References Aleph::COUNT(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::maps(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Empty_Container, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Not_Current, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::Pos_Not_Updated, Aleph::select(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::del(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_curr_ne().
|
inlineprivatenoexcept |
Definition at line 1066 of file tpl_binNodeXt.H.
References Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr, Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_pos, Aleph::inorder_position(), KEY, Aleph::maps(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::tree_ptr.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_current_position(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==().
|
mutableprotected |
Definition at line 1042 of file tpl_binNodeXt.H.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::curr_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::del(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_curr_ne(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::next_ne(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator=(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::prev(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_first(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_last(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_node(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_pos(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().
|
mutableprotected |
Definition at line 1043 of file tpl_binNodeXt.H.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::BinTreeXt_Iterator(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_current_position(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::next_ne(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator=(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::pos_updated(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::prev(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_first(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_last(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_key(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_node(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_pos(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().
|
staticconstexprprotected |
Definition at line 1046 of file tpl_binNodeXt.H.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::BinTreeXt_Iterator(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_first(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_last(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr().
|
staticconstexprprotected |
Definition at line 1045 of file tpl_binNodeXt.H.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr().
|
staticconstexprprotected |
|
mutableprotected |
Definition at line 1041 of file tpl_binNodeXt.H.
Referenced by Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::del(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::get_current_position(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::is_container_empty(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator=(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_last(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::reset_to_key(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_curr(), and Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::update_pos().