22 typedef typename Traits::parent parent_type;
23 typedef typename Traits::blocks blocks_type;
24 typedef typename Traits::base_iterator base_iterator_type;
26 typedef typename parent_type::size_type size_type;
33 const base_iterator_type& pos,
const base_iterator_type& end,
const parent_type* parent, size_type block_index)
34 : m_cur_node(parent, block_index), m_pos(pos), m_end(end)
41 : m_cur_node(other.m_cur_node), m_pos(other.m_pos), m_end(other.m_end)
46#ifdef MDDS_MULTI_TYPE_VECTOR_DEBUG
48 throw general_error(
"Current node position should never equal the end position during node update.");
51 const typename blocks_type::value_type& blk = *m_pos;
53 m_cur_node.type = mdds::mtv::get_block_type(*blk.data);
55 m_cur_node.type = mdds::mtv::element_type_empty;
57 m_cur_node.position = blk.position;
58 m_cur_node.size = blk.size;
59 m_cur_node.data = blk.data;
80 base_iterator_type m_pos;
81 base_iterator_type m_end;
86 if (m_pos != m_end && other.m_pos != other.m_end)
90 if (m_cur_node != other.m_cur_node)
93 return m_pos == other.m_pos && m_end == other.m_end;
98 return !operator==(other);
103 m_cur_node = other.m_cur_node;
111 m_cur_node.swap(other.m_cur_node);
112 std::swap(m_pos, other.m_pos);
113 std::swap(m_end, other.m_end);
116 const node& get_node()
const
120 const base_iterator_type& get_pos()
const
124 const base_iterator_type& get_end()
const
133 using parent_type =
typename Traits::parent;
134 typedef NodeUpdateFunc node_update_func;
137 typedef typename Traits::base_iterator base_iterator_type;
138 typedef typename common_base::size_type size_type;
140 using common_base::dec;
141 using common_base::inc;
142 using common_base::m_cur_node;
145 using common_base::get_end;
146 using common_base::get_pos;
152 typedef ptrdiff_t difference_type;
153 typedef std::bidirectional_iterator_tag iterator_category;
159 const base_iterator_type& pos,
const base_iterator_type& end,
const parent_type* parent, size_type block_index)
185 node_update_func::inc(m_cur_node);
193 node_update_func::dec(m_cur_node);
201 using parent_type =
typename Traits::parent;
202 typedef NodeUpdateFunc node_update_func;
205 typedef typename Traits::base_iterator base_iterator_type;
206 typedef typename common_base::size_type size_type;
208 using common_base::dec;
209 using common_base::inc;
210 using common_base::m_cur_node;
213 using common_base::get_end;
214 using common_base::get_pos;
216 typedef NonConstItrBase iterator_base;
222 typedef ptrdiff_t difference_type;
223 typedef std::bidirectional_iterator_tag iterator_category;
229 const base_iterator_type& pos,
const base_iterator_type& end,
const parent_type* parent, size_type block_index)
238 other.get_pos(), other.get_end(), other.get_node().__private_data.parent,
239 other.get_node().__private_data.block_index)
242 const value_type& operator*()
const
247 const value_type* operator->()
const
252 const_iterator_base& operator++()
254 node_update_func::inc(m_cur_node);
259 const_iterator_base& operator--()
262 node_update_func::dec(m_cur_node);
266 bool operator==(
const const_iterator_base& other)
const
268 return iterator_common_base<Traits>::operator==(other);
271 bool operator!=(
const const_iterator_base& other)
const
273 return iterator_common_base<Traits>::operator!=(other);