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

Lazy iterator over ordered key/value pairs. More...

#include <tpl_file_bplus_map.H>

Collaboration diagram for Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator:
[legend]

Public Member Functions

 Iterator () noexcept=default
 Construct an exhausted iterator.
 
 Iterator (typename tree_type::Iterator it) noexcept
 Wrap an underlying tree iterator.
 
bool has_curr () const noexcept
 Return whether the iterator still points to an item.
 
value_type get_curr () const
 Return the current key/value pair.
 
Key get_key () const
 Return the current key.
 
Value get_value () const
 Return the current mapped value.
 
void next_ne ()
 Advance to the next item.
 
void next ()
 Synonym for next_ne().
 

Private Attributes

tree_type::Iterator it_
 

Detailed Description

template<typename Key, typename Value, class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
class Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator

Lazy iterator over ordered key/value pairs.

The iterator wraps the backing tree iterator and converts records to pairs on demand. Any mutation of the owning map invalidates all iterators.

Definition at line 242 of file tpl_file_bplus_map.H.

Constructor & Destructor Documentation

◆ Iterator() [1/2]

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::Iterator ( )
defaultnoexcept

Construct an exhausted iterator.

Exceptions
Nothing.

◆ Iterator() [2/2]

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::Iterator ( typename tree_type::Iterator  it)
inlineexplicitnoexcept

Wrap an underlying tree iterator.

Parameters
itTree iterator to adapt.
Exceptions
Nothing.

Definition at line 256 of file tpl_file_bplus_map.H.

Member Function Documentation

◆ get_curr()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
value_type Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_curr ( ) const
inline

◆ get_key()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
Key Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_key ( ) const
inline

Return the current key.

Returns
Copy of the current key.
Exceptions
std::underflow_errorIf the iterator is exhausted.

Definition at line 281 of file tpl_file_bplus_map.H.

References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), and Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::it_.

◆ get_value()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
Value Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::get_value ( ) const
inline

Return the current mapped value.

Returns
Copy of the current mapped value.
Exceptions
std::underflow_errorIf the iterator is exhausted.

Definition at line 290 of file tpl_file_bplus_map.H.

References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::get_curr(), and Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::it_.

◆ has_curr()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
bool Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::has_curr ( ) const
inlinenoexcept

Return whether the iterator still points to an item.

Returns
true if there is a current key/value pair.
Exceptions
Nothing.

Definition at line 263 of file tpl_file_bplus_map.H.

References Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), and Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::it_.

Referenced by TEST().

◆ next()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
void Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::next ( )
inline

Synonym for next_ne().

Exceptions
std::underflow_errorIf the iterator is exhausted.

Definition at line 306 of file tpl_file_bplus_map.H.

References Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::next_ne().

◆ next_ne()

template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>>
void Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::Iterator::next_ne ( )
inline

Member Data Documentation

◆ it_


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