41 #ifndef PB_DS_PAT_TRIE_BASE
42 #define PB_DS_PAT_TRIE_BASE
66 template<
typename Metadata,
typename _Alloc>
71 typedef typename _Alloc::template rebind<Metadata>
__rebind_m;
82 template<
typename _Alloc>
91 template<
typename _ATraits,
typename Metadata>
96 typedef typename Metadata::allocator_type
_Alloc;
102 typedef typename _Alloc::template rebind<_Node_base>
__rebind_n;
115 #ifdef _GLIBCXX_DEBUG
116 typedef std::pair<a_const_iterator, a_const_iterator> node_debug_info;
120 const char* __file,
int __line)
const
121 { assert_valid_imp(p_traits, __file, __line); }
123 virtual node_debug_info
130 template<
typename _ATraits,
typename Metadata>
143 #ifdef _GLIBCXX_DEBUG
144 typedef typename base_type::node_debug_info node_debug_info;
147 virtual node_debug_info
148 assert_valid_imp(
a_const_pointer,
const char* __file,
int __line)
const
151 _M_message(
"Assertion from %1;:%2;")
152 ._M_string(__FILE__)._M_integer(__LINE__),
154 return node_debug_info();
161 template<
typename _ATraits,
typename Metadata>
188 #ifdef _GLIBCXX_DEBUG
189 typedef typename base_type::node_debug_info node_debug_info;
192 virtual node_debug_info
194 const char* __file,
int __line)
const
199 return std::make_pair(p_traits->begin(p_traits->extract_key(r_val)),
200 p_traits->end(p_traits->extract_key(r_val)));
210 template<
typename _ATraits,
typename Metadata>
227 typedef typename _Alloc::template rebind<base_type>
__rebind_n;
231 typedef typename _Alloc::template rebind<leaf>::other
__rebind_l;
235 typedef typename _Alloc::template rebind<_Inode>::other
__rebind_in;
243 typedef typename _Alloc::template rebind<node_pointer>::other
__rebind_np;
311 #ifdef _GLIBCXX_DEBUG
313 assert_referencible()
const
445 #ifdef _GLIBCXX_DEBUG
446 typedef typename base_type::node_debug_info node_debug_info;
448 virtual node_debug_info
471 #define PB_DS_CONST_IT_C_DEC \
472 _CIter<Node, Leaf, Head, Inode, Is_Forward_Iterator>
474 #define PB_DS_CONST_ODIR_IT_C_DEC \
475 _CIter<Node, Leaf, Head, Inode, !Is_Forward_Iterator>
477 #define PB_DS_IT_C_DEC \
478 _Iter<Node, Leaf, Head, Inode, Is_Forward_Iterator>
480 #define PB_DS_ODIR_IT_C_DEC \
481 _Iter<Node, Leaf, Head, Inode, !Is_Forward_Iterator>
485 template<
typename Node,
typename Leaf,
typename Head,
typename Inode,
486 bool Is_Forward_Iterator>
497 typedef typename type_traits::pointer
pointer;
558 {
return m_p_nd == other.m_p_nd; }
566 {
return m_p_nd != other.m_p_nd; }
571 inc(integral_constant<int, Is_Forward_Iterator>());
586 dec(integral_constant<int, Is_Forward_Iterator>());
616 p_y = p_y->m_p_parent;
644 p_y = p_y->m_p_parent;
666 return (next_it == p_parent->end())? 0 : *next_it;
711 template<
typename Node,
typename Leaf,
typename Head,
typename Inode,
712 bool Is_Forward_Iterator>
714 :
public _CIter<Node, Leaf, Head, Inode, Is_Forward_Iterator>
722 typedef typename type_traits::pointer
pointer;
796 #undef PB_DS_CONST_ODIR_IT_C_DEC
797 #undef PB_DS_ODIR_IT_C_DEC
800 #define PB_DS_PAT_TRIE_NODE_CONST_ITERATOR_C_DEC \
801 _Node_citer<Node, Leaf, Head, Inode, _CIterator, Iterator, _ATraits, _Alloc>
803 #define PB_DS_PAT_TRIE_NODE_ITERATOR_C_DEC \
804 _Node_iter<Node, Leaf, Head, Inode, _CIterator, Iterator, _ATraits, _Alloc>
807 template<
typename Node,
869 typedef typename _Alloc::template rebind<metadata_type>
__rebind_m;
879 std::pair<a_const_iterator, a_const_iterator>
889 return _CIterator(
m_p_nd);
895 {
return m_p_nd->get_metadata(); }
905 return std::distance(inp->begin(), inp->end());
915 typename Inode::iterator it = inp->begin();
936 template<
typename Node,
944 :
public _Node_citer<Node, Leaf, Head, Inode, _CIterator, Iterator, _Alloc>
980 typename Inode::iterator it =
990 #define PB_DS_CLASS_T_DEC \
991 template<typename _ATraits, typename Metadata>
993 #define PB_DS_CLASS_C_DEC \
994 pat_trie_base::_Inode<_ATraits, Metadata>
997 typename PB_DS_CLASS_C_DEC::__rebind_l
998 PB_DS_CLASS_C_DEC::s_leaf_alloc;
1001 typename PB_DS_CLASS_C_DEC::__rebind_in
1002 PB_DS_CLASS_C_DEC::s_inode_alloc;
1005 inline typename PB_DS_CLASS_C_DEC::size_type
1007 get_pref_pos(a_const_iterator b_it, a_const_iterator e_it,
1008 a_const_pointer p_traits)
const
1010 if (static_cast<std::size_t>(std::distance(b_it, e_it)) <= m_e_ind)
1012 std::advance(b_it, m_e_ind);
1013 return 1 + p_traits->e_pos(*b_it);
1018 _Inode(size_type len,
const a_const_iterator it)
1019 : base_type(i_node), m_e_ind(len), m_pref_b_it(it), m_pref_e_it(it)
1021 std::advance(m_pref_e_it, m_e_ind);
1022 std::fill(m_a_p_children, m_a_p_children + arr_size,
1023 static_cast<node_pointer>(0));
1029 update_prefixes(a_const_pointer p_traits)
1031 node_pointer p_first = *begin();
1032 if (p_first->m_type == leaf_node)
1034 leaf_const_pointer p =
static_cast<leaf_const_pointer
>(p_first);
1035 m_pref_b_it = p_traits->begin(access_traits::extract_key(p->value()));
1039 inode_pointer p =
static_cast<inode_pointer
>(p_first);
1041 m_pref_b_it = p->pref_b_it();
1043 m_pref_e_it = m_pref_b_it;
1044 std::advance(m_pref_e_it, m_e_ind);
1048 typename PB_DS_CLASS_C_DEC::const_iterator
1052 typedef node_pointer_pointer pointer_type;
1053 pointer_type p =
const_cast<pointer_type
>(m_a_p_children);
1054 return const_iterator(p + get_begin_pos(), p + arr_size);
1058 typename PB_DS_CLASS_C_DEC::iterator
1062 return iterator(m_a_p_children + get_begin_pos(),
1063 m_a_p_children + arr_size);
1067 typename PB_DS_CLASS_C_DEC::const_iterator
1071 typedef node_pointer_pointer pointer_type;
1072 pointer_type p =
const_cast<pointer_type
>(m_a_p_children) + arr_size;
1073 return const_iterator(p, p);
1077 typename PB_DS_CLASS_C_DEC::iterator
1080 {
return iterator(m_a_p_children + arr_size, m_a_p_children + arr_size); }
1083 inline typename PB_DS_CLASS_C_DEC::node_pointer
1085 get_child_node(a_const_iterator b_it, a_const_iterator e_it,
1086 a_const_pointer p_traits)
1088 const size_type i = get_pref_pos(b_it, e_it, p_traits);
1090 return m_a_p_children[i];
1094 inline typename PB_DS_CLASS_C_DEC::iterator
1096 get_child_it(a_const_iterator b_it, a_const_iterator e_it,
1097 a_const_pointer p_traits)
1099 const size_type i = get_pref_pos(b_it, e_it, p_traits);
1102 return iterator(m_a_p_children + i, m_a_p_children + i);
1106 inline typename PB_DS_CLASS_C_DEC::node_const_pointer
1108 get_child_node(a_const_iterator b_it, a_const_iterator e_it,
1109 a_const_pointer p_traits)
const
1110 {
return const_cast<node_pointer
>(get_child_node(b_it, e_it, p_traits)); }
1113 typename PB_DS_CLASS_C_DEC::node_pointer
1115 get_lower_bound_child_node(a_const_iterator b_it, a_const_iterator e_it,
1116 size_type checked_ind,
1117 a_const_pointer p_traits)
1119 if (!should_be_mine(b_it, e_it, checked_ind, p_traits))
1121 if (p_traits->cmp_prefixes(b_it, e_it, m_pref_b_it,
1123 return leftmost_descendant();
1124 return rightmost_descendant();
1127 size_type i = get_pref_pos(b_it, e_it, p_traits);
1130 if (m_a_p_children[i] != 0)
1131 return m_a_p_children[i];
1133 while (++i < arr_size)
1134 if (m_a_p_children[i] != 0)
1136 const node_type& __nt = m_a_p_children[i]->m_type;
1137 node_pointer ret = m_a_p_children[i];
1139 if (__nt == leaf_node)
1143 inode_pointer inp =
static_cast<inode_pointer
>(ret);
1144 return inp->leftmost_descendant();
1147 return rightmost_descendant();
1151 inline typename PB_DS_CLASS_C_DEC::node_pointer
1153 add_child(node_pointer p_nd, a_const_iterator b_it, a_const_iterator e_it,
1154 a_const_pointer p_traits)
1156 const size_type i = get_pref_pos(b_it, e_it, p_traits);
1158 if (m_a_p_children[i] == 0)
1160 m_a_p_children[i] = p_nd;
1161 p_nd->m_p_parent =
this;
1164 return m_a_p_children[i];
1168 typename PB_DS_CLASS_C_DEC::node_const_pointer
1170 get_join_child(node_const_pointer p_nd,
1171 a_const_pointer p_tr)
const
1173 node_pointer p =
const_cast<node_pointer
>(p_nd);
1174 return const_cast<inode_pointer
>(
this)->get_join_child(p, p_tr);
1178 typename PB_DS_CLASS_C_DEC::node_pointer
1180 get_join_child(node_pointer p_nd, a_const_pointer p_traits)
1183 a_const_iterator b_it;
1184 a_const_iterator e_it;
1185 if (p_nd->m_type == leaf_node)
1187 leaf_const_pointer p =
static_cast<leaf_const_pointer
>(p_nd);
1189 typedef typename type_traits::key_const_reference kcr;
1190 kcr r_key = access_traits::extract_key(p->value());
1191 b_it = p_traits->begin(r_key);
1192 e_it = p_traits->end(r_key);
1196 b_it =
static_cast<inode_pointer
>(p_nd)->pref_b_it();
1197 e_it =
static_cast<inode_pointer
>(p_nd)->pref_e_it();
1199 i = get_pref_pos(b_it, e_it, p_traits);
1201 return m_a_p_children[i];
1207 remove_child(node_pointer p_nd)
1210 for (; i < arr_size; ++i)
1211 if (m_a_p_children[i] == p_nd)
1213 m_a_p_children[i] = 0;
1222 remove_child(iterator it)
1223 { *it.m_p_p_cur = 0; }
1228 replace_child(node_pointer p_nd, a_const_iterator b_it,
1229 a_const_iterator e_it,
1230 a_const_pointer p_traits)
1232 const size_type i = get_pref_pos(b_it, e_it, p_traits);
1234 m_a_p_children[i] = p_nd;
1235 p_nd->m_p_parent =
this;
1239 inline typename PB_DS_CLASS_C_DEC::a_const_iterator
1242 {
return m_pref_b_it; }
1245 inline typename PB_DS_CLASS_C_DEC::a_const_iterator
1248 {
return m_pref_e_it; }
1253 should_be_mine(a_const_iterator b_it, a_const_iterator e_it,
1254 size_type checked_ind,
1255 a_const_pointer p_traits)
const
1260 const size_type num_es = std::distance(b_it, e_it);
1261 if (num_es < m_e_ind)
1264 a_const_iterator key_b_it = b_it;
1265 std::advance(key_b_it, checked_ind);
1266 a_const_iterator key_e_it = b_it;
1267 std::advance(key_e_it, m_e_ind);
1269 a_const_iterator value_b_it = m_pref_b_it;
1270 std::advance(value_b_it, checked_ind);
1271 a_const_iterator value_e_it = m_pref_b_it;
1272 std::advance(value_e_it, m_e_ind);
1274 return p_traits->equal_prefixes(key_b_it, key_e_it, value_b_it,
1279 typename PB_DS_CLASS_C_DEC::leaf_pointer
1281 leftmost_descendant()
1283 node_pointer p_pot = *begin();
1284 if (p_pot->m_type == leaf_node)
1285 return (static_cast<leaf_pointer>(p_pot));
1287 return static_cast<inode_pointer
>(p_pot)->leftmost_descendant();
1291 typename PB_DS_CLASS_C_DEC::leaf_const_pointer
1293 leftmost_descendant()
const
1294 {
return const_cast<inode_pointer
>(
this)->leftmost_descendant(); }
1297 typename PB_DS_CLASS_C_DEC::leaf_pointer
1299 rightmost_descendant()
1301 const size_type num_children = std::distance(begin(), end());
1304 iterator it = begin();
1305 std::advance(it, num_children - 1);
1306 node_pointer p_pot =* it;
1307 if (p_pot->m_type == leaf_node)
1308 return static_cast<leaf_pointer
>(p_pot);
1310 return static_cast<inode_pointer
>(p_pot)->rightmost_descendant();
1314 typename PB_DS_CLASS_C_DEC::leaf_const_pointer
1316 rightmost_descendant()
const
1317 {
return const_cast<inode_pointer
>(
this)->rightmost_descendant(); }
1320 typename PB_DS_CLASS_C_DEC::size_type
1322 get_begin_pos()
const
1325 for (; i < arr_size && m_a_p_children[i] == 0; ++i)
1330 #ifdef _GLIBCXX_DEBUG
1332 typename PB_DS_CLASS_C_DEC::node_debug_info
1334 assert_valid_imp(a_const_pointer p_traits,
1335 const char* __file,
int __line)
const
1338 PB_DS_DEBUG_VERIFY(static_cast<size_type>(std::distance(pref_b_it(), pref_e_it())) == m_e_ind);
1341 for (
typename _Inode::const_iterator it = begin(); it != end(); ++it)
1343 node_const_pointer p_nd = *it;
1345 node_debug_info child_ret = p_nd->assert_valid_imp(p_traits,
1348 PB_DS_DEBUG_VERIFY(static_cast<size_type>(std::distance(child_ret.first, child_ret.second)) >= m_e_ind);
1350 PB_DS_DEBUG_VERIFY(get_pref_pos(child_ret.first, child_ret.second, p_traits) == static_cast<size_type>(it.m_p_p_cur - m_a_p_children));
1352 return std::make_pair(pref_b_it(), pref_e_it());
1356 #undef PB_DS_CLASS_T_DEC
1357 #undef PB_DS_CLASS_C_DEC
base_type::access_traits access_traits
Definition: pat_trie_base.hpp:216
static leaf_pointer leftmost_descendant(node_pointer p_nd)
Definition: pat_trie_base.hpp:693
__rebind_n::other::pointer node_pointer
Definition: pat_trie_base.hpp:504
__rebind_l::other::pointer leaf_pointer
Definition: pat_trie_base.hpp:506
const node_pointer_pointer operator->() const
Definition: pat_trie_base.hpp:297
const_iterator begin() const
base_type::type_traits type_traits
Definition: pat_trie_base.hpp:166
_Alloc::template rebind< Inode > __rebind_in
Definition: pat_trie_base.hpp:511
trivial_iterator_difference_type difference_type
Definition: pat_trie_base.hpp:858
Head node for PATRICIA tree.
Definition: pat_trie_base.hpp:131
node_const_pointer get_join_child(node_const_pointer, a_const_pointer) const
_CIter & operator=(const PB_DS_CONST_ODIR_IT_C_DEC &other)
Definition: pat_trie_base.hpp:532
size_type get_begin_pos() const
_Leaf< _ATraits, Metadata > leaf
Definition: pat_trie_base.hpp:230
trivial_iterator_tag iterator_category
Definition: pat_trie_base.hpp:857
Metadata::allocator_type _Alloc
Definition: pat_trie_base.hpp:96
node_pointer value_type
Definition: pat_trie_base.hpp:325
leaf_pointer leftmost_descendant()
size_type get_pref_pos(a_const_iterator, a_const_iterator, a_const_pointer) const
_Alloc::template rebind< leaf >::other __rebind_l
Definition: pat_trie_base.hpp:231
base_type::type_traits type_traits
Definition: pat_trie_base.hpp:135
void inc(false_type)
Definition: pat_trie_base.hpp:600
_Iter & operator=(const PB_DS_ODIR_IT_C_DEC &other)
Definition: pat_trie_base.hpp:745
const_reference operator*() const
Definition: pat_trie_base.hpp:546
base_type::inode_pointer inode_pointer
Definition: pat_trie_base.hpp:951
_CIter & operator--()
Definition: pat_trie_base.hpp:584
Definition: pat_trie_base.hpp:62
Node::a_const_iterator a_const_iterator
Definition: pat_trie_base.hpp:829
iterator & operator++()
Definition: pat_trie_base.hpp:343
iterator get_child_it(a_const_iterator, a_const_iterator, a_const_pointer)
bool operator==(const const_iterator &other) const
Definition: pat_trie_base.hpp:272
__rebind_n::other::pointer node_pointer
Definition: pat_trie_base.hpp:818
bool should_be_mine(a_const_iterator, a_const_iterator, size_type, a_const_pointer) const
_CIter & operator=(const _CIter &other)
Definition: pat_trie_base.hpp:525
_Iter(node_pointer p_nd=0)
Definition: pat_trie_base.hpp:731
__rebind_l::other::const_pointer leaf_const_pointer
Definition: pat_trie_base.hpp:507
value_type m_value
Definition: pat_trie_base.hpp:172
Const iterator.
Definition: pat_trie_base.hpp:487
_Leaf(const_reference other)
Definition: pat_trie_base.hpp:177
value_type reference
Definition: pat_trie_base.hpp:862
_Alloc::template rebind< node_pointer >::other __rebind_np
Definition: pat_trie_base.hpp:243
base_type::size_type size_type
Definition: pat_trie_base.hpp:956
_Node_base< _ATraits, Metadata > base_type
Definition: pat_trie_base.hpp:165
_Alloc::template rebind< Leaf > __rebind_l
Definition: pat_trie_base.hpp:505
_Node_citer< Node, Leaf, Head, Inode, _CIterator, Iterator, _Alloc > base_type
Definition: pat_trie_base.hpp:948
_CIter & operator++()
Definition: pat_trie_base.hpp:569
_Alloc::template rebind< Inode > __rebind_in
Definition: pat_trie_base.hpp:824
static leaf_pointer rightmost_descendant(node_pointer p_nd)
Definition: pat_trie_base.hpp:701
__rebind_l::other::const_pointer leaf_const_pointer
Definition: pat_trie_base.hpp:822
value_type const_reference
Definition: pat_trie_base.hpp:863
base_type::node_pointer node_pointer
Definition: pat_trie_base.hpp:725
_Alloc allocator_type
Definition: pat_trie_base.hpp:99
a_const_iterator pref_begin() const
Definition: pat_trie_base.hpp:833
void remove_child(node_pointer)
#define _GLIBCXX_DEBUG_VERIFY_AT(_Condition, _ErrorMessage, _File, _Line)
Definition: macros.h:41
reference operator*() const
Access; returns the iterator* associated with the current leaf.
Definition: pat_trie_base.hpp:968
reference operator*() const
Definition: pat_trie_base.hpp:759
_Iter & operator=(const _Iter &other)
Definition: pat_trie_base.hpp:738
const node_type m_type
Definition: pat_trie_base.hpp:106
node_pointer_reference reference
Definition: pat_trie_base.hpp:264
_CIter< Node, Leaf, Head, Inode, Is_Forward_Iterator > base_type
Definition: pat_trie_base.hpp:718
const_iterator operator++(int)
Definition: pat_trie_base.hpp:289
#define PB_DS_CONST_ODIR_IT_C_DEC
Definition: pat_trie_base.hpp:474
bool operator==(const _Node_citer &other) const
Compares content to a different iterator object.
Definition: pat_trie_base.hpp:922
__rebind_np::reference node_pointer_reference
Definition: pat_trie_base.hpp:245
PB_DS_STATIC_ASSERT(min_arr_size, arr_size >=2)
allocator_type _Alloc
Definition: pat_trie_base.hpp:502
__rebind_np::pointer node_pointer_pointer
Definition: pat_trie_base.hpp:244
node_pointer m_a_p_children[arr_size]
Definition: pat_trie_base.hpp:468
const_iterator(node_pointer_pointer p_p_cur=0, node_pointer_pointer p_p_end=0)
Definition: pat_trie_base.hpp:266
node_type
Three types of nodes.
Definition: pat_trie_base.hpp:58
std::bidirectional_iterator_tag iterator_category
Definition: pat_trie_base.hpp:494
Represents no type, or absence of type, for template tricks.
Definition: tag_and_trait.hpp:210
base_type::allocator_type _Alloc
Definition: pat_trie_base.hpp:218
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
Iterator iterator
Definition: pat_trie_base.hpp:953
base_type::allocator_type allocator_type
Definition: pat_trie_base.hpp:719
const size_type m_e_ind
Definition: pat_trie_base.hpp:465
a_const_iterator pref_e_it() const
reference value()
Definition: pat_trie_base.hpp:181
#define _GLIBCXX_DEBUG_ONLY(_Statement)
Definition: debug.h:63
node_pointer m_p_max
Definition: pat_trie_base.hpp:139
a_const_iterator m_pref_e_it
Definition: pat_trie_base.hpp:467
__rebind_n::other::pointer node_pointer
Definition: pat_trie_base.hpp:950
const_reference value() const
Definition: pat_trie_base.hpp:185
Node::type_traits type_traits
Definition: pat_trie_base.hpp:492
Constant child iterator.
Definition: pat_trie_base.hpp:255
base_type::inode_pointer inode_pointer
Definition: pat_trie_base.hpp:729
Internal node type, PATRICIA tree.
Definition: pat_trie_base.hpp:211
__rebind_l::const_pointer leaf_const_pointer
Definition: pat_trie_base.hpp:233
type_traits::pointer pointer
Definition: pat_trie_base.hpp:722
static node_pointer get_smaller_sibling(node_pointer p_nd)
Definition: pat_trie_base.hpp:670
Definition: pat_trie_base.hpp:249
bool operator!=(const _Node_citer &other) const
Compares content (negatively) to a different iterator object.
Definition: pat_trie_base.hpp:927
type_traits::value_type value_type
Definition: pat_trie_base.hpp:496
base_type::a_const_iterator a_const_iterator
Definition: pat_trie_base.hpp:224
base_type::node_pointer node_pointer
Definition: pat_trie_base.hpp:226
Base type for PATRICIA trees.
Definition: pat_trie_base.hpp:51
size_type num_children() const
Returns the number of children in the corresponding node.
Definition: pat_trie_base.hpp:899
_Alloc allocator_type
Definition: pat_trie_base.hpp:219
a_const_iterator pref_end() const
Definition: pat_trie_base.hpp:845
__rebind_in::other::pointer inode_pointer
Definition: pat_trie_base.hpp:825
Inode::iterator inode_iterator
Definition: pat_trie_base.hpp:513
node_pointer add_child(node_pointer, a_const_iterator, a_const_iterator, a_const_pointer)
base_type::a_const_pointer a_const_pointer
Definition: pat_trie_base.hpp:952
_ATraits access_traits
Definition: pat_trie_base.hpp:100
node_pointer m_p_nd
Definition: pat_trie_base.hpp:930
_Alloc::template rebind< Node > __rebind_n
Definition: pat_trie_base.hpp:817
base_type::type_traits type_traits
Definition: pat_trie_base.hpp:720
_Alloc::template rebind< _ATraits > __rebind_at
Definition: pat_trie_base.hpp:111
node_pointer_reference reference
Definition: pat_trie_base.hpp:327
_ATraits::const_iterator a_const_iterator
Definition: pat_trie_base.hpp:113
_Alloc::difference_type difference_type
Definition: pat_trie_base.hpp:261
pointer operator->() const
Definition: pat_trie_base.hpp:752
a_const_pointer m_p_traits
Definition: pat_trie_base.hpp:931
node_pointer m_p_parent
Definition: pat_trie_base.hpp:105
type_traits::reference reference
Definition: pat_trie_base.hpp:168
base_type::leaf_const_pointer leaf_const_pointer
Definition: pat_trie_base.hpp:727
Node const iterator.
Definition: pat_trie_base.hpp:814
type_traits::reference reference
Definition: pat_trie_base.hpp:498
Iterator.
Definition: pat_trie_base.hpp:713
_Alloc::difference_type difference_type
Definition: pat_trie_base.hpp:324
bool operator!=(const const_iterator &other) const
Definition: pat_trie_base.hpp:276
__rebind_n::other::pointer node_pointer
Definition: pat_trie_base.hpp:103
type_traits::const_pointer const_pointer
Definition: pat_trie_base.hpp:499
_Iter operator--(int)
Definition: pat_trie_base.hpp:788
iterator(node_pointer_pointer p_p_cur=0, node_pointer_pointer p_p_end=0)
Definition: pat_trie_base.hpp:330
_CIter(const PB_DS_CONST_ODIR_IT_C_DEC &other)
Definition: pat_trie_base.hpp:520
Node::allocator_type allocator_type
Definition: pat_trie_base.hpp:491
bool operator==(const _CIter &other) const
Definition: pat_trie_base.hpp:553
iterator operator++(int)
Definition: pat_trie_base.hpp:350
node_pointer value_type
Definition: pat_trie_base.hpp:262
void replace_child(node_pointer, a_const_iterator, a_const_iterator, a_const_pointer)
_Alloc::template rebind< _Inode >::other __rebind_in
Definition: pat_trie_base.hpp:235
_Alloc::template rebind< base_type > __rebind_n
Definition: pat_trie_base.hpp:227
_Alloc::template rebind< Head > __rebind_h
Definition: pat_trie_base.hpp:508
allocator_type::difference_type difference_type
Definition: pat_trie_base.hpp:495
const_pointer operator->() const
Definition: pat_trie_base.hpp:539
_Iter & operator--()
Definition: pat_trie_base.hpp:781
_Alloc::template rebind< Node > __rebind_n
Definition: pat_trie_base.hpp:949
Node iterator.
Definition: pat_trie_base.hpp:943
_Alloc::template rebind< Node > __rebind_n
Definition: pat_trie_base.hpp:503
leaf_pointer rightmost_descendant()
Node::metadata_type metadata_type
Metadata type.
Definition: pat_trie_base.hpp:866
std::pair< a_const_iterator, a_const_iterator > valid_prefix() const
Subtree valid prefix.
Definition: pat_trie_base.hpp:880
value_type const_reference
Definition: pat_trie_base.hpp:960
__rebind_l::pointer leaf_pointer
Definition: pat_trie_base.hpp:232
_CIterator value_type
Definition: pat_trie_base.hpp:861
type_traits::const_reference const_reference
Definition: pat_trie_base.hpp:500
__rebind_l::other::pointer leaf_pointer
Definition: pat_trie_base.hpp:821
node_const_pointer operator*() const
Definition: pat_trie_base.hpp:304
__rebind_h::other::pointer head_pointer
Definition: pat_trie_base.hpp:509
bool operator!=(const PB_DS_CONST_ODIR_IT_C_DEC &other) const
Definition: pat_trie_base.hpp:565
type_traits::value_type value_type
Definition: pat_trie_base.hpp:721
__rebind_in::other::const_pointer inode_const_pointer
Definition: pat_trie_base.hpp:826
type_traits::value_type value_type
Definition: pat_trie_base.hpp:167
const_reference operator*() const
Definition: pat_trie_base.hpp:886
void update_prefixes(a_const_pointer)
type_traits::value_type value_type
Definition: pat_trie_base.hpp:217
Definition: tag_and_trait.hpp:75
_Head()
Definition: pat_trie_base.hpp:141
static __rebind_l s_leaf_alloc
Definition: pat_trie_base.hpp:462
_CIter operator++(int)
Definition: pat_trie_base.hpp:576
base_type::a_const_pointer a_const_pointer
Definition: pat_trie_base.hpp:223
_Inode(size_type, const a_const_iterator)
a_const_iterator pref_b_it() const
_ATraits::type_traits type_traits
Definition: pat_trie_base.hpp:101
bool operator!=(const iterator &other) const
Definition: pat_trie_base.hpp:339
Definition: pat_trie_base.hpp:60
void inc(true_type)
Definition: pat_trie_base.hpp:604
bool operator==(const iterator &other) const
Definition: pat_trie_base.hpp:335
node_pointer_pointer pointer
Definition: pat_trie_base.hpp:263
bool operator==(const PB_DS_CONST_ODIR_IT_C_DEC &other) const
Definition: pat_trie_base.hpp:557
__rebind_m::other __rebind_ma
Definition: pat_trie_base.hpp:870
metadata_const_reference get_metadata() const
Metadata access.
Definition: pat_trie_base.hpp:894
static __rebind_in s_inode_alloc
Definition: pat_trie_base.hpp:463
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
std::forward_iterator_tag iterator_category
Definition: pat_trie_base.hpp:260
#define PB_DS_CLASS_T_DEC
Definition: pat_trie_base.hpp:990
base_type::node_pointer node_pointer
Definition: pat_trie_base.hpp:136
Leaf node for PATRICIA tree.
Definition: pat_trie_base.hpp:162
value_type reference
Definition: pat_trie_base.hpp:959
_Alloc::size_type size_type
Definition: pat_trie_base.hpp:859
type_traits::const_reference const_reference
Definition: pat_trie_base.hpp:169
_Node_iter(node_pointer p_nd=0, a_const_pointer p_traits=0)
Definition: pat_trie_base.hpp:962
node_pointer_pointer m_p_p_cur
Definition: pat_trie_base.hpp:257
_Iter(const PB_DS_ODIR_IT_C_DEC &other)
Definition: pat_trie_base.hpp:734
_Node_iter get_child(size_type i) const
Returns a node __iterator to the corresponding node's i-th child.
Definition: pat_trie_base.hpp:976
node_pointer operator*()
Definition: pat_trie_base.hpp:365
_Alloc::template rebind< _Node_base > __rebind_n
Definition: pat_trie_base.hpp:102
size_type get_e_ind() const
Definition: pat_trie_base.hpp:453
base_type::head_pointer head_pointer
Definition: pat_trie_base.hpp:728
node_pointer get_child_node(a_const_iterator, a_const_iterator, a_const_pointer)
const_iterator end() const
type_traits::pointer pointer
Definition: pat_trie_base.hpp:497
_Alloc::size_type size_type
Definition: pat_trie_base.hpp:220
_Node_citer(node_pointer p_nd=0, a_const_pointer p_traits=0)
Definition: pat_trie_base.hpp:874
_CIter operator--(int)
Definition: pat_trie_base.hpp:591
_Node_citer get_child(size_type i) const
Definition: pat_trie_base.hpp:911
_Alloc::template rebind< metadata_type > __rebind_m
Const metadata reference type.
Definition: pat_trie_base.hpp:869
#define PB_DS_DEBUG_VERIFY(_Cond)
Definition: binary_heap_.hpp:327
Iterator value_type
Definition: pat_trie_base.hpp:958
void dec(false_type)
Definition: pat_trie_base.hpp:628
__rebind_at::other::const_pointer a_const_pointer
Definition: pat_trie_base.hpp:112
_Node_base< _ATraits, Metadata > base_type
Definition: pat_trie_base.hpp:214
Node base.
Definition: pat_trie_base.hpp:92
bool operator!=(const _CIter &other) const
Definition: pat_trie_base.hpp:561
node_pointer_pointer m_p_p_end
Definition: pat_trie_base.hpp:258
_Alloc::template rebind< Leaf > __rebind_l
Definition: pat_trie_base.hpp:820
_Node_base< _ATraits, Metadata > base_type
Definition: pat_trie_base.hpp:134
_Node_base(node_type type)
Definition: pat_trie_base.hpp:108
type_traits::reference reference
Definition: pat_trie_base.hpp:723
node_pointer m_p_nd
Definition: pat_trie_base.hpp:515
_CIter(node_pointer p_nd=0)
Definition: pat_trie_base.hpp:517
__rebind_in::other::pointer inode_pointer
Definition: pat_trie_base.hpp:512
__rebind_ma::const_reference metadata_const_reference
Definition: pat_trie_base.hpp:871
__rebind_in::const_pointer inode_const_pointer
Definition: pat_trie_base.hpp:237
base_type::leaf_pointer leaf_pointer
Definition: pat_trie_base.hpp:726
__rebind_n::other::const_pointer node_const_pointer
Definition: pat_trie_base.hpp:228
__rebind_in::pointer inode_pointer
Definition: pat_trie_base.hpp:236
node_pointer_pointer pointer
Definition: pat_trie_base.hpp:326
Definition: pat_trie_base.hpp:61
std::forward_iterator_tag iterator_category
Definition: pat_trie_base.hpp:323
const_iterator & operator++()
Definition: pat_trie_base.hpp:280
_Iter operator++(int)
Definition: pat_trie_base.hpp:773
Child iterator.
Definition: pat_trie_base.hpp:320
Node::a_const_pointer a_const_pointer
Definition: pat_trie_base.hpp:828
void dec(true_type)
Definition: pat_trie_base.hpp:632
#define PB_DS_ODIR_IT_C_DEC
Definition: pat_trie_base.hpp:480
node_pointer m_p_min
Definition: pat_trie_base.hpp:138
static node_pointer get_larger_sibling(node_pointer p_nd)
Definition: pat_trie_base.hpp:656
_Iter & operator++()
Definition: pat_trie_base.hpp:766
a_const_iterator m_pref_b_it
Definition: pat_trie_base.hpp:466
node_pointer get_lower_bound_child_node(a_const_iterator, a_const_iterator, size_type, a_const_pointer)
base_type::type_traits type_traits
Definition: pat_trie_base.hpp:215
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71
node_pointer_pointer operator->()
Definition: pat_trie_base.hpp:358