|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Lazy iterator over ordered keys stored in leaf pages. More...
#include <tpl_file_bplus_tree.H>
Public Member Functions | |
| Iterator () noexcept=default | |
| Construct an empty iterator. | |
| Iterator (const tree_type &tree) noexcept | |
| Construct an iterator over the full key order. | |
| Iterator (const tree_type &tree, const Key &first, const Key &last) | |
Construct an iterator over the inclusive range [first, last]. | |
| bool | has_curr () const noexcept |
| Return whether the iterator still points to a key. | |
| const Key & | get_curr () const |
| Return the current key. | |
| void | next_ne () |
| Advance to the next key. | |
| void | next () |
| Synonym for next_ne(). | |
| const Key & | operator* () const |
| Dereference the iterator. | |
| const Key * | operator-> () const |
| Member-access shorthand for the current key. | |
Private Member Functions | |
| void | skip_past_end () |
Private Attributes | |
| const tree_type * | tree_ = nullptr |
| page_id_t | leaf_id_ = 0 |
| size_t | idx_ = 0 |
| std::optional< Key > | last_ |
Lazy iterator over ordered keys stored in leaf pages.
The iterator walks the leaf chain directly and therefore avoids materializing an intermediate Array<Key>. Any mutation of the owning tree invalidates all iterators.
Definition at line 2160 of file tpl_file_bplus_tree.H.
|
defaultnoexcept |
Construct an empty iterator.
| Nothing. |
|
inlineexplicitnoexcept |
Construct an iterator over the full key order.
| tree | Tree whose leaves will be traversed. |
| Nothing. |
Definition at line 2198 of file tpl_file_bplus_tree.H.
References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
|
inline |
Construct an iterator over the inclusive range [first, last].
| tree | Tree whose leaves will be traversed. |
| first | Lower bound, inclusive. |
| last | Upper bound, inclusive. |
| std::invalid_argument | If last < first. |
| Any | exception propagated by Compare. |
Definition at line 2211 of file tpl_file_bplus_tree.H.
References ah_invalid_argument_if, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::cmp_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::find_leaf_page(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::idx_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::leaf_id_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::lower_bound_index(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::page(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
|
inline |
Return the current key.
| std::underflow_error | If the iterator is exhausted. |
Definition at line 2237 of file tpl_file_bplus_tree.H.
References ah_underflow_error_if, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::idx_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Page::keys, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::leaf_id_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::page(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::tree_.
Referenced by Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_curr(), Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_key(), Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_value(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::operator*(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::operator->().
|
inlinenoexcept |
Return whether the iterator still points to a key.
true if there is a current key, otherwise false. | Nothing. |
Definition at line 2228 of file tpl_file_bplus_tree.H.
References Aleph::and, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::leaf_id_, and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::tree_.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::has_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::keys(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next_ne(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::range(), and TEST().
|
inline |
Synonym for next_ne().
| std::underflow_error | If the iterator is exhausted. |
| Any | exception propagated by Compare. |
Definition at line 2260 of file tpl_file_bplus_tree.H.
References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next_ne().
|
inline |
Advance to the next key.
| std::underflow_error | If the iterator is exhausted. |
| Any | exception propagated by Compare. |
Definition at line 2248 of file tpl_file_bplus_tree.H.
References ah_underflow_error_if, Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::idx_, and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next(), and Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::next_ne().
|
inline |
Dereference the iterator.
| std::underflow_error | If the iterator is exhausted. |
Definition at line 2269 of file tpl_file_bplus_tree.H.
References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr().
|
inline |
Member-access shorthand for the current key.
| std::underflow_error | If the iterator is exhausted. |
Definition at line 2278 of file tpl_file_bplus_tree.H.
References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr().
|
inlineprivate |
Definition at line 2167 of file tpl_file_bplus_tree.H.
References Aleph::and, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::cmp_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::idx_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::last_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::leaf_id_, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Page::link, Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::page(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::tree_.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next_ne().
|
private |
Definition at line 2164 of file tpl_file_bplus_tree.H.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next_ne(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
|
private |
Definition at line 2165 of file tpl_file_bplus_tree.H.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
|
private |
Definition at line 2163 of file tpl_file_bplus_tree.H.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().
|
private |
Definition at line 2162 of file tpl_file_bplus_tree.H.
Referenced by Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), and Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end().