42 typename PB_DS_CLASS_C_DEC::head_allocator
43 PB_DS_CLASS_C_DEC::s_head_allocator;
46 typename PB_DS_CLASS_C_DEC::inode_allocator
47 PB_DS_CLASS_C_DEC::s_inode_allocator;
50 typename PB_DS_CLASS_C_DEC::leaf_allocator
51 PB_DS_CLASS_C_DEC::s_leaf_allocator;
55 PB_DS_PAT_TRIE_NAME() :
56 m_p_head(s_head_allocator.allocate(1)),
60 PB_DS_ASSERT_VALID((*
this))
65 PB_DS_PAT_TRIE_NAME(
const access_traits& r_access_traits) :
66 synth_access_traits(r_access_traits),
67 m_p_head(s_head_allocator.allocate(1)),
71 PB_DS_ASSERT_VALID((*
this))
76 PB_DS_PAT_TRIE_NAME(
const PB_DS_CLASS_C_DEC& other) :
80 synth_access_traits(other),
82 m_p_head(s_head_allocator.allocate(1)),
86 m_size = other.m_size;
87 PB_DS_ASSERT_VALID(other)
88 if (other.m_p_head->m_p_parent == 0)
90 PB_DS_ASSERT_VALID((*
this))
95 m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
99 s_head_allocator.deallocate(m_p_head, 1);
100 __throw_exception_again;
103 m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
104 m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
105 m_p_head->m_p_parent->m_p_parent = m_p_head;
106 PB_DS_ASSERT_VALID((*
this))
112 swap(PB_DS_CLASS_C_DEC& other)
114 PB_DS_ASSERT_VALID((*
this))
115 PB_DS_ASSERT_VALID(other)
117 std::swap((access_traits& )(*this), (access_traits& )other);
118 PB_DS_ASSERT_VALID((*this))
119 PB_DS_ASSERT_VALID(other)
125 value_swap(PB_DS_CLASS_C_DEC& other)
127 _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
128 std::swap(m_p_head, other.m_p_head);
129 std::swap(m_size, other.m_size);
134 ~PB_DS_PAT_TRIE_NAME()
137 s_head_allocator.deallocate(m_p_head, 1);
145 new (m_p_head) head();
146 m_p_head->m_p_parent = 0;
147 m_p_head->m_p_min = m_p_head;
148 m_p_head->m_p_max = m_p_head;
153 template<
typename It>
156 copy_from_range(It first_it, It last_it)
158 while (first_it != last_it)
159 insert(*(first_it++));
163 typename PB_DS_CLASS_C_DEC::node_pointer
165 recursive_copy_node(node_const_pointer p_ncp)
167 _GLIBCXX_DEBUG_ASSERT(p_ncp != 0);
168 if (p_ncp->m_type == leaf_node)
170 leaf_const_pointer p_other_lf = static_cast<leaf_const_pointer>(p_ncp);
171 leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
172 cond_dealtor cond(p_new_lf);
173 new (p_new_lf) leaf(p_other_lf->value());
174 apply_update(p_new_lf, (node_update*)
this);
175 cond.set_no_action_dtor();
179 _GLIBCXX_DEBUG_ASSERT(p_ncp->m_type == i_node);
180 node_pointer a_p_children[inode::arr_size];
181 size_type child_i = 0;
182 inode_const_pointer p_icp = static_cast<inode_const_pointer>(p_ncp);
184 typename inode::const_iterator child_it = p_icp->begin();
189 while (child_it != p_icp->end())
191 a_p_children[child_i] = recursive_copy_node(*(child_it));
195 p_ret = s_inode_allocator.allocate(1);
199 while (child_i-- > 0)
200 clear_imp(a_p_children[child_i]);
201 __throw_exception_again;
204 new (p_ret) inode(p_icp->get_e_ind(), pref_begin(a_p_children[0]));
207 _GLIBCXX_DEBUG_ASSERT(child_i >= 1);
209 p_ret->add_child(a_p_children[child_i], pref_begin(a_p_children[child_i]),
210 pref_end(a_p_children[child_i]),
this);
211 while (child_i-- > 0);
212 apply_update(p_ret, (node_update*)
this);
ISO C++ entities toplevel namespace is std.