Chris@16: // boost lockfree Chris@16: // Chris@16: // Copyright (C) 2011 Tim Blechmann Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_LOCKFREE_POLICIES_HPP_INCLUDED Chris@16: #define BOOST_LOCKFREE_POLICIES_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace lockfree { Chris@16: Chris@16: #ifndef BOOST_DOXYGEN_INVOKED Chris@16: namespace tag { struct allocator ; } Chris@16: namespace tag { struct fixed_sized; } Chris@16: namespace tag { struct capacity; } Chris@16: Chris@16: #endif Chris@16: Chris@16: /** Configures a data structure as \b fixed-sized. Chris@16: * Chris@16: * The internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the Chris@16: * queue to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack Chris@16: * double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom. Chris@16: * This implies that a data structure is bounded. Chris@16: * */ Chris@16: template Chris@16: struct fixed_sized: Chris@16: boost::parameter::template_keyword > Chris@16: {}; Chris@16: Chris@16: /** Sets the \b capacity of a data structure at compile-time. Chris@16: * Chris@16: * This implies that a data structure is bounded and fixed-sized. Chris@16: * */ Chris@16: template Chris@16: struct capacity: Chris@16: boost::parameter::template_keyword > Chris@16: {}; Chris@16: Chris@16: /** Defines the \b allocator type of a data structure. Chris@16: * */ Chris@16: template Chris@16: struct allocator: Chris@16: boost::parameter::template_keyword Chris@16: {}; Chris@16: Chris@16: } Chris@16: } Chris@16: Chris@16: #endif /* BOOST_LOCKFREE_POLICIES_HPP_INCLUDED */ Chris@16: