41 #ifndef PB_DS_TRIE_POLICY_HPP
42 #define PB_DS_TRIE_POLICY_HPP
44 #include <bits/c++config.h>
51 #define PB_DS_CLASS_T_DEC \
52 template<typename String, typename String::value_type Min_E_Val, \
53 typename String::value_type Max_E_Val, bool Reverse, \
56 #define PB_DS_CLASS_C_DEC \
57 trie_string_access_traits<String, Min_E_Val,Max_E_Val,Reverse,_Alloc>
70 typename String::value_type Min_E_Val = detail::__numeric_traits<typename String::value_type>::__min,
71 typename String::value_type Max_E_Val = detail::__numeric_traits<typename String::value_type>::__max,
73 typename _Alloc = std::allocator<char> >
79 typedef typename _Alloc::template rebind<key_type>
__rebind_k;
88 typedef typename detail::__conditional_type<Reverse, \
89 typename String::const_reverse_iterator, \
93 typedef typename std::iterator_traits<const_iterator>::value_type
e_type;
130 static detail::integral_constant<int, Reverse>
s_rev_ind;
135 #undef PB_DS_CLASS_T_DEC
136 #undef PB_DS_CLASS_C_DEC
138 #define PB_DS_CLASS_T_DEC \
139 template<typename Node_CItr,typename Node_Itr, \
140 typename _ATraits, typename _Alloc>
142 #define PB_DS_CLASS_C_DEC \
143 trie_prefix_search_node_update<Node_CItr, Node_Itr, \
146 #define PB_DS_TRIE_POLICY_BASE \
147 detail::trie_policy_base<Node_CItr,Node_Itr,_ATraits, _Alloc>
151 template<
typename Node_CItr,
178 typedef typename node_iterator::value_type
iterator;
183 std::pair<const_iterator, const_iterator>
188 std::pair<iterator, iterator>
193 std::pair<const_iterator, const_iterator>
198 std::pair<iterator, iterator>
242 #undef PB_DS_CLASS_C_DEC
244 #define PB_DS_CLASS_C_DEC \
245 trie_order_statistics_node_update<Node_CItr, Node_Itr, \
249 template<
typename Node_CItr,
270 typedef typename node_iterator::value_type
iterator;
312 typedef typename _Alloc::template rebind<metadata_type>
__rebind_m;
354 #undef PB_DS_CLASS_T_DEC
355 #undef PB_DS_CLASS_C_DEC
356 #undef PB_DS_TRIE_POLICY_BASE
size_type metadata_type
Definition: trie_policy.hpp:266
std::iterator_traits< const_iterator >::value_type e_type
Element type.
Definition: trie_policy.hpp:93
node_iterator::value_type iterator
Definition: trie_policy.hpp:270
__rebind_k::other::const_reference key_const_reference
Definition: trie_policy.hpp:80
static const_iterator begin(key_const_reference)
Definition: trie_policy.hpp:74
_Alloc allocator_type
Definition: trie_policy.hpp:261
base_type::key_const_reference key_const_reference
Definition: trie_policy.hpp:162
const_iterator find_by_order(size_type) const
node_const_iterator::value_type const_iterator
Definition: trie_policy.hpp:179
virtual const access_traits & get_access_traits() const =0
Access to the cmp_fn object.
virtual node_const_iterator node_end() const =0
static const_iterator end_imp(key_const_reference, detail::false_type)
access_traits::const_iterator a_const_iterator
Const element iterator.
Definition: trie_policy.hpp:168
Definition: trie_policy.hpp:99
allocator_type::size_type size_type
Size type.
Definition: trie_policy.hpp:174
_Alloc allocator_type
_Alloc type.
Definition: trie_policy.hpp:171
Node_Itr node_iterator
Definition: trie_policy.hpp:268
base_type::const_pointer const_pointer
Definition: trie_policy.hpp:310
virtual node_const_iterator node_begin() const =0
Returns the node_const_iterator associated with the trie's root node.
Represents no type, or absence of type, for template tricks.
Definition: tag_and_trait.hpp:210
static detail::integral_constant< int, Reverse > s_rev_ind
Definition: trie_policy.hpp:130
PB_DS_TRIE_POLICY_BASE base_type
Definition: trie_policy.hpp:256
size_type order_of_prefix(a_const_iterator, a_const_iterator) const
Definition: trie_policy.hpp:97
basic_string< char > string
Definition: string:1153
base_type::key_type key_type
Definition: trie_policy.hpp:263
static const_iterator end(key_const_reference)
_Alloc::template rebind< key_type > __rebind_k
Definition: trie_policy.hpp:79
virtual node_const_iterator node_end() const =0
Returns the node_const_iterator associated with a just-after leaf node.
base_type::key_const_reference key_const_reference
Definition: trie_policy.hpp:264
Definition: trie_policy.hpp:98
String key_type
Definition: trie_policy.hpp:78
node_iterator next_child(node_iterator, a_const_iterator, a_const_iterator, node_iterator, const access_traits &)
node_const_iterator::value_type const_iterator
Definition: trie_policy.hpp:269
virtual const_iterator end() const =0
Returns the const iterator associated with the just-after last element.
_Alloc::size_type size_type
Definition: trie_policy.hpp:77
__rebind_m::other __rebind_ma
Definition: trie_policy.hpp:313
PB_DS_STATIC_ASSERT(min_max_size, max_size >=2)
allocator_type::size_type size_type
Definition: trie_policy.hpp:262
virtual access_traits & get_access_traits()=0
Access to the cmp_fn object.
access_traits::const_iterator a_const_iterator
Definition: trie_policy.hpp:260
PB_DS_TRIE_POLICY_BASE base_type
Definition: trie_policy.hpp:158
node_iterator::value_type iterator
Definition: trie_policy.hpp:178
detail::__conditional_type< Reverse, typename String::const_reverse_iterator, typename String::const_iterator >::__type const_iterator
Element const iterator type.
Definition: trie_policy.hpp:90
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
Node_CItr node_const_iterator
Definition: trie_policy.hpp:267
virtual iterator begin()=0
Returns the iterator associated with the trie's first element.
null_type metadata_type
Definition: trie_policy.hpp:175
base_type::const_reference const_reference
Definition: trie_policy.hpp:309
void operator()(node_iterator, node_const_iterator) const
virtual node_const_iterator node_begin() const =0
Returns the node_const_iterator associated with the trie's root node.
_Alloc::template rebind< metadata_type > __rebind_m
Definition: trie_policy.hpp:312
Definition: trie_policy.hpp:155
base_type::key_type key_type
Definition: trie_policy.hpp:161
static size_type e_pos(e_type e)
Maps an element to a position.
Definition: trie_policy.hpp:84
Functor updating ranks of entrees.
Definition: trie_policy.hpp:253
_ATraits access_traits
Element access traits.
Definition: trie_policy.hpp:165
Node_CItr node_const_iterator
Definition: trie_policy.hpp:177
std::pair< const_iterator, const_iterator > prefix_range(key_const_reference) const
__rebind_ma::reference metadata_reference
Definition: trie_policy.hpp:315
_ATraits access_traits
Definition: trie_policy.hpp:259
size_type order_of_key(key_const_reference) const
void operator()(node_iterator node_it, node_const_iterator end_nd_it) const
Called to update a node's metadata.
__rebind_ma::const_reference metadata_const_reference
Definition: trie_policy.hpp:314
static const_iterator begin_imp(key_const_reference, detail::false_type)
virtual bool empty() const =0
Returns true if the container is empty.
#define PB_DS_TRIE_POLICY_BASE
Definition: trie_policy.hpp:146
Node_Itr node_iterator
Definition: trie_policy.hpp:176
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71