Chris@16
|
1 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@101
|
3 // (C) Copyright Ion Gaztanaga 2007-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_SG_SET_HPP
|
Chris@16
|
13 #define BOOST_INTRUSIVE_SG_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/sgtree.hpp>
|
Chris@101
|
19 #include <boost/static_assert.hpp>
|
Chris@101
|
20 #include <boost/move/utility_core.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 sg_set is an intrusive container, that mimics most of
|
Chris@16
|
30 //! the interface of std::sg_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 floating_point<>, \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 FloatingPoint, typename HeaderHolder>
|
Chris@16
|
44 #endif
|
Chris@16
|
45 class sg_set_impl
|
Chris@16
|
46 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
47 : public sgtree_impl<ValueTraits, Compare, SizeType, FloatingPoint, HeaderHolder>
|
Chris@16
|
48 #endif
|
Chris@16
|
49 {
|
Chris@16
|
50 /// @cond
|
Chris@101
|
51 typedef sgtree_impl<ValueTraits, Compare, SizeType, FloatingPoint, HeaderHolder> tree_type;
|
Chris@16
|
52 BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_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::sgtree::sgtree(const value_compare &,const value_traits &)
|
Chris@16
|
83 explicit sg_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::sgtree::sgtree(bool,Iterator,Iterator,const value_compare &,const value_traits &)
|
Chris@16
|
89 template<class Iterator>
|
Chris@16
|
90 sg_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::sgtree::sgtree(sgtree &&)
|
Chris@16
|
97 sg_set_impl(BOOST_RV_REF(sg_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::sgtree::operator=(sgtree &&)
|
Chris@16
|
102 sg_set_impl& operator=(BOOST_RV_REF(sg_set_impl) x)
|
Chris@101
|
103 { return static_cast<sg_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::sgtree::~sgtree()
|
Chris@16
|
107 ~sg_set_impl();
|
Chris@16
|
108
|
Chris@16
|
109 //! @copydoc ::boost::intrusive::sgtree::begin()
|
Chris@16
|
110 iterator begin();
|
Chris@16
|
111
|
Chris@16
|
112 //! @copydoc ::boost::intrusive::sgtree::begin()const
|
Chris@16
|
113 const_iterator begin() const;
|
Chris@16
|
114
|
Chris@16
|
115 //! @copydoc ::boost::intrusive::sgtree::cbegin()const
|
Chris@16
|
116 const_iterator cbegin() const;
|
Chris@16
|
117
|
Chris@16
|
118 //! @copydoc ::boost::intrusive::sgtree::end()
|
Chris@16
|
119 iterator end();
|
Chris@16
|
120
|
Chris@16
|
121 //! @copydoc ::boost::intrusive::sgtree::end()const
|
Chris@16
|
122 const_iterator end() const;
|
Chris@16
|
123
|
Chris@16
|
124 //! @copydoc ::boost::intrusive::sgtree::cend()const
|
Chris@16
|
125 const_iterator cend() const;
|
Chris@16
|
126
|
Chris@16
|
127 //! @copydoc ::boost::intrusive::sgtree::rbegin()
|
Chris@16
|
128 reverse_iterator rbegin();
|
Chris@16
|
129
|
Chris@16
|
130 //! @copydoc ::boost::intrusive::sgtree::rbegin()const
|
Chris@16
|
131 const_reverse_iterator rbegin() const;
|
Chris@16
|
132
|
Chris@16
|
133 //! @copydoc ::boost::intrusive::sgtree::crbegin()const
|
Chris@16
|
134 const_reverse_iterator crbegin() const;
|
Chris@16
|
135
|
Chris@16
|
136 //! @copydoc ::boost::intrusive::sgtree::rend()
|
Chris@16
|
137 reverse_iterator rend();
|
Chris@16
|
138
|
Chris@16
|
139 //! @copydoc ::boost::intrusive::sgtree::rend()const
|
Chris@16
|
140 const_reverse_iterator rend() const;
|
Chris@16
|
141
|
Chris@16
|
142 //! @copydoc ::boost::intrusive::sgtree::crend()const
|
Chris@16
|
143 const_reverse_iterator crend() const;
|
Chris@16
|
144
|
Chris@16
|
145 //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(iterator)
|
Chris@16
|
146 static sg_set_impl &container_from_end_iterator(iterator end_iterator);
|
Chris@16
|
147
|
Chris@16
|
148 //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(const_iterator)
|
Chris@16
|
149 static const sg_set_impl &container_from_end_iterator(const_iterator end_iterator);
|
Chris@16
|
150
|
Chris@16
|
151 //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(iterator)
|
Chris@16
|
152 static sg_set_impl &container_from_iterator(iterator it);
|
Chris@16
|
153
|
Chris@16
|
154 //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(const_iterator)
|
Chris@16
|
155 static const sg_set_impl &container_from_iterator(const_iterator it);
|
Chris@16
|
156
|
Chris@16
|
157 //! @copydoc ::boost::intrusive::sgtree::key_comp()const
|
Chris@16
|
158 key_compare key_comp() const;
|
Chris@16
|
159
|
Chris@16
|
160 //! @copydoc ::boost::intrusive::sgtree::value_comp()const
|
Chris@16
|
161 value_compare value_comp() const;
|
Chris@16
|
162
|
Chris@16
|
163 //! @copydoc ::boost::intrusive::sgtree::empty()const
|
Chris@16
|
164 bool empty() const;
|
Chris@16
|
165
|
Chris@16
|
166 //! @copydoc ::boost::intrusive::sgtree::size()const
|
Chris@16
|
167 size_type size() const;
|
Chris@16
|
168
|
Chris@16
|
169 //! @copydoc ::boost::intrusive::sgtree::swap
|
Chris@16
|
170 void swap(sg_set_impl& other);
|
Chris@16
|
171
|
Chris@16
|
172 //! @copydoc ::boost::intrusive::sgtree::clone_from
|
Chris@16
|
173 template <class Cloner, class Disposer>
|
Chris@16
|
174 void clone_from(const sg_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::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::insert_before
|
Chris@16
|
210 iterator insert_before(const_iterator pos, reference value);
|
Chris@16
|
211
|
Chris@16
|
212 //! @copydoc ::boost::intrusive::sgtree::push_back
|
Chris@16
|
213 void push_back(reference value);
|
Chris@16
|
214
|
Chris@16
|
215 //! @copydoc ::boost::intrusive::sgtree::push_front
|
Chris@16
|
216 void push_front(reference value);
|
Chris@16
|
217
|
Chris@16
|
218 //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator)
|
Chris@16
|
219 iterator erase(const_iterator i);
|
Chris@16
|
220
|
Chris@16
|
221 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::erase(const_reference)
|
Chris@16
|
225 size_type erase(const_reference value);
|
Chris@16
|
226
|
Chris@16
|
227 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::clear
|
Chris@16
|
248 void clear();
|
Chris@16
|
249
|
Chris@16
|
250 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::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::sgtree::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::sgtree::lower_bound(const_reference)
|
Chris@16
|
268 iterator lower_bound(const_reference value);
|
Chris@101
|
269
|
Chris@16
|
270 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::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::sgtree::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::sgtree::upper_bound(const_reference)
|
Chris@16
|
282 iterator upper_bound(const_reference value);
|
Chris@16
|
283
|
Chris@16
|
284 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::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::sgtree::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::sgtree::find(const_reference)
|
Chris@16
|
296 iterator find(const_reference value);
|
Chris@16
|
297
|
Chris@16
|
298 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::find(const_reference)const
|
Chris@16
|
303 const_iterator find(const_reference value) const;
|
Chris@16
|
304
|
Chris@16
|
305 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::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::sgtree::s_iterator_to(reference)
|
Chris@16
|
352 static iterator s_iterator_to(reference value);
|
Chris@16
|
353
|
Chris@16
|
354 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::iterator_to(reference)
|
Chris@16
|
358 iterator iterator_to(reference value);
|
Chris@16
|
359
|
Chris@16
|
360 //! @copydoc ::boost::intrusive::sgtree::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::sgtree::init_node(reference)
|
Chris@16
|
364 static void init_node(reference value);
|
Chris@16
|
365
|
Chris@16
|
366 //! @copydoc ::boost::intrusive::sgtree::unlink_leftmost_without_rebalance
|
Chris@16
|
367 pointer unlink_leftmost_without_rebalance();
|
Chris@16
|
368
|
Chris@16
|
369 //! @copydoc ::boost::intrusive::sgtree::replace_node
|
Chris@16
|
370 void replace_node(iterator replace_this, reference with_this);
|
Chris@16
|
371
|
Chris@16
|
372 //! @copydoc ::boost::intrusive::sgtree::remove_node
|
Chris@16
|
373 void remove_node(reference value);
|
Chris@16
|
374
|
Chris@16
|
375 //! @copydoc ::boost::intrusive::sgtree::rebalance
|
Chris@16
|
376 void rebalance();
|
Chris@16
|
377
|
Chris@16
|
378 //! @copydoc ::boost::intrusive::sgtree::rebalance_subtree
|
Chris@16
|
379 iterator rebalance_subtree(iterator root);
|
Chris@16
|
380
|
Chris@16
|
381 //! @copydoc ::boost::intrusive::sgtree::balance_factor()
|
Chris@16
|
382 float balance_factor() const;
|
Chris@16
|
383
|
Chris@16
|
384 //! @copydoc ::boost::intrusive::sgtree::balance_factor(float)
|
Chris@16
|
385 void balance_factor(float new_alpha);
|
Chris@16
|
386
|
Chris@16
|
387 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
388 };
|
Chris@16
|
389
|
Chris@16
|
390 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
391
|
Chris@16
|
392 template<class T, class ...Options>
|
Chris@16
|
393 bool operator!= (const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y);
|
Chris@16
|
394
|
Chris@16
|
395 template<class T, class ...Options>
|
Chris@16
|
396 bool operator>(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y);
|
Chris@16
|
397
|
Chris@16
|
398 template<class T, class ...Options>
|
Chris@16
|
399 bool operator<=(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y);
|
Chris@16
|
400
|
Chris@16
|
401 template<class T, class ...Options>
|
Chris@16
|
402 bool operator>=(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y);
|
Chris@16
|
403
|
Chris@16
|
404 template<class T, class ...Options>
|
Chris@16
|
405 void swap(sg_set_impl<T, Options...> &x, sg_set_impl<T, Options...> &y);
|
Chris@16
|
406
|
Chris@16
|
407 #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
408
|
Chris@16
|
409 //! Helper metafunction to define a \c sg_set that yields to the same type when the
|
Chris@16
|
410 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
411 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
412 template<class T, class ...Options>
|
Chris@16
|
413 #else
|
Chris@16
|
414 template<class T, class O1 = void, class O2 = void
|
Chris@101
|
415 , class O3 = void, class O4 = void
|
Chris@101
|
416 , class O5 = void>
|
Chris@16
|
417 #endif
|
Chris@16
|
418 struct make_sg_set
|
Chris@16
|
419 {
|
Chris@16
|
420 /// @cond
|
Chris@16
|
421 typedef typename pack_options
|
Chris@16
|
422 < sgtree_defaults,
|
Chris@16
|
423 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
424 O1, O2, O3, O4, O5
|
Chris@16
|
425 #else
|
Chris@16
|
426 Options...
|
Chris@16
|
427 #endif
|
Chris@16
|
428 >::type packed_options;
|
Chris@16
|
429
|
Chris@16
|
430 typedef typename detail::get_value_traits
|
Chris@16
|
431 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
432
|
Chris@16
|
433 typedef sg_set_impl
|
Chris@16
|
434 < value_traits
|
Chris@16
|
435 , typename packed_options::compare
|
Chris@16
|
436 , typename packed_options::size_type
|
Chris@16
|
437 , packed_options::floating_point
|
Chris@101
|
438 , typename packed_options::header_holder_type
|
Chris@16
|
439 > implementation_defined;
|
Chris@16
|
440 /// @endcond
|
Chris@16
|
441 typedef implementation_defined type;
|
Chris@16
|
442 };
|
Chris@16
|
443
|
Chris@16
|
444 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
445 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
446 template<class T, class O1, class O2, class O3, class O4, class O5>
|
Chris@16
|
447 #else
|
Chris@16
|
448 template<class T, class ...Options>
|
Chris@16
|
449 #endif
|
Chris@16
|
450 class sg_set
|
Chris@16
|
451 : public make_sg_set<T,
|
Chris@16
|
452 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
453 O1, O2, O3, O4, O5
|
Chris@16
|
454 #else
|
Chris@16
|
455 Options...
|
Chris@16
|
456 #endif
|
Chris@16
|
457 >::type
|
Chris@16
|
458 {
|
Chris@16
|
459 typedef typename make_sg_set
|
Chris@16
|
460 <T,
|
Chris@16
|
461 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
462 O1, O2, O3, O4, O5
|
Chris@16
|
463 #else
|
Chris@16
|
464 Options...
|
Chris@16
|
465 #endif
|
Chris@16
|
466 >::type Base;
|
Chris@16
|
467
|
Chris@16
|
468 BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_set)
|
Chris@16
|
469 public:
|
Chris@16
|
470 typedef typename Base::value_compare value_compare;
|
Chris@16
|
471 typedef typename Base::value_traits value_traits;
|
Chris@16
|
472 typedef typename Base::iterator iterator;
|
Chris@16
|
473 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
474
|
Chris@16
|
475 //Assert if passed value traits are compatible with the type
|
Chris@16
|
476 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
Chris@16
|
477
|
Chris@16
|
478 explicit sg_set( const value_compare &cmp = value_compare()
|
Chris@16
|
479 , const value_traits &v_traits = value_traits())
|
Chris@16
|
480 : Base(cmp, v_traits)
|
Chris@16
|
481 {}
|
Chris@16
|
482
|
Chris@16
|
483 template<class Iterator>
|
Chris@16
|
484 sg_set( Iterator b, Iterator e
|
Chris@16
|
485 , const value_compare &cmp = value_compare()
|
Chris@16
|
486 , const value_traits &v_traits = value_traits())
|
Chris@16
|
487 : Base(b, e, cmp, v_traits)
|
Chris@16
|
488 {}
|
Chris@16
|
489
|
Chris@16
|
490 sg_set(BOOST_RV_REF(sg_set) x)
|
Chris@101
|
491 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
492 {}
|
Chris@16
|
493
|
Chris@16
|
494 sg_set& operator=(BOOST_RV_REF(sg_set) x)
|
Chris@101
|
495 { return static_cast<sg_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
496
|
Chris@16
|
497 static sg_set &container_from_end_iterator(iterator end_iterator)
|
Chris@16
|
498 { return static_cast<sg_set &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
499
|
Chris@16
|
500 static const sg_set &container_from_end_iterator(const_iterator end_iterator)
|
Chris@16
|
501 { return static_cast<const sg_set &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
502
|
Chris@16
|
503 static sg_set &container_from_iterator(iterator it)
|
Chris@16
|
504 { return static_cast<sg_set &>(Base::container_from_iterator(it)); }
|
Chris@16
|
505
|
Chris@16
|
506 static const sg_set &container_from_iterator(const_iterator it)
|
Chris@16
|
507 { return static_cast<const sg_set &>(Base::container_from_iterator(it)); }
|
Chris@16
|
508 };
|
Chris@16
|
509
|
Chris@16
|
510 #endif
|
Chris@16
|
511
|
Chris@16
|
512 //! The class template sg_multiset is an intrusive container, that mimics most of
|
Chris@16
|
513 //! the interface of std::sg_multiset as described in the C++ standard.
|
Chris@16
|
514 //!
|
Chris@16
|
515 //! The template parameter \c T is the type to be managed by the container.
|
Chris@16
|
516 //! The user can specify additional options and if no options are provided
|
Chris@16
|
517 //! default options are used.
|
Chris@16
|
518 //!
|
Chris@16
|
519 //! The container supports the following options:
|
Chris@16
|
520 //! \c base_hook<>/member_hook<>/value_traits<>,
|
Chris@16
|
521 //! \c floating_point<>, \c size_type<> and
|
Chris@16
|
522 //! \c compare<>.
|
Chris@16
|
523 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
524 template<class T, class ...Options>
|
Chris@16
|
525 #else
|
Chris@101
|
526 template<class ValueTraits, class Compare, class SizeType, bool FloatingPoint, typename HeaderHolder>
|
Chris@16
|
527 #endif
|
Chris@16
|
528 class sg_multiset_impl
|
Chris@16
|
529 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@101
|
530 : public sgtree_impl<ValueTraits, Compare, SizeType, FloatingPoint, HeaderHolder>
|
Chris@16
|
531 #endif
|
Chris@16
|
532 {
|
Chris@16
|
533 /// @cond
|
Chris@101
|
534 typedef sgtree_impl<ValueTraits, Compare, SizeType, FloatingPoint, HeaderHolder> tree_type;
|
Chris@16
|
535
|
Chris@16
|
536 BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_multiset_impl)
|
Chris@16
|
537 typedef tree_type implementation_defined;
|
Chris@16
|
538 /// @endcond
|
Chris@16
|
539
|
Chris@16
|
540 public:
|
Chris@16
|
541 typedef typename implementation_defined::value_type value_type;
|
Chris@16
|
542 typedef typename implementation_defined::value_traits value_traits;
|
Chris@16
|
543 typedef typename implementation_defined::pointer pointer;
|
Chris@16
|
544 typedef typename implementation_defined::const_pointer const_pointer;
|
Chris@16
|
545 typedef typename implementation_defined::reference reference;
|
Chris@16
|
546 typedef typename implementation_defined::const_reference const_reference;
|
Chris@16
|
547 typedef typename implementation_defined::difference_type difference_type;
|
Chris@16
|
548 typedef typename implementation_defined::size_type size_type;
|
Chris@16
|
549 typedef typename implementation_defined::value_compare value_compare;
|
Chris@16
|
550 typedef typename implementation_defined::key_compare key_compare;
|
Chris@16
|
551 typedef typename implementation_defined::iterator iterator;
|
Chris@16
|
552 typedef typename implementation_defined::const_iterator const_iterator;
|
Chris@16
|
553 typedef typename implementation_defined::reverse_iterator reverse_iterator;
|
Chris@16
|
554 typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
|
Chris@16
|
555 typedef typename implementation_defined::insert_commit_data insert_commit_data;
|
Chris@16
|
556 typedef typename implementation_defined::node_traits node_traits;
|
Chris@16
|
557 typedef typename implementation_defined::node node;
|
Chris@16
|
558 typedef typename implementation_defined::node_ptr node_ptr;
|
Chris@16
|
559 typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
Chris@16
|
560 typedef typename implementation_defined::node_algorithms node_algorithms;
|
Chris@16
|
561
|
Chris@16
|
562 static const bool constant_time_size = tree_type::constant_time_size;
|
Chris@16
|
563
|
Chris@16
|
564 public:
|
Chris@16
|
565 //! @copydoc ::boost::intrusive::sgtree::sgtree(const value_compare &,const value_traits &)
|
Chris@16
|
566 explicit sg_multiset_impl( const value_compare &cmp = value_compare()
|
Chris@16
|
567 , const value_traits &v_traits = value_traits())
|
Chris@16
|
568 : tree_type(cmp, v_traits)
|
Chris@16
|
569 {}
|
Chris@16
|
570
|
Chris@16
|
571 //! @copydoc ::boost::intrusive::sgtree::sgtree(bool,Iterator,Iterator,const value_compare &,const value_traits &)
|
Chris@16
|
572 template<class Iterator>
|
Chris@16
|
573 sg_multiset_impl( Iterator b, Iterator e
|
Chris@16
|
574 , const value_compare &cmp = value_compare()
|
Chris@16
|
575 , const value_traits &v_traits = value_traits())
|
Chris@16
|
576 : tree_type(false, b, e, cmp, v_traits)
|
Chris@16
|
577 {}
|
Chris@16
|
578
|
Chris@16
|
579 //! @copydoc ::boost::intrusive::sgtree::sgtree(sgtree &&)
|
Chris@16
|
580 sg_multiset_impl(BOOST_RV_REF(sg_multiset_impl) x)
|
Chris@101
|
581 : tree_type(BOOST_MOVE_BASE(tree_type, x))
|
Chris@16
|
582 {}
|
Chris@16
|
583
|
Chris@16
|
584 //! @copydoc ::boost::intrusive::sgtree::operator=(sgtree &&)
|
Chris@16
|
585 sg_multiset_impl& operator=(BOOST_RV_REF(sg_multiset_impl) x)
|
Chris@101
|
586 { return static_cast<sg_multiset_impl&>(tree_type::operator=(BOOST_MOVE_BASE(tree_type, x))); }
|
Chris@16
|
587
|
Chris@16
|
588 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
589 //! @copydoc ::boost::intrusive::sgtree::~sgtree()
|
Chris@16
|
590 ~sg_multiset_impl();
|
Chris@16
|
591
|
Chris@16
|
592 //! @copydoc ::boost::intrusive::sgtree::begin()
|
Chris@16
|
593 iterator begin();
|
Chris@16
|
594
|
Chris@16
|
595 //! @copydoc ::boost::intrusive::sgtree::begin()const
|
Chris@16
|
596 const_iterator begin() const;
|
Chris@16
|
597
|
Chris@16
|
598 //! @copydoc ::boost::intrusive::sgtree::cbegin()const
|
Chris@16
|
599 const_iterator cbegin() const;
|
Chris@16
|
600
|
Chris@16
|
601 //! @copydoc ::boost::intrusive::sgtree::end()
|
Chris@16
|
602 iterator end();
|
Chris@16
|
603
|
Chris@16
|
604 //! @copydoc ::boost::intrusive::sgtree::end()const
|
Chris@16
|
605 const_iterator end() const;
|
Chris@16
|
606
|
Chris@16
|
607 //! @copydoc ::boost::intrusive::sgtree::cend()const
|
Chris@16
|
608 const_iterator cend() const;
|
Chris@16
|
609
|
Chris@16
|
610 //! @copydoc ::boost::intrusive::sgtree::rbegin()
|
Chris@16
|
611 reverse_iterator rbegin();
|
Chris@16
|
612
|
Chris@16
|
613 //! @copydoc ::boost::intrusive::sgtree::rbegin()const
|
Chris@16
|
614 const_reverse_iterator rbegin() const;
|
Chris@16
|
615
|
Chris@16
|
616 //! @copydoc ::boost::intrusive::sgtree::crbegin()const
|
Chris@16
|
617 const_reverse_iterator crbegin() const;
|
Chris@16
|
618
|
Chris@16
|
619 //! @copydoc ::boost::intrusive::sgtree::rend()
|
Chris@16
|
620 reverse_iterator rend();
|
Chris@16
|
621
|
Chris@16
|
622 //! @copydoc ::boost::intrusive::sgtree::rend()const
|
Chris@16
|
623 const_reverse_iterator rend() const;
|
Chris@16
|
624
|
Chris@16
|
625 //! @copydoc ::boost::intrusive::sgtree::crend()const
|
Chris@16
|
626 const_reverse_iterator crend() const;
|
Chris@16
|
627
|
Chris@16
|
628 //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(iterator)
|
Chris@16
|
629 static sg_multiset_impl &container_from_end_iterator(iterator end_iterator);
|
Chris@16
|
630
|
Chris@16
|
631 //! @copydoc ::boost::intrusive::sgtree::container_from_end_iterator(const_iterator)
|
Chris@16
|
632 static const sg_multiset_impl &container_from_end_iterator(const_iterator end_iterator);
|
Chris@16
|
633
|
Chris@16
|
634 //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(iterator)
|
Chris@16
|
635 static sg_multiset_impl &container_from_iterator(iterator it);
|
Chris@16
|
636
|
Chris@16
|
637 //! @copydoc ::boost::intrusive::sgtree::container_from_iterator(const_iterator)
|
Chris@16
|
638 static const sg_multiset_impl &container_from_iterator(const_iterator it);
|
Chris@16
|
639
|
Chris@16
|
640 //! @copydoc ::boost::intrusive::sgtree::key_comp()const
|
Chris@16
|
641 key_compare key_comp() const;
|
Chris@16
|
642
|
Chris@16
|
643 //! @copydoc ::boost::intrusive::sgtree::value_comp()const
|
Chris@16
|
644 value_compare value_comp() const;
|
Chris@16
|
645
|
Chris@16
|
646 //! @copydoc ::boost::intrusive::sgtree::empty()const
|
Chris@16
|
647 bool empty() const;
|
Chris@16
|
648
|
Chris@16
|
649 //! @copydoc ::boost::intrusive::sgtree::size()const
|
Chris@16
|
650 size_type size() const;
|
Chris@16
|
651
|
Chris@16
|
652 //! @copydoc ::boost::intrusive::sgtree::swap
|
Chris@16
|
653 void swap(sg_multiset_impl& other);
|
Chris@16
|
654
|
Chris@16
|
655 //! @copydoc ::boost::intrusive::sgtree::clone_from
|
Chris@16
|
656 template <class Cloner, class Disposer>
|
Chris@16
|
657 void clone_from(const sg_multiset_impl &src, Cloner cloner, Disposer disposer);
|
Chris@16
|
658
|
Chris@16
|
659 #endif //#ifdef BOOST_iNTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
660
|
Chris@16
|
661 //! @copydoc ::boost::intrusive::sgtree::insert_equal(reference)
|
Chris@16
|
662 iterator insert(reference value)
|
Chris@16
|
663 { return tree_type::insert_equal(value); }
|
Chris@16
|
664
|
Chris@16
|
665 //! @copydoc ::boost::intrusive::sgtree::insert_equal(const_iterator,reference)
|
Chris@16
|
666 iterator insert(const_iterator hint, reference value)
|
Chris@16
|
667 { return tree_type::insert_equal(hint, value); }
|
Chris@16
|
668
|
Chris@16
|
669 //! @copydoc ::boost::intrusive::sgtree::insert_equal(Iterator,Iterator)
|
Chris@16
|
670 template<class Iterator>
|
Chris@16
|
671 void insert(Iterator b, Iterator e)
|
Chris@16
|
672 { tree_type::insert_equal(b, e); }
|
Chris@16
|
673
|
Chris@16
|
674 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
675 //! @copydoc ::boost::intrusive::sgtree::insert_before
|
Chris@16
|
676 iterator insert_before(const_iterator pos, reference value);
|
Chris@16
|
677
|
Chris@16
|
678 //! @copydoc ::boost::intrusive::sgtree::push_back
|
Chris@16
|
679 void push_back(reference value);
|
Chris@16
|
680
|
Chris@16
|
681 //! @copydoc ::boost::intrusive::sgtree::push_front
|
Chris@16
|
682 void push_front(reference value);
|
Chris@16
|
683
|
Chris@16
|
684 //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator)
|
Chris@16
|
685 iterator erase(const_iterator i);
|
Chris@16
|
686
|
Chris@16
|
687 //! @copydoc ::boost::intrusive::sgtree::erase(const_iterator,const_iterator)
|
Chris@16
|
688 iterator erase(const_iterator b, const_iterator e);
|
Chris@16
|
689
|
Chris@16
|
690 //! @copydoc ::boost::intrusive::sgtree::erase(const_reference)
|
Chris@16
|
691 size_type erase(const_reference value);
|
Chris@16
|
692
|
Chris@16
|
693 //! @copydoc ::boost::intrusive::sgtree::erase(const KeyType&,KeyValueCompare)
|
Chris@16
|
694 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
695 size_type erase(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
696
|
Chris@16
|
697 //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,Disposer)
|
Chris@16
|
698 template<class Disposer>
|
Chris@16
|
699 iterator erase_and_dispose(const_iterator i, Disposer disposer);
|
Chris@16
|
700
|
Chris@16
|
701 //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_iterator,const_iterator,Disposer)
|
Chris@16
|
702 template<class Disposer>
|
Chris@16
|
703 iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer);
|
Chris@16
|
704
|
Chris@16
|
705 //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const_reference, Disposer)
|
Chris@16
|
706 template<class Disposer>
|
Chris@16
|
707 size_type erase_and_dispose(const_reference value, Disposer disposer);
|
Chris@16
|
708
|
Chris@16
|
709 //! @copydoc ::boost::intrusive::sgtree::erase_and_dispose(const KeyType&,KeyValueCompare,Disposer)
|
Chris@16
|
710 template<class KeyType, class KeyValueCompare, class Disposer>
|
Chris@16
|
711 size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer);
|
Chris@16
|
712
|
Chris@16
|
713 //! @copydoc ::boost::intrusive::sgtree::clear
|
Chris@16
|
714 void clear();
|
Chris@16
|
715
|
Chris@16
|
716 //! @copydoc ::boost::intrusive::sgtree::clear_and_dispose
|
Chris@16
|
717 template<class Disposer>
|
Chris@16
|
718 void clear_and_dispose(Disposer disposer);
|
Chris@16
|
719
|
Chris@16
|
720 //! @copydoc ::boost::intrusive::sgtree::count(const_reference)const
|
Chris@16
|
721 size_type count(const_reference value) const;
|
Chris@16
|
722
|
Chris@16
|
723 //! @copydoc ::boost::intrusive::sgtree::count(const KeyType&,KeyValueCompare)const
|
Chris@16
|
724 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
725 size_type count(const KeyType& key, KeyValueCompare comp) const;
|
Chris@101
|
726
|
Chris@16
|
727 //! @copydoc ::boost::intrusive::sgtree::lower_bound(const_reference)
|
Chris@16
|
728 iterator lower_bound(const_reference value);
|
Chris@101
|
729
|
Chris@16
|
730 //! @copydoc ::boost::intrusive::sgtree::lower_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
731 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
732 iterator lower_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
733
|
Chris@16
|
734 //! @copydoc ::boost::intrusive::sgtree::lower_bound(const_reference)const
|
Chris@16
|
735 const_iterator lower_bound(const_reference value) const;
|
Chris@16
|
736
|
Chris@16
|
737 //! @copydoc ::boost::intrusive::sgtree::lower_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
738 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
739 const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
740
|
Chris@16
|
741 //! @copydoc ::boost::intrusive::sgtree::upper_bound(const_reference)
|
Chris@16
|
742 iterator upper_bound(const_reference value);
|
Chris@16
|
743
|
Chris@16
|
744 //! @copydoc ::boost::intrusive::sgtree::upper_bound(const KeyType&,KeyValueCompare)
|
Chris@16
|
745 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
746 iterator upper_bound(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
747
|
Chris@16
|
748 //! @copydoc ::boost::intrusive::sgtree::upper_bound(const_reference)const
|
Chris@16
|
749 const_iterator upper_bound(const_reference value) const;
|
Chris@16
|
750
|
Chris@16
|
751 //! @copydoc ::boost::intrusive::sgtree::upper_bound(const KeyType&,KeyValueCompare)const
|
Chris@16
|
752 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
753 const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
754
|
Chris@16
|
755 //! @copydoc ::boost::intrusive::sgtree::find(const_reference)
|
Chris@16
|
756 iterator find(const_reference value);
|
Chris@16
|
757
|
Chris@16
|
758 //! @copydoc ::boost::intrusive::sgtree::find(const KeyType&,KeyValueCompare)
|
Chris@16
|
759 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
760 iterator find(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
761
|
Chris@16
|
762 //! @copydoc ::boost::intrusive::sgtree::find(const_reference)const
|
Chris@16
|
763 const_iterator find(const_reference value) const;
|
Chris@16
|
764
|
Chris@16
|
765 //! @copydoc ::boost::intrusive::sgtree::find(const KeyType&,KeyValueCompare)const
|
Chris@16
|
766 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
767 const_iterator find(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
768
|
Chris@16
|
769 //! @copydoc ::boost::intrusive::sgtree::equal_range(const_reference)
|
Chris@16
|
770 std::pair<iterator,iterator> equal_range(const_reference value);
|
Chris@16
|
771
|
Chris@16
|
772 //! @copydoc ::boost::intrusive::sgtree::equal_range(const KeyType&,KeyValueCompare)
|
Chris@16
|
773 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
774 std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp);
|
Chris@16
|
775
|
Chris@16
|
776 //! @copydoc ::boost::intrusive::sgtree::equal_range(const_reference)const
|
Chris@16
|
777 std::pair<const_iterator, const_iterator>
|
Chris@16
|
778 equal_range(const_reference value) const;
|
Chris@16
|
779
|
Chris@16
|
780 //! @copydoc ::boost::intrusive::sgtree::equal_range(const KeyType&,KeyValueCompare)const
|
Chris@16
|
781 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
782 std::pair<const_iterator, const_iterator>
|
Chris@16
|
783 equal_range(const KeyType& key, KeyValueCompare comp) const;
|
Chris@16
|
784
|
Chris@16
|
785 //! @copydoc ::boost::intrusive::sgtree::bounded_range(const_reference,const_reference,bool,bool)
|
Chris@16
|
786 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
787 (const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed);
|
Chris@16
|
788
|
Chris@16
|
789 //! @copydoc ::boost::intrusive::sgtree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)
|
Chris@16
|
790 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
791 std::pair<iterator,iterator> bounded_range
|
Chris@16
|
792 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed);
|
Chris@16
|
793
|
Chris@16
|
794 //! @copydoc ::boost::intrusive::sgtree::bounded_range(const_reference,const_reference,bool,bool)const
|
Chris@16
|
795 std::pair<const_iterator, const_iterator>
|
Chris@16
|
796 bounded_range(const_reference lower_value, const_reference upper_value, bool left_closed, bool right_closed) const;
|
Chris@16
|
797
|
Chris@16
|
798 //! @copydoc ::boost::intrusive::sgtree::bounded_range(const KeyType&,const KeyType&,KeyValueCompare,bool,bool)const
|
Chris@16
|
799 template<class KeyType, class KeyValueCompare>
|
Chris@16
|
800 std::pair<const_iterator, const_iterator> bounded_range
|
Chris@16
|
801 (const KeyType& lower_key, const KeyType& upper_key, KeyValueCompare comp, bool left_closed, bool right_closed) const;
|
Chris@16
|
802
|
Chris@16
|
803 //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(reference)
|
Chris@16
|
804 static iterator s_iterator_to(reference value);
|
Chris@16
|
805
|
Chris@16
|
806 //! @copydoc ::boost::intrusive::sgtree::s_iterator_to(const_reference)
|
Chris@16
|
807 static const_iterator s_iterator_to(const_reference value);
|
Chris@16
|
808
|
Chris@16
|
809 //! @copydoc ::boost::intrusive::sgtree::iterator_to(reference)
|
Chris@16
|
810 iterator iterator_to(reference value);
|
Chris@16
|
811
|
Chris@16
|
812 //! @copydoc ::boost::intrusive::sgtree::iterator_to(const_reference)const
|
Chris@16
|
813 const_iterator iterator_to(const_reference value) const;
|
Chris@16
|
814
|
Chris@16
|
815 //! @copydoc ::boost::intrusive::sgtree::init_node(reference)
|
Chris@16
|
816 static void init_node(reference value);
|
Chris@16
|
817
|
Chris@16
|
818 //! @copydoc ::boost::intrusive::sgtree::unlink_leftmost_without_rebalance
|
Chris@16
|
819 pointer unlink_leftmost_without_rebalance();
|
Chris@16
|
820
|
Chris@16
|
821 //! @copydoc ::boost::intrusive::sgtree::replace_node
|
Chris@16
|
822 void replace_node(iterator replace_this, reference with_this);
|
Chris@16
|
823
|
Chris@16
|
824 //! @copydoc ::boost::intrusive::sgtree::remove_node
|
Chris@16
|
825 void remove_node(reference value);
|
Chris@16
|
826
|
Chris@16
|
827 //! @copydoc ::boost::intrusive::sgtree::rebalance
|
Chris@16
|
828 void rebalance();
|
Chris@16
|
829
|
Chris@16
|
830 //! @copydoc ::boost::intrusive::sgtree::rebalance_subtree
|
Chris@16
|
831 iterator rebalance_subtree(iterator root);
|
Chris@16
|
832
|
Chris@16
|
833 //! @copydoc ::boost::intrusive::sgtree::balance_factor()
|
Chris@16
|
834 float balance_factor() const;
|
Chris@16
|
835
|
Chris@16
|
836 //! @copydoc ::boost::intrusive::sgtree::balance_factor(float)
|
Chris@16
|
837 void balance_factor(float new_alpha);
|
Chris@16
|
838
|
Chris@16
|
839 #endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
840 };
|
Chris@16
|
841
|
Chris@16
|
842 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
843
|
Chris@16
|
844 template<class T, class ...Options>
|
Chris@16
|
845 bool operator!= (const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y);
|
Chris@16
|
846
|
Chris@16
|
847 template<class T, class ...Options>
|
Chris@16
|
848 bool operator>(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y);
|
Chris@16
|
849
|
Chris@16
|
850 template<class T, class ...Options>
|
Chris@16
|
851 bool operator<=(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y);
|
Chris@16
|
852
|
Chris@16
|
853 template<class T, class ...Options>
|
Chris@16
|
854 bool operator>=(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y);
|
Chris@16
|
855
|
Chris@16
|
856 template<class T, class ...Options>
|
Chris@16
|
857 void swap(sg_multiset_impl<T, Options...> &x, sg_multiset_impl<T, Options...> &y);
|
Chris@16
|
858
|
Chris@16
|
859 #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
Chris@16
|
860
|
Chris@16
|
861 //! Helper metafunction to define a \c sg_multiset that yields to the same type when the
|
Chris@16
|
862 //! same options (either explicitly or implicitly) are used.
|
Chris@16
|
863 #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@16
|
864 template<class T, class ...Options>
|
Chris@16
|
865 #else
|
Chris@16
|
866 template<class T, class O1 = void, class O2 = void
|
Chris@101
|
867 , class O3 = void, class O4 = void
|
Chris@101
|
868 , class O5 = void>
|
Chris@16
|
869 #endif
|
Chris@16
|
870 struct make_sg_multiset
|
Chris@16
|
871 {
|
Chris@16
|
872 /// @cond
|
Chris@16
|
873 typedef typename pack_options
|
Chris@16
|
874 < sgtree_defaults,
|
Chris@16
|
875 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
876 O1, O2, O3, O4, O5
|
Chris@16
|
877 #else
|
Chris@16
|
878 Options...
|
Chris@16
|
879 #endif
|
Chris@16
|
880 >::type packed_options;
|
Chris@16
|
881
|
Chris@16
|
882 typedef typename detail::get_value_traits
|
Chris@16
|
883 <T, typename packed_options::proto_value_traits>::type value_traits;
|
Chris@16
|
884
|
Chris@16
|
885 typedef sg_multiset_impl
|
Chris@16
|
886 < value_traits
|
Chris@16
|
887 , typename packed_options::compare
|
Chris@16
|
888 , typename packed_options::size_type
|
Chris@16
|
889 , packed_options::floating_point
|
Chris@101
|
890 , typename packed_options::header_holder_type
|
Chris@16
|
891 > implementation_defined;
|
Chris@16
|
892 /// @endcond
|
Chris@16
|
893 typedef implementation_defined type;
|
Chris@16
|
894 };
|
Chris@16
|
895
|
Chris@16
|
896 #ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
Chris@16
|
897
|
Chris@16
|
898 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
899 template<class T, class O1, class O2, class O3, class O4, class O5>
|
Chris@16
|
900 #else
|
Chris@16
|
901 template<class T, class ...Options>
|
Chris@16
|
902 #endif
|
Chris@16
|
903 class sg_multiset
|
Chris@16
|
904 : public make_sg_multiset<T,
|
Chris@16
|
905 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
906 O1, O2, O3, O4, O5
|
Chris@16
|
907 #else
|
Chris@16
|
908 Options...
|
Chris@16
|
909 #endif
|
Chris@16
|
910 >::type
|
Chris@16
|
911 {
|
Chris@16
|
912 typedef typename make_sg_multiset<T,
|
Chris@16
|
913 #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
Chris@101
|
914 O1, O2, O3, O4, O5
|
Chris@16
|
915 #else
|
Chris@16
|
916 Options...
|
Chris@16
|
917 #endif
|
Chris@16
|
918 >::type Base;
|
Chris@16
|
919
|
Chris@16
|
920 BOOST_MOVABLE_BUT_NOT_COPYABLE(sg_multiset)
|
Chris@16
|
921
|
Chris@16
|
922 public:
|
Chris@16
|
923 typedef typename Base::value_compare value_compare;
|
Chris@16
|
924 typedef typename Base::value_traits value_traits;
|
Chris@16
|
925 typedef typename Base::iterator iterator;
|
Chris@16
|
926 typedef typename Base::const_iterator const_iterator;
|
Chris@16
|
927
|
Chris@16
|
928 //Assert if passed value traits are compatible with the type
|
Chris@16
|
929 BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
Chris@16
|
930
|
Chris@16
|
931 sg_multiset( const value_compare &cmp = value_compare()
|
Chris@16
|
932 , const value_traits &v_traits = value_traits())
|
Chris@16
|
933 : Base(cmp, v_traits)
|
Chris@16
|
934 {}
|
Chris@16
|
935
|
Chris@16
|
936 template<class Iterator>
|
Chris@16
|
937 sg_multiset( Iterator b, Iterator e
|
Chris@16
|
938 , const value_compare &cmp = value_compare()
|
Chris@16
|
939 , const value_traits &v_traits = value_traits())
|
Chris@16
|
940 : Base(b, e, cmp, v_traits)
|
Chris@16
|
941 {}
|
Chris@16
|
942
|
Chris@16
|
943 sg_multiset(BOOST_RV_REF(sg_multiset) x)
|
Chris@101
|
944 : Base(BOOST_MOVE_BASE(Base, x))
|
Chris@16
|
945 {}
|
Chris@16
|
946
|
Chris@16
|
947 sg_multiset& operator=(BOOST_RV_REF(sg_multiset) x)
|
Chris@101
|
948 { return static_cast<sg_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
Chris@16
|
949
|
Chris@16
|
950 static sg_multiset &container_from_end_iterator(iterator end_iterator)
|
Chris@16
|
951 { return static_cast<sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
952
|
Chris@16
|
953 static const sg_multiset &container_from_end_iterator(const_iterator end_iterator)
|
Chris@16
|
954 { return static_cast<const sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
Chris@16
|
955
|
Chris@16
|
956 static sg_multiset &container_from_iterator(iterator it)
|
Chris@16
|
957 { return static_cast<sg_multiset &>(Base::container_from_iterator(it)); }
|
Chris@16
|
958
|
Chris@16
|
959 static const sg_multiset &container_from_iterator(const_iterator it)
|
Chris@16
|
960 { return static_cast<const sg_multiset &>(Base::container_from_iterator(it)); }
|
Chris@16
|
961 };
|
Chris@16
|
962
|
Chris@16
|
963 #endif
|
Chris@16
|
964
|
Chris@16
|
965 } //namespace intrusive
|
Chris@16
|
966 } //namespace boost
|
Chris@16
|
967
|
Chris@16
|
968 #include <boost/intrusive/detail/config_end.hpp>
|
Chris@16
|
969
|
Chris@16
|
970 #endif //BOOST_INTRUSIVE_SG_SET_HPP
|