41 #ifndef PB_DS_OV_TREE_NODE_ITERATORS_HPP
42 #define PB_DS_OV_TREE_NODE_ITERATORS_HPP
52 #define PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC \
53 ov_tree_node_const_it_<Value_Type, Metadata_Type, _Alloc>
56 template<
typename Value_Type,
typename Metadata_Type,
typename _Alloc>
62 typename _Alloc::template rebind<
63 Value_Type>::other::pointer
67 typename _Alloc::template rebind<
68 Value_Type>::other::const_pointer
72 typename _Alloc::template rebind<
73 Metadata_Type>::other::const_pointer
80 template<
typename Ptr>
85 return (p_begin + (p_end - p_begin) / 2);
95 typename _Alloc::template rebind<
96 Value_Type>::other::const_pointer
100 typename _Alloc::template rebind<
101 typename remove_const<
102 Value_Type>::type>::other::const_pointer
106 typename _Alloc::template rebind<
107 typename remove_const<
108 Value_Type>::type>::other::const_pointer
114 typename _Alloc::template rebind<
132 has_metadata = !is_same<Metadata_Type, null_type>::value
176 const bool is_other_end = other.m_p_begin_value == other.m_p_end_value;
179 return (is_other_end);
199 #define PB_DS_OV_TREE_NODE_ITERATOR_C_DEC \
200 ov_tree_node_it_<Value_Type, Metadata_Type, _Alloc>
203 template<
typename Value_Type,
typename Metadata_Type,
typename _Alloc>
216 typename base_type::const_metadata_pointer
225 typename _Alloc::template rebind<
226 Value_Type>::other::pointer
230 typename _Alloc::template rebind<
231 typename remove_const<
232 Value_Type>::type>::other::pointer
236 typename _Alloc::template rebind<
237 typename remove_const<
238 Value_Type>::type>::other::pointer
248 {
return reference(base_type::m_p_value); }
254 if (base_type::m_p_begin_value == base_type::m_p_value)
255 return (
this_type(base_type::m_p_begin_value, base_type::m_p_begin_value, base_type::m_p_begin_value));
258 base_type::m_p_metadata - (base_type::m_p_value - base_type::m_p_begin_value);
260 return (
this_type(base_type::mid_pointer(base_type::m_p_begin_value, base_type::m_p_value),
261 base_type::m_p_begin_value,
262 base_type::m_p_value,
263 base_type::mid_pointer(p_begin_metadata, base_type::m_p_metadata)));
270 if (base_type::m_p_value == base_type::m_p_end_value)
271 return this_type(base_type::m_p_end_value, base_type::m_p_end_value,
272 base_type::m_p_end_value);
275 base_type::m_p_metadata + (base_type::m_p_end_value - base_type::m_p_value);
277 return (
this_type(base_type::mid_pointer(base_type::m_p_value + 1, base_type::m_p_end_value),
278 base_type::m_p_value + 1,
279 base_type::m_p_end_value,(base_type::m_p_metadata == 0)?
280 0 : base_type::mid_pointer(base_type::m_p_metadata + 1, p_end_metadata)));
285 #undef PB_DS_OV_TREE_NODE_ITERATOR_C_DEC
286 #undef PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
_Alloc::template rebind< typename remove_const< Value_Type >::type >::other::const_pointer const_reference
Definition: node_iterators.hpp:109
const_metadata_pointer m_p_metadata
Definition: node_iterators.hpp:196
bool operator!=(const this_type &other) const
Definition: node_iterators.hpp:188
_Alloc::template rebind< typename remove_const< Value_Type >::type >::other::pointer reference
Definition: node_iterators.hpp:233
bool operator==(const this_type &other) const
Definition: node_iterators.hpp:173
const_reference operator*() const
Definition: node_iterators.hpp:124
trivial_iterator_difference_type difference_type
Definition: node_iterators.hpp:92
reference operator*() const
Access.
Definition: node_iterators.hpp:247
metadata_const_reference get_metadata() const
Definition: node_iterators.hpp:128
ov_tree_node_it_ get_l_child() const
Returns the node reference associated with the left node.
Definition: node_iterators.hpp:252
#define PB_DS_OV_TREE_NODE_ITERATOR_C_DEC
Definition: node_iterators.hpp:199
static Ptr mid_pointer(Ptr p_begin, Ptr p_end)
Definition: node_iterators.hpp:82
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
_Alloc::template rebind< typename remove_const< Value_Type >::type >::other::const_pointer reference
Definition: node_iterators.hpp:103
_Alloc::template rebind< Value_Type >::other::const_pointer const_pointer
Definition: node_iterators.hpp:69
#define PB_DS_STATIC_ASSERT(UNIQUE, E)
Definition: type_utils.hpp:154
Const node reference.
Definition: node_iterators.hpp:57
base_type::pointer pointer
Definition: node_iterators.hpp:211
#define PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC
Definition: node_iterators.hpp:52
Metadata_Type metadata_type
Definition: node_iterators.hpp:111
this_type get_r_child() const
Returns the node iterator associated with the right node.
Definition: node_iterators.hpp:158
trivial_iterator_tag iterator_category
Definition: node_iterators.hpp:220
_Alloc::template rebind< Value_Type >::other::const_pointer value_type
Definition: node_iterators.hpp:97
_Alloc::template rebind< typename remove_const< Value_Type >::type >::other::pointer const_reference
Definition: node_iterators.hpp:239
PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC this_type
Definition: node_iterators.hpp:76
_Alloc::template rebind< Metadata_Type >::other::const_pointer const_metadata_pointer
Definition: node_iterators.hpp:74
pointer m_p_begin_value
Definition: node_iterators.hpp:193
this_type get_l_child() const
Returns the node iterator associated with the left node.
Definition: node_iterators.hpp:142
base_type::const_metadata_pointer const_metadata_pointer
Definition: node_iterators.hpp:217
_Alloc::template rebind< Value_Type >::other::pointer pointer
Definition: node_iterators.hpp:64
Definition: tag_and_trait.hpp:75
Node reference.
Definition: node_iterators.hpp:204
pointer m_p_end_value
Definition: node_iterators.hpp:194
pointer m_p_value
Definition: node_iterators.hpp:192
PB_DS_OV_TREE_CONST_NODE_ITERATOR_C_DEC base_type
Definition: node_iterators.hpp:209
base_type::const_pointer const_pointer
Definition: node_iterators.hpp:213
ov_tree_node_it_(const_pointer p_nd=0, const_pointer p_begin_nd=0, const_pointer p_end_nd=0, const_metadata_pointer p_metadata=0)
Definition: node_iterators.hpp:242
trivial_iterator_difference_type difference_type
Definition: node_iterators.hpp:222
_Alloc::template rebind< metadata_type >::other::const_reference metadata_const_reference
Definition: node_iterators.hpp:116
ov_tree_node_it_ get_r_child() const
Returns the node reference associated with the right node.
Definition: node_iterators.hpp:268
PB_DS_OV_TREE_NODE_ITERATOR_C_DEC this_type
Definition: node_iterators.hpp:207
_Alloc::template rebind< Value_Type >::other::pointer value_type
Definition: node_iterators.hpp:227
ov_tree_node_const_it_(const_pointer p_nd=0, const_pointer p_begin_nd=0, const_pointer p_end_nd=0, const_metadata_pointer p_metadata=0)
Definition: node_iterators.hpp:120
trivial_iterator_tag iterator_category
Definition: node_iterators.hpp:90