stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator Class Reference

STL-like iterator object for B+ tree items. More...

#include <btree.h>

List of all members.

Public Types

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

Public Member Functions

 iterator (typename btree::leaf_node *l, unsigned short s)
 Constructor of a mutable iterator.
reference operator * () const
 Dereference the iterator, this is not a value_type& because key and value are not stored together.
pointer operator-> () const
 Dereference the iterator.
const key_typekey () const
 Key of the current slot.
data_typedata () const
 Writable reference to the current data object.
selfoperator++ ()
 Prefix++ advance the iterator to the next slot.
self operator++ (int)
 Postfix++ advance the iterator to the next slot.
selfoperator-- ()
 Prefix-- backstep the iterator to the last slot.
self operator-- (int)
 Postfix-- backstep the iterator to the last slot.
bool operator== (const self &x) const
 Equality of iterators.
bool operator!= (const self &x) const
 Inequality of iterators.

Friends

class btree< key_type, data_type, value_type, key_compare, traits, allow_duplicates >::const_iterator
 Friendly to the const_iterator, so it may access the two data items directly.


Detailed Description

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
class stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator

STL-like iterator object for B+ tree items.

The iterator points to a specific slot number in a leaf.

Definition at line 352 of file btree.h.


Member Typedef Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree::key_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::key_type

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

Definition at line 358 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree::data_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::data_type

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

Definition at line 361 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree::value_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::value_type

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

Definition at line 364 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef btree::pair_type stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::pair_type

The pair type of the btree.

Definition at line 367 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef value_type& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::reference

Reference to the value_type. Required by the reverse_iterator.

Definition at line 370 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef value_type* stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::pointer

Pointer to the value_type. Required by the reverse_iterator.

Definition at line 373 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef std::bidirectional_iterator_tag stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::iterator_category

STL-magic iterator category.

Definition at line 376 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef ptrdiff_t stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::difference_type

STL-magic.

Definition at line 379 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
typedef iterator stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::self

Our own type.

Definition at line 382 of file btree.h.


Constructor & Destructor Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::iterator ( typename btree::leaf_node *  l,
unsigned short  s 
) [inline]

Constructor of a mutable iterator.

Definition at line 404 of file btree.h.


Member Function Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
reference stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator * (  )  const [inline]

Dereference the iterator, this is not a value_type& because key and value are not stored together.

Definition at line 410 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
pointer stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator-> (  )  const [inline]

Dereference the iterator.

Do not use this if possible, use key() and data() instead. The B+ tree does not stored key and data together.

Definition at line 420 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
const key_type& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::key (  )  const [inline]

Key of the current slot.

Definition at line 428 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
data_type& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::data (  )  const [inline]

Writable reference to the current data object.

Definition at line 434 of file btree.h.

Referenced by stx::btree_map< _Key, _Data, _Compare, _Traits >::operator[]().

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
self& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator++ (  )  [inline]

Prefix++ advance the iterator to the next slot.

Definition at line 440 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
self stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator++ ( int   )  [inline]

Postfix++ advance the iterator to the next slot.

Definition at line 458 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
self& stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator-- (  )  [inline]

Prefix-- backstep the iterator to the last slot.

Definition at line 478 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
self stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator-- ( int   )  [inline]

Postfix-- backstep the iterator to the last slot.

Definition at line 496 of file btree.h.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator== ( const self x  )  const [inline]

Equality of iterators.

Definition at line 516 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::currnode, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::currslot.

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
bool stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::operator!= ( const self x  )  const [inline]

Inequality of iterators.

Definition at line 522 of file btree.h.

References stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::currnode, and stx::btree< _Key, _Data, _Value, _Compare, _Traits, _Duplicates >::iterator::currslot.


Friends And Related Function Documentation

template<typename _Key, typename _Data, typename _Value = std::pair<_Key, _Data>, typename _Compare = std::less<_Key>, typename _Traits = btree_default_map_traits<_Key, _Data>, bool _Duplicates = false>
friend class btree< key_type, data_type, value_type, key_compare, traits, allow_duplicates >::const_iterator [friend]

Friendly to the const_iterator, so it may access the two data items directly.

Definition at line 394 of file btree.h.


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 14:49:56 2007 for STX B+ Tree Template Classes by  doxygen 1.5.2