Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/lockfree/policies.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 // boost lockfree | |
2 // | |
3 // Copyright (C) 2011 Tim Blechmann | |
4 // | |
5 // Distributed under the Boost Software License, Version 1.0. (See | |
6 // accompanying file LICENSE_1_0.txt or copy at | |
7 // http://www.boost.org/LICENSE_1_0.txt) | |
8 | |
9 #ifndef BOOST_LOCKFREE_POLICIES_HPP_INCLUDED | |
10 #define BOOST_LOCKFREE_POLICIES_HPP_INCLUDED | |
11 | |
12 #include <boost/parameter.hpp> | |
13 #include <boost/mpl/bool.hpp> | |
14 #include <boost/mpl/size_t.hpp> | |
15 #include <boost/mpl/void.hpp> | |
16 | |
17 namespace boost { | |
18 namespace lockfree { | |
19 | |
20 #ifndef BOOST_DOXYGEN_INVOKED | |
21 namespace tag { struct allocator ; } | |
22 namespace tag { struct fixed_sized; } | |
23 namespace tag { struct capacity; } | |
24 | |
25 #endif | |
26 | |
27 /** Configures a data structure as \b fixed-sized. | |
28 * | |
29 * The internal nodes are stored inside an array and they are addressed by array indexing. This limits the possible size of the | |
30 * queue to the number of elements that can be addressed by the index type (usually 2**16-2), but on platforms that lack | |
31 * double-width compare-and-exchange instructions, this is the best way to achieve lock-freedom. | |
32 * This implies that a data structure is bounded. | |
33 * */ | |
34 template <bool IsFixedSized> | |
35 struct fixed_sized: | |
36 boost::parameter::template_keyword<tag::fixed_sized, boost::mpl::bool_<IsFixedSized> > | |
37 {}; | |
38 | |
39 /** Sets the \b capacity of a data structure at compile-time. | |
40 * | |
41 * This implies that a data structure is bounded and fixed-sized. | |
42 * */ | |
43 template <size_t Size> | |
44 struct capacity: | |
45 boost::parameter::template_keyword<tag::capacity, boost::mpl::size_t<Size> > | |
46 {}; | |
47 | |
48 /** Defines the \b allocator type of a data structure. | |
49 * */ | |
50 template <class Alloc> | |
51 struct allocator: | |
52 boost::parameter::template_keyword<tag::allocator, Alloc> | |
53 {}; | |
54 | |
55 } | |
56 } | |
57 | |
58 #endif /* BOOST_LOCKFREE_POLICIES_HPP_INCLUDED */ | |
59 |