comparison DEPENDENCIES/generic/include/boost/lockfree/queue.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
10 10
11 #ifndef BOOST_LOCKFREE_FIFO_HPP_INCLUDED 11 #ifndef BOOST_LOCKFREE_FIFO_HPP_INCLUDED
12 #define BOOST_LOCKFREE_FIFO_HPP_INCLUDED 12 #define BOOST_LOCKFREE_FIFO_HPP_INCLUDED
13 13
14 #include <boost/assert.hpp> 14 #include <boost/assert.hpp>
15 #ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
16 #include <boost/noncopyable.hpp>
17 #endif
18 #include <boost/static_assert.hpp> 15 #include <boost/static_assert.hpp>
19 #include <boost/type_traits/has_trivial_assign.hpp> 16 #include <boost/type_traits/has_trivial_assign.hpp>
20 #include <boost/type_traits/has_trivial_destructor.hpp> 17 #include <boost/type_traits/has_trivial_destructor.hpp>
21 18
22 #include <boost/lockfree/detail/atomic.hpp> 19 #include <boost/lockfree/detail/atomic.hpp>
23 #include <boost/lockfree/detail/copy_payload.hpp> 20 #include <boost/lockfree/detail/copy_payload.hpp>
24 #include <boost/lockfree/detail/freelist.hpp> 21 #include <boost/lockfree/detail/freelist.hpp>
25 #include <boost/lockfree/detail/parameter.hpp> 22 #include <boost/lockfree/detail/parameter.hpp>
26 #include <boost/lockfree/detail/tagged_ptr.hpp> 23 #include <boost/lockfree/detail/tagged_ptr.hpp>
24
25 #ifdef BOOST_HAS_PRAGMA_ONCE
26 #pragma once
27 #endif
28
27 29
28 #if defined(_MSC_VER) 30 #if defined(_MSC_VER)
29 #pragma warning(push) 31 #pragma warning(push)
30 #pragma warning(disable: 4324) // structure was padded due to __declspec(align()) 32 #pragma warning(disable: 4324) // structure was padded due to __declspec(align())
31 #endif 33 #endif
74 class A2 = boost::parameter::void_> 76 class A2 = boost::parameter::void_>
75 #else 77 #else
76 template <typename T, ...Options> 78 template <typename T, ...Options>
77 #endif 79 #endif
78 class queue 80 class queue
79 #ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS
80 : boost::noncopyable
81 #endif
82 { 81 {
83 private: 82 private:
84 #ifndef BOOST_DOXYGEN_INVOKED 83 #ifndef BOOST_DOXYGEN_INVOKED
85 84
86 #ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR 85 #ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
143 typedef std::size_t size_type; 142 typedef std::size_t size_type;
144 }; 143 };
145 144
146 #endif 145 #endif
147 146
148 #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS 147 BOOST_DELETED_FUNCTION(queue(queue const&))
149 queue(queue const &) = delete; 148 BOOST_DELETED_FUNCTION(queue& operator= (queue const&))
150 queue(queue &&) = delete;
151 const queue& operator=( const queue& ) = delete;
152 #endif
153 149
154 public: 150 public:
155 typedef T value_type; 151 typedef T value_type;
156 typedef typename implementation_defined::allocator allocator; 152 typedef typename implementation_defined::allocator allocator;
157 typedef typename implementation_defined::size_type size_type; 153 typedef typename implementation_defined::size_type size_type;
251 * 247 *
252 * \return true, if the queue is empty, false otherwise 248 * \return true, if the queue is empty, false otherwise
253 * \note The result is only accurate, if no other thread modifies the queue. Therefore it is rarely practical to use this 249 * \note The result is only accurate, if no other thread modifies the queue. Therefore it is rarely practical to use this
254 * value in program logic. 250 * value in program logic.
255 * */ 251 * */
256 bool empty(void) 252 bool empty(void) const
257 { 253 {
258 return pool.get_handle(head_.load()) == pool.get_handle(tail_.load()); 254 return pool.get_handle(head_.load()) == pool.get_handle(tail_.load());
259 } 255 }
260 256
261 /** Pushes object t to the queue. 257 /** Pushes object t to the queue.