Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator Class Reference

Lazy iterator over ordered keys stored in leaf pages. More...

#include <tpl_file_bplus_tree.H>

Collaboration diagram for Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator:
[legend]

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_typetree_ = nullptr
 
page_id_t leaf_id_ = 0
 
size_t idx_ = 0
 
std::optional< Key > last_
 

Detailed Description

template<typename Key, class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
class Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator

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.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator ( )
defaultnoexcept

Construct an empty iterator.

Exceptions
Nothing.

◆ Iterator() [2/3]

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator ( const tree_type tree)
inlineexplicitnoexcept

Construct an iterator over the full key order.

Parameters
treeTree whose leaves will be traversed.
Exceptions
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().

◆ Iterator() [3/3]

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::Iterator ( const tree_type tree,
const Key &  first,
const Key &  last 
)
inline

Member Function Documentation

◆ get_curr()

◆ has_curr()

◆ next()

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
void Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::next ( )
inline

Synonym for next_ne().

Exceptions
std::underflow_errorIf the iterator is exhausted.
Anyexception 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().

◆ next_ne()

◆ operator*()

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
const Key & Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::operator* ( ) const
inline

Dereference the iterator.

Returns
Reference to the current key.
Exceptions
std::underflow_errorIf 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().

◆ operator->()

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
const Key * Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::operator-> ( ) const
inline

Member-access shorthand for the current key.

Returns
Pointer to the current key.
Exceptions
std::underflow_errorIf 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().

◆ skip_past_end()

Member Data Documentation

◆ idx_

◆ last_

template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>>
std::optional<Key> Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::last_
private

◆ leaf_id_

◆ tree_


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