Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:17

0001 // boost lockfree
0002 //
0003 // Copyright (C) 2011 Tim Blechmann
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_LOCKFREE_POLICIES_HPP_INCLUDED
0010 #define BOOST_LOCKFREE_POLICIES_HPP_INCLUDED
0011 
0012 #include <boost/parameter/template_keyword.hpp>
0013 #include <boost/mpl/bool.hpp>
0014 #include <boost/mpl/size_t.hpp>
0015 
0016 namespace boost {
0017 namespace lockfree {
0018 
0019 #ifndef BOOST_DOXYGEN_INVOKED
0020 namespace tag { struct allocator ; }
0021 namespace tag { struct fixed_sized; }
0022 namespace tag { struct capacity; }
0023 
0024 #endif
0025 
0026 /** Configures a data structure as \b fixed-sized.
0027  *
0028  *  The internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the
0029  *  queue to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack
0030  *  double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom.
0031  *  This implies that a data structure is bounded.
0032  * */
0033 template <bool IsFixedSized>
0034 struct fixed_sized:
0035     boost::parameter::template_keyword<tag::fixed_sized, boost::mpl::bool_<IsFixedSized> >
0036 {};
0037 
0038 /** Sets the \b capacity of a data structure at compile-time.
0039  *
0040  * This implies that a data structure is bounded and fixed-sized.
0041  * */
0042 template <size_t Size>
0043 struct capacity:
0044     boost::parameter::template_keyword<tag::capacity, boost::mpl::size_t<Size> >
0045 {};
0046 
0047 /** Defines the \b allocator type of a data structure.
0048  * */
0049 template <class Alloc>
0050 struct allocator:
0051     boost::parameter::template_keyword<tag::allocator, Alloc>
0052 {};
0053 
0054 }
0055 }
0056 
0057 #endif /* BOOST_LOCKFREE_POLICIES_HPP_INCLUDED */