41 #ifndef PB_DS_TREE_POLICY_HPP
42 #define PB_DS_TREE_POLICY_HPP
47 #include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp>
52 template<
typename Const_Node_Iterator,
53 typename Node_Iterator,
56 struct null_tree_node_update
59 #define PB_DS_CLASS_T_DEC \
60 template<typename Const_Node_Iterator, class Node_Iterator, class Cmp_Fn, class Allocator>
62 #define PB_DS_CLASS_C_DEC \
63 tree_order_statistics_node_update<Const_Node_Iterator, Node_Iterator, Cmp_Fn, Allocator>
65 #define PB_DS_BASE_C_DEC \
66 detail::basic_tree_policy_base<Const_Node_Iterator, Node_Iterator, Allocator>
69 template<
typename Const_Node_Iterator,
typename Node_Iterator,
70 typename Cmp_Fn,
typename Allocator>
71 class tree_order_statistics_node_update :
private PB_DS_BASE_C_DEC
74 typedef PB_DS_BASE_C_DEC base_type;
77 typedef Cmp_Fn cmp_fn;
78 typedef Allocator allocator_type;
79 typedef typename allocator_type::size_type size_type;
80 typedef typename base_type::key_type key_type;
81 typedef typename base_type::const_key_reference const_key_reference;
83 typedef size_type metadata_type;
84 typedef Const_Node_Iterator const_node_iterator;
85 typedef Node_Iterator node_iterator;
86 typedef typename const_node_iterator::value_type const_iterator;
87 typedef typename node_iterator::value_type iterator;
94 find_by_order(size_type order)
const;
101 find_by_order(size_type order);
109 order_of_key(const_key_reference r_key)
const;
113 typedef typename base_type::const_reference const_reference;
116 typedef typename base_type::const_pointer const_pointer;
118 typedef typename allocator_type::template rebind<metadata_type>::other metadata_rebind;
120 typedef typename metadata_rebind::const_reference const_metadata_reference;
123 typedef typename metadata_rebind::reference metadata_reference;
126 virtual const_node_iterator
127 node_begin()
const = 0;
130 virtual node_iterator
134 virtual const_node_iterator
135 node_end()
const = 0;
138 virtual node_iterator
149 operator()(node_iterator node_it, const_node_iterator end_nd_it)
const;
152 ~tree_order_statistics_node_update();
155 #include <ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp>
157 #undef PB_DS_CLASS_T_DEC
158 #undef PB_DS_CLASS_C_DEC
159 #undef PB_DS_BASE_C_DEC