]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // Copyright Oliver Kowalke 2013. | |
3 | // Distributed under the Boost Software License, Version 1.0. | |
4 | // (See accompanying file LICENSE_1_0.txt or copy at | |
5 | // http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | #ifndef BOOST_FIBERS_TYPE_H | |
8 | #define BOOST_FIBERS_TYPE_H | |
9 | ||
10 | #include <atomic> | |
11 | #include <chrono> | |
12 | #include <exception> | |
13 | #include <functional> | |
14 | #include <map> | |
15 | #include <memory> | |
16 | #include <type_traits> | |
17 | ||
18 | #include <boost/assert.hpp> | |
19 | #include <boost/config.hpp> | |
20 | #include <boost/context/detail/apply.hpp> | |
21 | #include <boost/context/execution_context.hpp> | |
22 | #include <boost/context/stack_context.hpp> | |
23 | #include <boost/intrusive/list.hpp> | |
24 | #include <boost/intrusive/parent_from_member.hpp> | |
25 | #include <boost/intrusive_ptr.hpp> | |
26 | #include <boost/intrusive/set.hpp> | |
27 | ||
28 | #include <boost/fiber/detail/config.hpp> | |
29 | #include <boost/fiber/detail/data.hpp> | |
30 | #include <boost/fiber/detail/decay_copy.hpp> | |
31 | #include <boost/fiber/detail/fss.hpp> | |
32 | #include <boost/fiber/detail/spinlock.hpp> | |
33 | #include <boost/fiber/detail/wrap.hpp> | |
34 | #include <boost/fiber/exceptions.hpp> | |
35 | #include <boost/fiber/fixedsize_stack.hpp> | |
36 | #include <boost/fiber/properties.hpp> | |
37 | #include <boost/fiber/segmented_stack.hpp> | |
38 | ||
39 | #ifdef BOOST_HAS_ABI_HEADERS | |
40 | # include BOOST_ABI_PREFIX | |
41 | #endif | |
42 | ||
43 | namespace boost { | |
44 | namespace fibers { | |
45 | ||
46 | enum class type { | |
47 | none = 0, | |
48 | main_context = 1 << 1, | |
49 | dispatcher_context = 1 << 2, | |
50 | worker_context = 1 << 3, | |
51 | pinned_context = main_context | dispatcher_context | |
52 | }; | |
53 | ||
54 | inline | |
55 | constexpr type | |
56 | operator&( type l, type r) { | |
57 | return static_cast< type >( | |
58 | static_cast< unsigned int >( l) & static_cast< unsigned int >( r) ); | |
59 | } | |
60 | ||
61 | inline | |
62 | constexpr type | |
63 | operator|( type l, type r) { | |
64 | return static_cast< type >( | |
65 | static_cast< unsigned int >( l) | static_cast< unsigned int >( r) ); | |
66 | } | |
67 | ||
68 | inline | |
69 | constexpr type | |
70 | operator^( type l, type r) { | |
71 | return static_cast< type >( | |
72 | static_cast< unsigned int >( l) ^ static_cast< unsigned int >( r) ); | |
73 | } | |
74 | ||
75 | inline | |
76 | constexpr type | |
77 | operator~( type l) { | |
78 | return static_cast< type >( ~static_cast< unsigned int >( l) ); | |
79 | } | |
80 | ||
81 | inline | |
82 | type & | |
83 | operator&=( type & l, type r) { | |
84 | l = l & r; | |
85 | return l; | |
86 | } | |
87 | ||
88 | inline | |
89 | type & | |
90 | operator|=( type & l, type r) { | |
91 | l = l | r; | |
92 | return l; | |
93 | } | |
94 | ||
95 | inline | |
96 | type & | |
97 | operator^=( type & l, type r) { | |
98 | l = l ^ r; | |
99 | return l; | |
100 | } | |
101 | ||
102 | }} | |
103 | ||
104 | #ifdef BOOST_HAS_ABI_HEADERS | |
105 | # include BOOST_ABI_SUFFIX | |
106 | #endif | |
107 | ||
108 | #endif // BOOST_FIBERS_TYPE_H |