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