Thrill  0.1
BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::iterator Class Reference

Detailed Description

template<typename Key, typename Value, typename KeyOfValue, typename Compare = std::less<Key>, typename Traits = btree_default_traits<Key, Value>, bool Duplicates = false, typename Allocator = std::allocator<Value>>
class tlx::BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::iterator

STL-like iterator object for B+ tree items. The iterator points to a specific slot number in a leaf.

Definition at line 333 of file btree.hpp.

+ Collaboration diagram for BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::iterator:

#include <btree.hpp>

Public Types

typedef ptrdiff_t difference_type
 STL-magic. More...
 
typedef std::bidirectional_iterator_tag iterator_category
 STL-magic iterator category. More...
 
typedef BTree::key_type key_type
 The key type of the btree. Returned by key(). More...
 
typedef value_typepointer
 Pointer to the value_type. STL required. More...
 
typedef value_typereference
 Reference to the value_type. STL required. More...
 
typedef iterator self
 Our own type. More...
 
typedef BTree::value_type value_type
 The value type of the btree. Returned by operator*(). More...
 

Public Member Functions

 iterator ()
 Default-Constructor of a mutable iterator. More...
 
 iterator (typename BTree::LeafNode *l, unsigned short s)
 Initializing-Constructor of a mutable iterator. More...
 
 iterator (const reverse_iterator &it)
 Copy-constructor from a reverse iterator. More...
 
const key_typekey () const
 Key of the current slot. More...
 
bool operator!= (const iterator &x) const
 Inequality of iterators. More...
 
reference operator* () const
 Dereference the iterator. More...
 
iteratoroperator++ ()
 Prefix++ advance the iterator to the next slot. More...
 
iterator operator++ (int)
 Postfix++ advance the iterator to the next slot. More...
 
iteratoroperator-- ()
 Prefix– backstep the iterator to the last slot. More...
 
iterator operator-- (int)
 Postfix– backstep the iterator to the last slot. More...
 
pointer operator-> () const
 Dereference the iterator. More...
 
bool operator== (const iterator &x) const
 Equality of iterators. More...
 

Private Attributes

BTree::LeafNodecurr_leaf
 The currently referenced leaf node of the tree. More...
 
unsigned short curr_slot
 Current key/data slot referenced. More...
 

Member Typedef Documentation

◆ difference_type

typedef ptrdiff_t difference_type

STL-magic.

Definition at line 354 of file btree.hpp.

◆ iterator_category

typedef std::bidirectional_iterator_tag iterator_category

STL-magic iterator category.

Definition at line 351 of file btree.hpp.

◆ key_type

The key type of the btree. Returned by key().

Definition at line 339 of file btree.hpp.

◆ pointer

typedef value_type* pointer

Pointer to the value_type. STL required.

Definition at line 348 of file btree.hpp.

◆ reference

Reference to the value_type. STL required.

Definition at line 345 of file btree.hpp.

◆ self

typedef iterator self

Our own type.

Definition at line 357 of file btree.hpp.

◆ value_type

The value type of the btree. Returned by operator*().

Definition at line 342 of file btree.hpp.

Constructor & Destructor Documentation

◆ iterator() [1/3]

iterator ( )
inline

Default-Constructor of a mutable iterator.

Definition at line 394 of file btree.hpp.

◆ iterator() [2/3]

iterator ( typename BTree::LeafNode l,
unsigned short  s 
)
inline

Initializing-Constructor of a mutable iterator.

Definition at line 399 of file btree.hpp.

◆ iterator() [3/3]

iterator ( const reverse_iterator it)
inline

Copy-constructor from a reverse iterator.

Definition at line 404 of file btree.hpp.

Member Function Documentation

◆ key()

const key_type& key ( ) const
inline

Key of the current slot.

Definition at line 419 of file btree.hpp.

References BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode::key().

◆ operator!=()

◆ operator*()

reference operator* ( ) const
inline

Dereference the iterator.

Definition at line 409 of file btree.hpp.

References BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode::slotdata.

◆ operator++() [1/2]

◆ operator++() [2/2]

◆ operator--() [1/2]

◆ operator--() [2/2]

◆ operator->()

pointer operator-> ( ) const
inline

Dereference the iterator.

Definition at line 414 of file btree.hpp.

References BTree< Key, Value, KeyOfValue, Compare, Traits, Duplicates, Allocator >::LeafNode::slotdata.

◆ operator==()

Member Data Documentation

◆ curr_leaf

◆ curr_slot


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