13 #ifndef STXXL_CONTAINERS_BTREE_ITERATOR_HEADER
14 #define STXXL_CONTAINERS_BTREE_ITERATOR_HEADER
26 template <
class BTreeType>
28 template <
class BTreeType>
30 template <
class BTreeType>
32 template <
class KeyType_,
class DataType_,
class KeyCmp_,
unsigned LogNElem_,
class BTreeType>
35 template <
class BTreeType>
40 typedef typename btree_type::leaf_bid_type
bid_type;
48 template <
class KeyType_,
class DataType_,
49 class KeyCmp_,
unsigned LogNElem_,
class BTreeType__>
52 template <
class BTreeType_>
55 template <
class BTreeType_>
74 ) : btree_(btree__), bid(b), pos(p)
76 STXXL_VERBOSE3(
"btree_iterator_base parameter construct addr=" <<
this);
77 btree_->iterator_map_.register_iterator(*
this);
88 STXXL_VERBOSE3(
"btree_iterator_base constr from" << (&obj) <<
" to " <<
this);
93 btree_->iterator_map_.register_iterator(*
this);
98 STXXL_VERBOSE3(
"btree_iterator_base copy from" << (&obj) <<
" to " <<
this);
102 btree_->iterator_map_.unregister_iterator(*
this);
108 btree_->iterator_map_.register_iterator(*
this);
116 typename btree_type::leaf_type * Leaf = btree_->leaf_cache_.get_node(bid);
124 typename btree_type::leaf_type
const* Leaf = btree_->leaf_cache_.get_const_node(bid);
131 return bid == obj.
bid && pos == obj.
pos && btree_ == obj.
btree_;
136 return bid != obj.
bid || pos != obj.
pos || btree_ != obj.
btree_;
143 typename btree_type::leaf_type
const* Leaf = btree_->leaf_cache_.get_const_node(bid,
true);
145 Leaf->increment_iterator(*
this);
146 btree_->leaf_cache_.unfix_node(cur_bid);
154 typename btree_type::leaf_type
const* Leaf = btree_->leaf_cache_.get_const_node(bid,
true);
156 Leaf->decrement_iterator(*
this);
157 btree_->leaf_cache_.unfix_node(cur_bid);
166 btree_->iterator_map_.unregister_iterator(*
this);
170 template <
class BTreeType>
171 class btree_iterator :
public btree_iterator_base<BTreeType>
175 typedef typename btree_type::leaf_bid_type
bid_type;
181 template <
class KeyType_,
class DataType_,
182 class KeyCmp_,
unsigned LogNElem_,
class BTreeType__>
202 return non_const_access();
207 return &(non_const_access());
257 template <
class BTreeType>
258 class btree_const_iterator :
public btree_iterator_base<BTreeType>
264 typedef typename btree_type::leaf_bid_type
bid_type;
267 typedef typename btree_type::const_pointer
pointer;
269 template <
class KeyType_,
class DataType_,
270 class KeyCmp_,
unsigned LogNElem_,
class BTreeType__>
294 return const_access();
299 return &(const_access());
360 template <
class BTreeType>
364 return a.btree_iterator_base<BTreeType>::operator == (b);
367 template <
class BTreeType>
371 return a.btree_iterator_base<BTreeType>::operator != (b);
378 #endif // !STXXL_CONTAINERS_BTREE_ITERATOR_HEADER
btree_type::const_pointer pointer
btree_type::pointer pointer
btree_iterator(btree_type *btree__, const bid_type &b, unsigned p)
btree_type::reference reference
btree_type::value_type value_type
std::bidirectional_iterator_tag iterator_category
btree_type::leaf_bid_type bid_type
btree_type::leaf_bid_type bid_type
btree_type::const_reference const_reference
btree_const_iterator(const btree_const_iterator &obj)
uint_pair & operator++()
prefix increment operator (directly manipulates the integer parts)
btree_const_iterator(const iterator &obj)
bool operator!=(const uint_pair &b) const
inequality checking operator
#define STXXL_VERBOSE3(x)
btree_type::difference_type difference_type
btree_type::value_type value_type
btree_iterator_base(btree_type *btree__, const bid_type &b, unsigned p)
#define STXXL_BEGIN_NAMESPACE
uint_pair & operator--()
prefix decrement operator (directly manipulates the integer parts)
btree_type::value_type value_type
btree_iterator_base & decrement()
btree_iterator(const btree_iterator &obj)
btree_iterator< BTreeType > iterator
btree_type::const_reference reference
reference non_const_access()
btree_type::const_reference const_reference
const_reference const_access() const
virtual ~btree_iterator_base()
btree_const_iterator(btree_type *btree__, const bid_type &b, unsigned p)
btree_type::reference reference
btree_iterator_base & increment()
bool operator==(const uint_pair &b) const
equality checking operator
#define STXXL_END_NAMESPACE
btree_type::leaf_bid_type bid_type
btree_iterator_base(const btree_iterator_base &obj)