Chris@16
|
1 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@101
|
3 // (C) Copyright Ion Gaztanaga 2013-2014
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 //
|
Chris@16
|
9 // See http://www.boost.org/libs/intrusive for documentation.
|
Chris@16
|
10 //
|
Chris@16
|
11 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
12 #ifndef BOOST_INTRUSIVE_BS_SET_HPP
|
Chris@16
|
13 #define BOOST_INTRUSIVE_BS_SET_HPP
|
Chris@16
|
14
|
Chris@16
|
15 #include <boost/intrusive/detail/config_begin.hpp>
|
Chris@16
|
16 #include <boost/intrusive/intrusive_fwd.hpp>
|
Chris@16
|
17 #include <boost/intrusive/detail/mpl.hpp>
|
Chris@16
|
18 #include <boost/intrusive/bstree.hpp>
|
Chris@101
|
19 #include <boost/move/utility_core.hpp>
|
Chris@101
|
20 #include <boost/static_assert.hpp>
|
Chris@101
|
21
|
Chris@101
|
22 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
23 # pragma once
|
Chris@101
|
24 #endif
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost {
|
Chris@16
|
27 namespace intrusive {
|
Chris@16
|
28
|
Chris@16
|
29 //! The class template bs_set is an intrusive container, that mimics most of
|
Chris@16
|
30 //! the interface of std::set as described in the C++ standard.
|
Chris@16
|
31 //!
|
Chris@16
|
32 //! The template parameter \c T is the type to be managed by the container.
|
Chris@16
|
33 //! The user can specify additional options and if no options are provided
|
Chris@16
|
34 //! default options are used.
|
Chris@16
|
35 //!
|
Chris@16
|
36 //! The container supports the following options:
|
Chris@16
|
37 //! \c base_hook<>/member_hook<>/value_traits<>,
|
Chris@16
|
38 //! \c constant_time_size<>, \c size_type<> and
|
Chris@16
|
39 //! \c compare<>.
|
Chris@16
|
40 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
41 template<class T, class ...Options>
|
Chris@16
|
42 #else
|
Chris@101
|
43 template<class ValueTraits, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
Chris@16
|
44 #endif
|
Chris@16
|
45 class bs_set_impl
|
Chris@16
|
46 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
47 : public bstree_impl<ValueTraits, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
|
Chris@16
|
48 #endif
|
Chris@16
|
49 {
|
Chris@16
|
50 /// @cond
|
Chris@101
|
51 typedef bstree_impl<ValueTraits, Compare, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder> tree_type;
|
Chris@16
|
52 BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set_impl)
|
Chris@16
|
53
|
Chris@16
|
54 typedef tree_type implementation_defined;
|
Chris@16
|
55 /// @endcond
|
Chris@16
|
56
|
Chris@16
|
57 public:
|
Chris@16
|
58 typedef typename implementation_defined::value_type value_type;
|
Chris@16
|
59 typedef typename implementation_defined::value_traits value_traits;
|
Chris@16
|
60 typedef typename implementation_defined::pointer pointer;
|
Chris@16
|
61 typedef typename implementation_defined::const_pointer const_pointer;
|
Chris@16
|
62 typedef typename implementation_defined::reference reference;
|
Chris@16
|
63 typedef typename implementation_defined::const_reference const_reference;
|
Chris@16
|
64 typedef typename implementation_defined::difference_type difference_type;
|
Chris@16
|
65 typedef typename implementation_defined::size_type size_type;
|
Chris@16
|
66 typedef typename implementation_defined::value_compare value_compare;
|
Chris@16
|
67 typedef typename implementation_defined::key_compare key_compare;
|
Chris@16
|
68 typedef typename implementation_defined::iterator iterator;
|
Chris@16
|
69 typedef typename implementation_defined::const_iterator const_iterator;
|
Chris@16
|
70 typedef typename implementation_defined::reverse_iterator reverse_iterator;
|
Chris@16
|
71 typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
|
Chris@16
|
72 typedef typename implementation_defined::insert_commit_data insert_commit_data;
|
Chris@16
|
73 typedef typename implementation_defined::node_traits node_traits;
|
Chris@16
|
74 typedef typename implementation_defined::node node;
|
Chris@16
|
75 typedef typename implementation_defined::node_ptr node_ptr;
|
Chris@16
|
76 typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
Chris@16
|
77 typedef typename implementation_defined::node_algorithms node_algorithms;
|
Chris@16
|
78
|
Chris@16
|
79 static const bool constant_time_size = tree_type::constant_time_size;
|
Chris@16
|
80
|
Chris@16
|
81 public:
|
Chris@16
|
82 //! @copydoc ::boost::intrusive::bstree::bstree(const value_compare &,const value_traits &)
|
Chris@16
|
83 explicit bs_set_impl( const value_compare &cmp = value_compare()
|
Chris@16
|
84 , const value_traits &v_traits = value_traits())
|
Chris@16
|
85 : tree_type(cmp, v_traits)
|
Chris@16
|
86 {}
|
Chris@16
|
87
|
Chris@16
|
88 //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const value_compare &,const value_traits &)
|
Chris@16
|
89 template<class Iterator>
|
Chris@16
|
90 bs_set_impl( Iterator b, Iterator e
|
Chris@16
|
91 , const value_compare &cmp = value_compare()
|
Chris@16
|
92 , const value_traits &v_traits = value_traits())
|
Chris@16
|
93 : tree_type(true, b, e, cmp, v_traits)
|
Chris@16
|
94 {}
|
Chris@16
|
95
|
Chris@16
|
96 //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
|
Chris@16
|
97 bs_set_impl(BOOST_RV_REF(bs_set_impl) x)
|
Chris@101
|
98 : tree_type(BOOST_MOVE_BASE(tree_type, x))
|
Chris@16
|
99 {}
|
Chris@16
|
100
|
Chris@16
|
101 //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
|
Chris@16
|
102 bs_set_impl& operator=(BOOST_RV_REF(bs_set_impl) x)
|
Chris@101
|
103 { return static_cast<bs_set_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
|
Chris@16
|
104
|
Chris@16
|
105 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
106 //! @copydoc ::boost::intrusive::bstree::~bstree()
|
Chris@16
|
107 ~bs_set_impl();
|
Chris@16
|
108
|
Chris@16
|
109 //! @copydoc ::boost::intrusive::bstree::begin()
|
Chris@16
|
110 iterator begin();
|
Chris@16
|
111
|
Chris@16
|
112 //! @copydoc ::boost::intrusive::bstree::begin()const
|
Chris@16
|
113 const_iterator begin() const;
|
Chris@16
|
114
|
Chris@16
|
115 //! @copydoc ::boost::intrusive::bstree::cbegin()const
|
Chris@16
|
116 const_iterator cbegin() const;
|
Chris@16
|
117
|
Chris@16
|
118 //! @copydoc ::boost::intrusive::bstree::end()
|
Chris@16
|
119 iterator end();
|
Chris@16
|
120
|
Chris@16
|
121 //! @copydoc ::boost::intrusive::bstree::end()const
|
Chris@16
|
122 const_iterator end() const;
|
Chris@16
|
123
|
Chris@16
|
124 //! @copydoc ::boost::intrusive::bstree::cend()const
|
Chris@16
|
125 const_iterator cend() const;
|
Chris@16
|
126
|
Chris@16
|
127 //! @copydoc ::boost::intrusive::bstree::rbegin()
|
Chris@16
|
128 reverse_iterator rbegin();
|
Chris@16
|
129
|
Chris@16
|
130 //! @copydoc ::boost::intrusive::bstree::rbegin()const
|
Chris@16
|
131 const_reverse_iterator rbegin() const;
|
Chris@16
|
132
|
Chris@16
|
133 //! @copydoc ::boost::intrusive::bstree::crbegin()const
|
Chris@16
|
134 const_reverse_iterator crbegin() const;
|
Chris@16
|
135
|
Chris@16
|
136 //! @copydoc ::boost::intrusive::bstree::rend()
|
Chris@16
|
137 reverse_iterator rend();
|
Chris@16
|
138
|
Chris@16
|
139 //! @copydoc ::boost::intrusive::bstree::rend()const
|
Chris@16
|
140 const_reverse_iterator rend() const;
|
Chris@16
|
141
|
Chris@16
|
142 //! @copydoc ::boost::intrusive::bstree::crend()const
|
Chris@16
|
143 const_reverse_iterator crend() const;
|
Chris@16
|
144
|
Chris@16
|
145 //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
|
Chris@16
|
146 static bs_set_impl &container_from_end_iterator(iterator end_iterator);
|
Chris@16
|
147
|
Chris@16
|
148 //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
|
Chris@16
|
149 static const bs_set_impl &container_from_end_iterator(const_iterator end_iterator);
|
Chris@16
|
150
|
Chris@16
|
151 //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
|
Chris@16
|
152 static bs_set_impl &container_from_iterator(iterator it);
|
Chris@16
|
153
|
Chris@16
|
154 //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
|
Chris@16
|
155 static const bs_set_impl &container_from_iterator(const_iterator it);
|
Chris@16
|
156
|
Chris@16
|
157 //! @copydoc ::boost::intrusive::bstree::key_comp()const
|
Chris@16
|
158 key_compare key_comp() const;
|
Chris@16
|
159
|
Chris@16
|
160 //! @copydoc ::boost::intrusive::bstree::value_comp()const
|
Chris@16
|
161 value_compare value_comp() const;
|
Chris@16
|
162
|
Chris@16
|
163 //! @copydoc ::boost::intrusive::bstree::empty()const
|
Chris@16
|
164 bool empty() const;
|
Chris@16
|
165
|
Chris@16
|
166 //! @copydoc ::boost::intrusive::bstree::size()const
|
Chris@16
|
167 size_type size() const;
|
Chris@16
|
168
|
Chris@16
|
169 //! @copydoc ::boost::intrusive::bstree::swap
|
Chris@16
|
170 void swap(bs_set_impl& other);
|
Chris@16
|
171
|
Chris@16
|
172 //! @copydoc ::boost::intrusive::bstree::clone_from
|
Chris@16
|
173 template <class Cloner, class Disposer>
|
Chris@16
|
174 void clone_from(const bs_set_impl &src, Cloner cloner, Disposer disposer);
|
Chris@101
|
175
|
Chris@16
|
176 #endif //#ifdef BOOST_iNTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
177
|
Chris@16
|
178 //! @copydoc ::boost::intrusive::bstree::insert_unique(reference)
|
Chris@16
|
179 std::pair<iterator, bool> insert(reference value)
|
Chris@16
|
180 { return tree_type::insert_unique(value); }
|
Chris@16
|
181
|
Chris@16
|
182 //! @copydoc ::boost::intrusive::bstree::insert_unique(const_iterator,reference)
|
Chris@16
|
183 iterator insert(const_iterator hint, reference value)
|
Chris@16
|
184 { return tree_type::insert_unique(hint, value); }
|
Chris@16
|
185
|
Chris@16
|
186 //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyValueCompare,insert_commit_data&)
|
Chris@16
|
187 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
188 std::pair<iterator, bool> insert_check
|
Chris@16
|
189 (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
|
Chris@16
|
190 { return tree_type::insert_unique_check(key, key_value_comp, commit_data); }
|
Chris@16
|
191
|
Chris@16
|
192 //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const KeyType&,KeyValueCompare,insert_commit_data&)
|
Chris@16
|
193 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
194 std::pair<iterator, bool> insert_check
|
Chris@16
|
195 (const_iterator hint, const KeyType &key
|
Chris@16
|
196 ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
|
Chris@16
|
197 { return tree_type::insert_unique_check(hint, key, key_value_comp, commit_data); }
|
Chris@16
|
198
|
Chris@16
|
199 //! @copydoc ::boost::intrusive::bstree::insert_unique(Iterator,Iterator)
|
Chris@16
|
200 template<class Iterator>
|
Chris@16
|
201 void insert(Iterator b, Iterator e)
|
Chris@16
|
202 { tree_type::insert_unique(b, e); }
|
Chris@16
|
203
|
Chris@16
|
204 //! @copydoc ::boost::intrusive::bstree::insert_unique_commit
|
Chris@16
|
205 iterator insert_commit(reference value, const insert_commit_data &commit_data)
|
Chris@16
|
206 { return tree_type::insert_unique_commit(value, commit_data); }
|
Chris@16
|
207
|
Chris@16
|
208 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
209 //! @copydoc ::boost::intrusive::bstree::insert_before
|
Chris@16
|
210 iterator insert_before(const_iterator pos, reference value);
|
Chris@16
|
211
|
Chris@16
|
212 //! @copydoc ::boost::intrusive::bstree::push_back
|
Chris@16
|
213 void push_back(reference value);
|
Chris@16
|
214
|
Chris@16
|
215 //! @copydoc ::boost::intrusive::bstree::push_front
|
Chris@16
|
216 void push_front(reference value);
|
Chris@16
|
217
|
Chris@16
|
218 //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
|
Chris@16
|
219 iterator erase(const_iterator i);
|
Chris@16
|
220
|
Chris@16
|
221 //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
|
Chris@16
|
222 iterator erase(const_iterator b, const_iterator e);
|
Chris@16
|
223
|
Chris@16
|
224 //! @copydoc ::boost::intrusive::bstree::erase(const_reference)
|
Chris@16
|
225 size_type erase(const_reference value);
|
Chris@16
|
226
|
Chris@16
|
227 //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyValueCompare)
|
Chris@16
|
228 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
229 size_type erase(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
230
|
Chris@16
|
231 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
|
Chris@16
|
232 template<class Disposer>
|
Chris@16
|
233 iterator erase_and_dispose(const_iterator i, Disposer disposer);
|
Chris@16
|
234
|
Chris@16
|
235 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
|
Chris@16
|
236 template<class Disposer>
|
Chris@16
|
237 iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer);
|
Chris@16
|
238
|
Chris@16
|
239 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_reference, Disposer)
|
Chris@16
|
240 template<class Disposer>
|
Chris@16
|
241 size_type erase_and_dispose(const_reference value, Disposer disposer);
|
Chris@16
|
242
|
Chris@16
|
243 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer)
|
Chris@16
|
244 template<class KeyType, class KeyValueCompare, class Disposer>
|
Chris@16
|
245 size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer);
|
Chris@16
|
246
|
Chris@16
|
247 //! @copydoc ::boost::intrusive::bstree::clear
|
Chris@16
|
248 void clear();
|
Chris@16
|
249
|
Chris@16
|
250 //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
|
Chris@16
|
251 template<class Disposer>
|
Chris@16
|
252 void clear_and_dispose(Disposer disposer);
|
Chris@16
|
253
|
Chris@101
|
254 #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
255
|
Chris@16
|
256 //! @copydoc ::boost::intrusive::bstree::count(const_reference)const
|
Chris@101
|
257 size_type count(const_reference value) const
|
Chris@101
|
258 { return static_cast<size_type>(this->tree_type::find(value) == this->tree_type::cend()); }
|
Chris@16
|
259
|
Chris@16
|
260 //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyValueCompare)const
|
Chris@16
|
261 template<class KeyType, class KeyValueCompare>
|
Chris@101
|
262 size_type count(const KeyType& key, KeyValueCompare comp) const
|
Chris@101
|
263 { return static_cast<size_type>(this->tree_type::find(key, comp) == this->tree_type::cend()); }
|
Chris@101
|
264
|
Chris@101
|
265 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
266
|
Chris@16
|
267 //! @copydoc ::boost::intrusive::bstree::lower_bound(const_reference)
|
Chris@16
|
268 iterator lower_bound(const_reference value);
|
Chris@101
|
269
|
Chris@16
|
270 //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
271 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
272 iterator lower_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
273
|
Chris@16
|
274 //! @copydoc ::boost::intrusive::bstree::lower_bound(const_reference)const
|
Chris@16
|
275 const_iterator lower_bound(const_reference value) const;
|
Chris@16
|
276
|
Chris@16
|
277 //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
278 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
279 const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
280
|
Chris@16
|
281 //! @copydoc ::boost::intrusive::bstree::upper_bound(const_reference)
|
Chris@16
|
282 iterator upper_bound(const_reference value);
|
Chris@16
|
283
|
Chris@16
|
284 //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
285 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
286 iterator upper_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
287
|
Chris@16
|
288 //! @copydoc ::boost::intrusive::bstree::upper_bound(const_reference)const
|
Chris@16
|
289 const_iterator upper_bound(const_reference value) const;
|
Chris@16
|
290
|
Chris@16
|
291 //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
292 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
293 const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
294
|
Chris@16
|
295 //! @copydoc ::boost::intrusive::bstree::find(const_reference)
|
Chris@16
|
296 iterator find(const_reference value);
|
Chris@16
|
297
|
Chris@16
|
298 //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyValueCompare)
|
Chris@16
|
299 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
300 iterator find(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
301
|
Chris@16
|
302 //! @copydoc ::boost::intrusive::bstree::find(const_reference)const
|
Chris@16
|
303 const_iterator find(const_reference value) const;
|
Chris@16
|
304
|
Chris@16
|
305 //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyValueCompare)const
|
Chris@16
|
306 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
307 const_iterator find(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
308
|
Chris@101
|
309 #endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
310
|
Chris@101
|
311 //! @copydoc ::boost::intrusive::rbtree::equal_range(const_reference)
|
Chris@101
|
312 std::pair<iterator,iterator> equal_range(const_reference value)
|
Chris@101
|
313 { return this->tree_type::lower_bound_range(value); }
|
Chris@101
|
314
|
Chris@101
|
315 //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyValueCompare)
|
Chris@16
|
316 template<class KeyType, class KeyValueCompare>
|
Chris@101
|
317 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
|
Chris@101
|
318 { return this->tree_type::lower_bound_range(key, comp); }
|
Chris@16
|
319
|
Chris@101
|
320 //! @copydoc ::boost::intrusive::rbtree::equal_range(const_reference)const
|
Chris@16
|
321 std::pair<const_iterator, const_iterator>
|
Chris@101
|
322 equal_range(const_reference value) const
|
Chris@101
|
323 { return this->tree_type::lower_bound_range(value); }
|
Chris@16
|
324
|
Chris@101
|
325 //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyValueCompare)const
|
Chris@16
|
326 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
327 std::pair<const_iterator, const_iterator>
|
Chris@101
|
328 equal_range(const KeyType& key, KeyValueCompare comp) const
|
Chris@101
|
329 { return this->tree_type::lower_bound_range(key, comp); }
|
Chris@101
|
330
|
Chris@101
|
331 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
332
|
Chris@16
|
333 //! @copydoc ::boost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool)
|
Chris@16
|
334 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
335 (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed);
|
Chris@16
|
336
|
Chris@16
|
337 //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)
|
Chris@16
|
338 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
339 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
340 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed);
|
Chris@16
|
341
|
Chris@16
|
342 //! @copydoc ::boost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool)const
|
Chris@16
|
343 std::pair<const_iterator, const_iterator>
|
Chris@16
|
344 bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const;
|
Chris@16
|
345
|
Chris@16
|
346 //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const
|
Chris@16
|
347 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
348 std::pair<const_iterator, const_iterator> bounded_range
|
Chris@16
|
349 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const;
|
Chris@16
|
350
|
Chris@16
|
351 //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
|
Chris@16
|
352 static iterator s_iterator_to(reference value);
|
Chris@16
|
353
|
Chris@16
|
354 //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
|
Chris@16
|
355 static const_iterator s_iterator_to(const_reference value);
|
Chris@16
|
356
|
Chris@16
|
357 //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
|
Chris@16
|
358 iterator iterator_to(reference value);
|
Chris@16
|
359
|
Chris@16
|
360 //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
|
Chris@16
|
361 const_iterator iterator_to(const_reference value) const;
|
Chris@16
|
362
|
Chris@16
|
363 //! @copydoc ::boost::intrusive::bstree::init_node(reference)
|
Chris@16
|
364 static void init_node(reference value);
|
Chris@16
|
365
|
Chris@16
|
366 //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
|
Chris@16
|
367 pointer unlink_leftmost_without_rebalance();
|
Chris@16
|
368
|
Chris@16
|
369 //! @copydoc ::boost::intrusive::bstree::replace_node
|
Chris@16
|
370 void replace_node(iterator replace_this, reference with_this);
|
Chris@16
|
371
|
Chris@16
|
372 //! @copydoc ::boost::intrusive::bstree::remove_node
|
Chris@16
|
373 void remove_node(reference value);
|
Chris@16
|
374 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
375 };
|
Chris@16
|
376
|
Chris@16
|
377 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
378
|
Chris@16
|
379 template<class T, class ...Options>
|
Chris@16
|
380 bool operator!= (const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
|
Chris@16
|
381
|
Chris@16
|
382 template<class T, class ...Options>
|
Chris@16
|
383 bool operator>(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
|
Chris@16
|
384
|
Chris@16
|
385 template<class T, class ...Options>
|
Chris@16
|
386 bool operator<=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
|
Chris@16
|
387
|
Chris@16
|
388 template<class T, class ...Options>
|
Chris@16
|
389 bool operator>=(const bs_set_impl<T, Options...> &x, const bs_set_impl<T, Options...> &y);
|
Chris@16
|
390
|
Chris@16
|
391 template<class T, class ...Options>
|
Chris@16
|
392 void swap(bs_set_impl<T, Options...> &x, bs_set_impl<T, Options...> &y);
|
Chris@16
|
393
|
Chris@16
|
394 #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
395
|
Chris@16
|
396 //! Helper metafunction to define a \c bs_set that yields to the same type when the
|
Chris@16
|
397 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
398 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
399 template<class T, class ...Options>
|
Chris@16
|
400 #else
|
Chris@16
|
401 template<class T, class O1 = void, class O2 = void
|
Chris@101
|
402 , class O3 = void, class O4 = void
|
Chris@101
|
403 , class O5 = void>
|
Chris@16
|
404 #endif
|
Chris@16
|
405 struct make_bs_set
|
Chris@16
|
406 {
|
Chris@16
|
407 /// @cond
|
Chris@16
|
408 typedef typename pack_options
|
Chris@16
|
409 < bstree_defaults,
|
Chris@16
|
410 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
411 O1, O2, O3, O4, O5
|
Chris@16
|
412 #else
|
Chris@16
|
413 Options...
|
Chris@16
|
414 #endif
|
Chris@16
|
415 >::type packed_options;
|
Chris@16
|
416
|
Chris@16
|
417 typedef typename detail::get_value_traits
|
Chris@16
|
418 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
419
|
Chris@16
|
420 typedef bs_set_impl
|
Chris@16
|
421 < value_traits
|
Chris@16
|
422 , typename packed_options::compare
|
Chris@16
|
423 , typename packed_options::size_type
|
Chris@16
|
424 , packed_options::constant_time_size
|
Chris@101
|
425 , typename packed_options::header_holder_type
|
Chris@16
|
426 > implementation_defined;
|
Chris@16
|
427 /// @endcond
|
Chris@16
|
428 typedef implementation_defined type;
|
Chris@16
|
429 };
|
Chris@16
|
430
|
Chris@16
|
431 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
432 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
433 template<class T, class O1, class O2, class O3, class O4, class O5>
|
Chris@16
|
434 #else
|
Chris@16
|
435 template<class T, class ...Options>
|
Chris@16
|
436 #endif
|
Chris@16
|
437 class bs_set
|
Chris@16
|
438 : public make_bs_set<T,
|
Chris@16
|
439 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
440 O1, O2, O3, O4, O5
|
Chris@16
|
441 #else
|
Chris@16
|
442 Options...
|
Chris@16
|
443 #endif
|
Chris@16
|
444 >::type
|
Chris@16
|
445 {
|
Chris@16
|
446 typedef typename make_bs_set
|
Chris@16
|
447 <T,
|
Chris@16
|
448 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
449 O1, O2, O3, O4, O5
|
Chris@16
|
450 #else
|
Chris@16
|
451 Options...
|
Chris@16
|
452 #endif
|
Chris@16
|
453 >::type Base;
|
Chris@16
|
454
|
Chris@16
|
455 BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_set)
|
Chris@16
|
456 public:
|
Chris@16
|
457 typedef typename Base::value_compare value_compare;
|
Chris@16
|
458 typedef typename Base::value_traits value_traits;
|
Chris@16
|
459 typedef typename Base::iterator iterator;
|
Chris@16
|
460 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
461
|
Chris@16
|
462 //Assert if passed value traits are compatible with the type
|
Chris@16
|
463 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
Chris@16
|
464
|
Chris@16
|
465 explicit bs_set( const value_compare &cmp = value_compare()
|
Chris@16
|
466 , const value_traits &v_traits = value_traits())
|
Chris@16
|
467 : Base(cmp, v_traits)
|
Chris@16
|
468 {}
|
Chris@16
|
469
|
Chris@16
|
470 template<class Iterator>
|
Chris@16
|
471 bs_set( Iterator b, Iterator e
|
Chris@16
|
472 , const value_compare &cmp = value_compare()
|
Chris@16
|
473 , const value_traits &v_traits = value_traits())
|
Chris@16
|
474 : Base(b, e, cmp, v_traits)
|
Chris@16
|
475 {}
|
Chris@16
|
476
|
Chris@16
|
477 bs_set(BOOST_RV_REF(bs_set) x)
|
Chris@101
|
478 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
479 {}
|
Chris@16
|
480
|
Chris@16
|
481 bs_set& operator=(BOOST_RV_REF(bs_set) x)
|
Chris@101
|
482 { return static_cast<bs_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
483
|
Chris@16
|
484 static bs_set &container_from_end_iterator(iterator end_iterator)
|
Chris@16
|
485 { return static_cast<bs_set &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
486
|
Chris@16
|
487 static const bs_set &container_from_end_iterator(const_iterator end_iterator)
|
Chris@16
|
488 { return static_cast<const bs_set &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
489
|
Chris@16
|
490 static bs_set &container_from_iterator(iterator it)
|
Chris@16
|
491 { return static_cast<bs_set &>(Base::container_from_iterator(it)); }
|
Chris@16
|
492
|
Chris@16
|
493 static const bs_set &container_from_iterator(const_iterator it)
|
Chris@16
|
494 { return static_cast<const bs_set &>(Base::container_from_iterator(it)); }
|
Chris@16
|
495 };
|
Chris@16
|
496
|
Chris@16
|
497 #endif
|
Chris@16
|
498
|
Chris@16
|
499 //! The class template bs_multiset is an intrusive container, that mimics most of
|
Chris@16
|
500 //! the interface of std::multiset as described in the C++ standard.
|
Chris@16
|
501 //!
|
Chris@16
|
502 //! The template parameter \c T is the type to be managed by the container.
|
Chris@16
|
503 //! The user can specify additional options and if no options are provided
|
Chris@16
|
504 //! default options are used.
|
Chris@16
|
505 //!
|
Chris@16
|
506 //! The container supports the following options:
|
Chris@16
|
507 //! \c base_hook<>/member_hook<>/value_traits<>,
|
Chris@16
|
508 //! \c constant_time_size<>, \c size_type<> and
|
Chris@16
|
509 //! \c compare<>.
|
Chris@16
|
510 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
511 template<class T, class ...Options>
|
Chris@16
|
512 #else
|
Chris@101
|
513 template<class ValueTraits, class Compare, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
Chris@16
|
514 #endif
|
Chris@16
|
515 class bs_multiset_impl
|
Chris@16
|
516 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
517 : public bstree_impl<ValueTraits, Compare, SizeType, ConstantTimeSize, RbTreeAlgorithms, HeaderHolder>
|
Chris@16
|
518 #endif
|
Chris@16
|
519 {
|
Chris@16
|
520 /// @cond
|
Chris@101
|
521 typedef bstree_impl<ValueTraits, Compare, SizeType, ConstantTimeSize, RbTreeAlgorithms, HeaderHolder> tree_type;
|
Chris@16
|
522
|
Chris@16
|
523 BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset_impl)
|
Chris@16
|
524 typedef tree_type implementation_defined;
|
Chris@16
|
525 /// @endcond
|
Chris@16
|
526
|
Chris@16
|
527 public:
|
Chris@16
|
528 typedef typename implementation_defined::value_type value_type;
|
Chris@16
|
529 typedef typename implementation_defined::value_traits value_traits;
|
Chris@16
|
530 typedef typename implementation_defined::pointer pointer;
|
Chris@16
|
531 typedef typename implementation_defined::const_pointer const_pointer;
|
Chris@16
|
532 typedef typename implementation_defined::reference reference;
|
Chris@16
|
533 typedef typename implementation_defined::const_reference const_reference;
|
Chris@16
|
534 typedef typename implementation_defined::difference_type difference_type;
|
Chris@16
|
535 typedef typename implementation_defined::size_type size_type;
|
Chris@16
|
536 typedef typename implementation_defined::value_compare value_compare;
|
Chris@16
|
537 typedef typename implementation_defined::key_compare key_compare;
|
Chris@16
|
538 typedef typename implementation_defined::iterator iterator;
|
Chris@16
|
539 typedef typename implementation_defined::const_iterator const_iterator;
|
Chris@16
|
540 typedef typename implementation_defined::reverse_iterator reverse_iterator;
|
Chris@16
|
541 typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
|
Chris@16
|
542 typedef typename implementation_defined::insert_commit_data insert_commit_data;
|
Chris@16
|
543 typedef typename implementation_defined::node_traits node_traits;
|
Chris@16
|
544 typedef typename implementation_defined::node node;
|
Chris@16
|
545 typedef typename implementation_defined::node_ptr node_ptr;
|
Chris@16
|
546 typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
Chris@16
|
547 typedef typename implementation_defined::node_algorithms node_algorithms;
|
Chris@16
|
548
|
Chris@16
|
549 static const bool constant_time_size = tree_type::constant_time_size;
|
Chris@16
|
550
|
Chris@16
|
551 public:
|
Chris@16
|
552 //! @copydoc ::boost::intrusive::bstree::bstree(const value_compare &,const value_traits &)
|
Chris@16
|
553 explicit bs_multiset_impl( const value_compare &cmp = value_compare()
|
Chris@16
|
554 , const value_traits &v_traits = value_traits())
|
Chris@16
|
555 : tree_type(cmp, v_traits)
|
Chris@16
|
556 {}
|
Chris@16
|
557
|
Chris@16
|
558 //! @copydoc ::boost::intrusive::bstree::bstree(bool,Iterator,Iterator,const value_compare &,const value_traits &)
|
Chris@16
|
559 template<class Iterator>
|
Chris@16
|
560 bs_multiset_impl( Iterator b, Iterator e
|
Chris@16
|
561 , const value_compare &cmp = value_compare()
|
Chris@16
|
562 , const value_traits &v_traits = value_traits())
|
Chris@16
|
563 : tree_type(false, b, e, cmp, v_traits)
|
Chris@16
|
564 {}
|
Chris@16
|
565
|
Chris@16
|
566 //! @copydoc ::boost::intrusive::bstree::bstree(bstree &&)
|
Chris@16
|
567 bs_multiset_impl(BOOST_RV_REF(bs_multiset_impl) x)
|
Chris@101
|
568 : tree_type(BOOST_MOVE_BASE(tree_type, x))
|
Chris@16
|
569 {}
|
Chris@16
|
570
|
Chris@16
|
571 //! @copydoc ::boost::intrusive::bstree::operator=(bstree &&)
|
Chris@16
|
572 bs_multiset_impl& operator=(BOOST_RV_REF(bs_multiset_impl) x)
|
Chris@101
|
573 { return static_cast<bs_multiset_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
|
Chris@16
|
574
|
Chris@16
|
575 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
576 //! @copydoc ::boost::intrusive::bstree::~bstree()
|
Chris@16
|
577 ~bs_multiset_impl();
|
Chris@16
|
578
|
Chris@16
|
579 //! @copydoc ::boost::intrusive::bstree::begin()
|
Chris@16
|
580 iterator begin();
|
Chris@16
|
581
|
Chris@16
|
582 //! @copydoc ::boost::intrusive::bstree::begin()const
|
Chris@16
|
583 const_iterator begin() const;
|
Chris@16
|
584
|
Chris@16
|
585 //! @copydoc ::boost::intrusive::bstree::cbegin()const
|
Chris@16
|
586 const_iterator cbegin() const;
|
Chris@16
|
587
|
Chris@16
|
588 //! @copydoc ::boost::intrusive::bstree::end()
|
Chris@16
|
589 iterator end();
|
Chris@16
|
590
|
Chris@16
|
591 //! @copydoc ::boost::intrusive::bstree::end()const
|
Chris@16
|
592 const_iterator end() const;
|
Chris@16
|
593
|
Chris@16
|
594 //! @copydoc ::boost::intrusive::bstree::cend()const
|
Chris@16
|
595 const_iterator cend() const;
|
Chris@16
|
596
|
Chris@16
|
597 //! @copydoc ::boost::intrusive::bstree::rbegin()
|
Chris@16
|
598 reverse_iterator rbegin();
|
Chris@16
|
599
|
Chris@16
|
600 //! @copydoc ::boost::intrusive::bstree::rbegin()const
|
Chris@16
|
601 const_reverse_iterator rbegin() const;
|
Chris@16
|
602
|
Chris@16
|
603 //! @copydoc ::boost::intrusive::bstree::crbegin()const
|
Chris@16
|
604 const_reverse_iterator crbegin() const;
|
Chris@16
|
605
|
Chris@16
|
606 //! @copydoc ::boost::intrusive::bstree::rend()
|
Chris@16
|
607 reverse_iterator rend();
|
Chris@16
|
608
|
Chris@16
|
609 //! @copydoc ::boost::intrusive::bstree::rend()const
|
Chris@16
|
610 const_reverse_iterator rend() const;
|
Chris@16
|
611
|
Chris@16
|
612 //! @copydoc ::boost::intrusive::bstree::crend()const
|
Chris@16
|
613 const_reverse_iterator crend() const;
|
Chris@16
|
614
|
Chris@16
|
615 //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(iterator)
|
Chris@16
|
616 static bs_multiset_impl &container_from_end_iterator(iterator end_iterator);
|
Chris@16
|
617
|
Chris@16
|
618 //! @copydoc ::boost::intrusive::bstree::container_from_end_iterator(const_iterator)
|
Chris@16
|
619 static const bs_multiset_impl &container_from_end_iterator(const_iterator end_iterator);
|
Chris@16
|
620
|
Chris@16
|
621 //! @copydoc ::boost::intrusive::bstree::container_from_iterator(iterator)
|
Chris@16
|
622 static bs_multiset_impl &container_from_iterator(iterator it);
|
Chris@16
|
623
|
Chris@16
|
624 //! @copydoc ::boost::intrusive::bstree::container_from_iterator(const_iterator)
|
Chris@16
|
625 static const bs_multiset_impl &container_from_iterator(const_iterator it);
|
Chris@16
|
626
|
Chris@16
|
627 //! @copydoc ::boost::intrusive::bstree::key_comp()const
|
Chris@16
|
628 key_compare key_comp() const;
|
Chris@16
|
629
|
Chris@16
|
630 //! @copydoc ::boost::intrusive::bstree::value_comp()const
|
Chris@16
|
631 value_compare value_comp() const;
|
Chris@16
|
632
|
Chris@16
|
633 //! @copydoc ::boost::intrusive::bstree::empty()const
|
Chris@16
|
634 bool empty() const;
|
Chris@16
|
635
|
Chris@16
|
636 //! @copydoc ::boost::intrusive::bstree::size()const
|
Chris@16
|
637 size_type size() const;
|
Chris@16
|
638
|
Chris@16
|
639 //! @copydoc ::boost::intrusive::bstree::swap
|
Chris@16
|
640 void swap(bs_multiset_impl& other);
|
Chris@16
|
641
|
Chris@16
|
642 //! @copydoc ::boost::intrusive::bstree::clone_from
|
Chris@16
|
643 template <class Cloner, class Disposer>
|
Chris@16
|
644 void clone_from(const bs_multiset_impl &src, Cloner cloner, Disposer disposer);
|
Chris@16
|
645
|
Chris@16
|
646 #endif //#ifdef BOOST_iNTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
647
|
Chris@16
|
648 //! @copydoc ::boost::intrusive::bstree::insert_equal(reference)
|
Chris@16
|
649 iterator insert(reference value)
|
Chris@16
|
650 { return tree_type::insert_equal(value); }
|
Chris@16
|
651
|
Chris@16
|
652 //! @copydoc ::boost::intrusive::bstree::insert_equal(const_iterator,reference)
|
Chris@16
|
653 iterator insert(const_iterator hint, reference value)
|
Chris@16
|
654 { return tree_type::insert_equal(hint, value); }
|
Chris@16
|
655
|
Chris@16
|
656 //! @copydoc ::boost::intrusive::bstree::insert_equal(Iterator,Iterator)
|
Chris@16
|
657 template<class Iterator>
|
Chris@16
|
658 void insert(Iterator b, Iterator e)
|
Chris@16
|
659 { tree_type::insert_equal(b, e); }
|
Chris@16
|
660
|
Chris@16
|
661 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
662 //! @copydoc ::boost::intrusive::bstree::insert_before
|
Chris@16
|
663 iterator insert_before(const_iterator pos, reference value);
|
Chris@16
|
664
|
Chris@16
|
665 //! @copydoc ::boost::intrusive::bstree::push_back
|
Chris@16
|
666 void push_back(reference value);
|
Chris@16
|
667
|
Chris@16
|
668 //! @copydoc ::boost::intrusive::bstree::push_front
|
Chris@16
|
669 void push_front(reference value);
|
Chris@16
|
670
|
Chris@16
|
671 //! @copydoc ::boost::intrusive::bstree::erase(const_iterator)
|
Chris@16
|
672 iterator erase(const_iterator i);
|
Chris@16
|
673
|
Chris@16
|
674 //! @copydoc ::boost::intrusive::bstree::erase(const_iterator,const_iterator)
|
Chris@16
|
675 iterator erase(const_iterator b, const_iterator e);
|
Chris@16
|
676
|
Chris@16
|
677 //! @copydoc ::boost::intrusive::bstree::erase(const_reference)
|
Chris@16
|
678 size_type erase(const_reference value);
|
Chris@16
|
679
|
Chris@16
|
680 //! @copydoc ::boost::intrusive::bstree::erase(const KeyType&,KeyValueCompare)
|
Chris@16
|
681 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
682 size_type erase(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
683
|
Chris@16
|
684 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,Disposer)
|
Chris@16
|
685 template<class Disposer>
|
Chris@16
|
686 iterator erase_and_dispose(const_iterator i, Disposer disposer);
|
Chris@16
|
687
|
Chris@16
|
688 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_iterator,const_iterator,Disposer)
|
Chris@16
|
689 template<class Disposer>
|
Chris@16
|
690 iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer);
|
Chris@16
|
691
|
Chris@16
|
692 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const_reference, Disposer)
|
Chris@16
|
693 template<class Disposer>
|
Chris@16
|
694 size_type erase_and_dispose(const_reference value, Disposer disposer);
|
Chris@16
|
695
|
Chris@16
|
696 //! @copydoc ::boost::intrusive::bstree::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer)
|
Chris@16
|
697 template<class KeyType, class KeyValueCompare, class Disposer>
|
Chris@16
|
698 size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer);
|
Chris@16
|
699
|
Chris@16
|
700 //! @copydoc ::boost::intrusive::bstree::clear
|
Chris@16
|
701 void clear();
|
Chris@16
|
702
|
Chris@16
|
703 //! @copydoc ::boost::intrusive::bstree::clear_and_dispose
|
Chris@16
|
704 template<class Disposer>
|
Chris@16
|
705 void clear_and_dispose(Disposer disposer);
|
Chris@16
|
706
|
Chris@16
|
707 //! @copydoc ::boost::intrusive::bstree::count(const_reference)const
|
Chris@16
|
708 size_type count(const_reference value) const;
|
Chris@16
|
709
|
Chris@16
|
710 //! @copydoc ::boost::intrusive::bstree::count(const KeyType&,KeyValueCompare)const
|
Chris@16
|
711 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
712 size_type count(const KeyType& key, KeyValueCompare comp) const;
|
Chris@101
|
713
|
Chris@16
|
714 //! @copydoc ::boost::intrusive::bstree::lower_bound(const_reference)
|
Chris@16
|
715 iterator lower_bound(const_reference value);
|
Chris@101
|
716
|
Chris@16
|
717 //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
718 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
719 iterator lower_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
720
|
Chris@16
|
721 //! @copydoc ::boost::intrusive::bstree::lower_bound(const_reference)const
|
Chris@16
|
722 const_iterator lower_bound(const_reference value) const;
|
Chris@16
|
723
|
Chris@16
|
724 //! @copydoc ::boost::intrusive::bstree::lower_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
725 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
726 const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
727
|
Chris@16
|
728 //! @copydoc ::boost::intrusive::bstree::upper_bound(const_reference)
|
Chris@16
|
729 iterator upper_bound(const_reference value);
|
Chris@16
|
730
|
Chris@16
|
731 //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
732 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
733 iterator upper_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
734
|
Chris@16
|
735 //! @copydoc ::boost::intrusive::bstree::upper_bound(const_reference)const
|
Chris@16
|
736 const_iterator upper_bound(const_reference value) const;
|
Chris@16
|
737
|
Chris@16
|
738 //! @copydoc ::boost::intrusive::bstree::upper_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
739 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
740 const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
741
|
Chris@16
|
742 //! @copydoc ::boost::intrusive::bstree::find(const_reference)
|
Chris@16
|
743 iterator find(const_reference value);
|
Chris@16
|
744
|
Chris@16
|
745 //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyValueCompare)
|
Chris@16
|
746 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
747 iterator find(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
748
|
Chris@16
|
749 //! @copydoc ::boost::intrusive::bstree::find(const_reference)const
|
Chris@16
|
750 const_iterator find(const_reference value) const;
|
Chris@16
|
751
|
Chris@16
|
752 //! @copydoc ::boost::intrusive::bstree::find(const KeyType&,KeyValueCompare)const
|
Chris@16
|
753 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
754 const_iterator find(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
755
|
Chris@16
|
756 //! @copydoc ::boost::intrusive::bstree::equal_range(const_reference)
|
Chris@16
|
757 std::pair<iterator,iterator> equal_range(const_reference value);
|
Chris@16
|
758
|
Chris@16
|
759 //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyValueCompare)
|
Chris@16
|
760 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
761 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
762
|
Chris@16
|
763 //! @copydoc ::boost::intrusive::bstree::equal_range(const_reference)const
|
Chris@16
|
764 std::pair<const_iterator, const_iterator>
|
Chris@16
|
765 equal_range(const_reference value) const;
|
Chris@16
|
766
|
Chris@16
|
767 //! @copydoc ::boost::intrusive::bstree::equal_range(const KeyType&,KeyValueCompare)const
|
Chris@16
|
768 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
769 std::pair<const_iterator, const_iterator>
|
Chris@16
|
770 equal_range(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
771
|
Chris@16
|
772 //! @copydoc ::boost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool)
|
Chris@16
|
773 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
774 (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed);
|
Chris@16
|
775
|
Chris@16
|
776 //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)
|
Chris@16
|
777 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
778 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
779 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed);
|
Chris@16
|
780
|
Chris@16
|
781 //! @copydoc ::boost::intrusive::bstree::bounded_range(const_reference,const_reference,bool,bool)const
|
Chris@16
|
782 std::pair<const_iterator, const_iterator>
|
Chris@16
|
783 bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const;
|
Chris@16
|
784
|
Chris@16
|
785 //! @copydoc ::boost::intrusive::bstree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const
|
Chris@16
|
786 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
787 std::pair<const_iterator, const_iterator> bounded_range
|
Chris@16
|
788 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const;
|
Chris@16
|
789
|
Chris@16
|
790 //! @copydoc ::boost::intrusive::bstree::s_iterator_to(reference)
|
Chris@16
|
791 static iterator s_iterator_to(reference value);
|
Chris@16
|
792
|
Chris@16
|
793 //! @copydoc ::boost::intrusive::bstree::s_iterator_to(const_reference)
|
Chris@16
|
794 static const_iterator s_iterator_to(const_reference value);
|
Chris@16
|
795
|
Chris@16
|
796 //! @copydoc ::boost::intrusive::bstree::iterator_to(reference)
|
Chris@16
|
797 iterator iterator_to(reference value);
|
Chris@16
|
798
|
Chris@16
|
799 //! @copydoc ::boost::intrusive::bstree::iterator_to(const_reference)const
|
Chris@16
|
800 const_iterator iterator_to(const_reference value) const;
|
Chris@16
|
801
|
Chris@16
|
802 //! @copydoc ::boost::intrusive::bstree::init_node(reference)
|
Chris@16
|
803 static void init_node(reference value);
|
Chris@16
|
804
|
Chris@16
|
805 //! @copydoc ::boost::intrusive::bstree::unlink_leftmost_without_rebalance
|
Chris@16
|
806 pointer unlink_leftmost_without_rebalance();
|
Chris@16
|
807
|
Chris@16
|
808 //! @copydoc ::boost::intrusive::bstree::replace_node
|
Chris@16
|
809 void replace_node(iterator replace_this, reference with_this);
|
Chris@16
|
810
|
Chris@16
|
811 //! @copydoc ::boost::intrusive::bstree::remove_node
|
Chris@16
|
812 void remove_node(reference value);
|
Chris@16
|
813 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
814 };
|
Chris@16
|
815
|
Chris@16
|
816 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
817
|
Chris@16
|
818 template<class T, class ...Options>
|
Chris@16
|
819 bool operator!= (const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
|
Chris@16
|
820
|
Chris@16
|
821 template<class T, class ...Options>
|
Chris@16
|
822 bool operator>(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
|
Chris@16
|
823
|
Chris@16
|
824 template<class T, class ...Options>
|
Chris@16
|
825 bool operator<=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
|
Chris@16
|
826
|
Chris@16
|
827 template<class T, class ...Options>
|
Chris@16
|
828 bool operator>=(const bs_multiset_impl<T, Options...> &x, const bs_multiset_impl<T, Options...> &y);
|
Chris@16
|
829
|
Chris@16
|
830 template<class T, class ...Options>
|
Chris@16
|
831 void swap(bs_multiset_impl<T, Options...> &x, bs_multiset_impl<T, Options...> &y);
|
Chris@16
|
832
|
Chris@16
|
833 #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
834
|
Chris@16
|
835 //! Helper metafunction to define a \c bs_multiset that yields to the same type when the
|
Chris@16
|
836 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
837 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
838 template<class T, class ...Options>
|
Chris@16
|
839 #else
|
Chris@16
|
840 template<class T, class O1 = void, class O2 = void
|
Chris@101
|
841 , class O3 = void, class O4 = void
|
Chris@101
|
842 , class O5 = void>
|
Chris@16
|
843 #endif
|
Chris@16
|
844 struct make_bs_multiset
|
Chris@16
|
845 {
|
Chris@16
|
846 /// @cond
|
Chris@16
|
847 typedef typename pack_options
|
Chris@16
|
848 < bstree_defaults,
|
Chris@16
|
849 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
850 O1, O2, O3, O4, O5
|
Chris@16
|
851 #else
|
Chris@16
|
852 Options...
|
Chris@16
|
853 #endif
|
Chris@16
|
854 >::type packed_options;
|
Chris@16
|
855
|
Chris@16
|
856 typedef typename detail::get_value_traits
|
Chris@16
|
857 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
858
|
Chris@16
|
859 typedef bs_multiset_impl
|
Chris@16
|
860 < value_traits
|
Chris@16
|
861 , typename packed_options::compare
|
Chris@16
|
862 , typename packed_options::size_type
|
Chris@16
|
863 , packed_options::constant_time_size
|
Chris@101
|
864 , typename packed_options::header_holder_type
|
Chris@16
|
865 > implementation_defined;
|
Chris@16
|
866 /// @endcond
|
Chris@16
|
867 typedef implementation_defined type;
|
Chris@16
|
868 };
|
Chris@16
|
869
|
Chris@16
|
870 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
871
|
Chris@16
|
872 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
873 template<class T, class O1, class O2, class O3, class O4, class O5>
|
Chris@16
|
874 #else
|
Chris@16
|
875 template<class T, class ...Options>
|
Chris@16
|
876 #endif
|
Chris@16
|
877 class bs_multiset
|
Chris@16
|
878 : public make_bs_multiset<T,
|
Chris@16
|
879 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
880 O1, O2, O3, O4, O5
|
Chris@16
|
881 #else
|
Chris@16
|
882 Options...
|
Chris@16
|
883 #endif
|
Chris@16
|
884 >::type
|
Chris@16
|
885 {
|
Chris@16
|
886 typedef typename make_bs_multiset<T,
|
Chris@16
|
887 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
888 O1, O2, O3, O4, O5
|
Chris@16
|
889 #else
|
Chris@16
|
890 Options...
|
Chris@16
|
891 #endif
|
Chris@16
|
892 >::type Base;
|
Chris@16
|
893
|
Chris@16
|
894 BOOST_MOVABLE_BUT_NOT_COPYABLE(bs_multiset)
|
Chris@16
|
895
|
Chris@16
|
896 public:
|
Chris@16
|
897 typedef typename Base::value_compare value_compare;
|
Chris@16
|
898 typedef typename Base::value_traits value_traits;
|
Chris@16
|
899 typedef typename Base::iterator iterator;
|
Chris@16
|
900 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
901
|
Chris@16
|
902 //Assert if passed value traits are compatible with the type
|
Chris@16
|
903 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
Chris@16
|
904
|
Chris@16
|
905 explicit bs_multiset( const value_compare &cmp = value_compare()
|
Chris@16
|
906 , const value_traits &v_traits = value_traits())
|
Chris@16
|
907 : Base(cmp, v_traits)
|
Chris@16
|
908 {}
|
Chris@16
|
909
|
Chris@16
|
910 template<class Iterator>
|
Chris@16
|
911 bs_multiset( Iterator b, Iterator e
|
Chris@16
|
912 , const value_compare &cmp = value_compare()
|
Chris@16
|
913 , const value_traits &v_traits = value_traits())
|
Chris@16
|
914 : Base(b, e, cmp, v_traits)
|
Chris@16
|
915 {}
|
Chris@16
|
916
|
Chris@16
|
917 bs_multiset(BOOST_RV_REF(bs_multiset) x)
|
Chris@101
|
918 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
919 {}
|
Chris@16
|
920
|
Chris@16
|
921 bs_multiset& operator=(BOOST_RV_REF(bs_multiset) x)
|
Chris@101
|
922 { return static_cast<bs_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
923
|
Chris@16
|
924 static bs_multiset &container_from_end_iterator(iterator end_iterator)
|
Chris@16
|
925 { return static_cast<bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
926
|
Chris@16
|
927 static const bs_multiset &container_from_end_iterator(const_iterator end_iterator)
|
Chris@16
|
928 { return static_cast<const bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
929
|
Chris@16
|
930 static bs_multiset &container_from_iterator(iterator it)
|
Chris@16
|
931 { return static_cast<bs_multiset &>(Base::container_from_iterator(it)); }
|
Chris@16
|
932
|
Chris@16
|
933 static const bs_multiset &container_from_iterator(const_iterator it)
|
Chris@16
|
934 { return static_cast<const bs_multiset &>(Base::container_from_iterator(it)); }
|
Chris@16
|
935 };
|
Chris@16
|
936
|
Chris@16
|
937 #endif
|
Chris@16
|
938
|
Chris@16
|
939 } //namespace intrusive
|
Chris@16
|
940 } //namespace boost
|
Chris@16
|
941
|
Chris@16
|
942 #include <boost/intrusive/detail/config_end.hpp>
|
Chris@16
|
943
|
Chris@16
|
944 #endif //BOOST_INTRUSIVE_BS_SET_HPP
|