]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright Oliver Kowalke 2009. | |
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 | ||
8 | [section:attributes Attributes] | |
9 | ||
10 | Class `attributes` is used to specify parameters required to setup a | |
11 | coroutine's context. | |
12 | ||
13 | enum flag_unwind_t | |
14 | { | |
15 | stack_unwind, | |
16 | no_stack_unwind | |
17 | }; | |
18 | ||
19 | struct attributes | |
20 | { | |
21 | std::size_t size; | |
22 | flag_unwind_t do_unwind; | |
23 | ||
24 | attributes() noexcept; | |
25 | ||
26 | explicit attributes( std::size_t size_) noexcept; | |
27 | ||
28 | explicit attributes( flag_unwind_t do_unwind_) noexcept; | |
29 | ||
30 | explicit attributes( std::size_t size_, flag_unwind_t do_unwind_) noexcept; | |
31 | }; | |
32 | ||
33 | [heading `attributes()`] | |
34 | [variablelist | |
35 | [[Effects:] [Default constructor using `boost::context::default_stacksize()`, does unwind | |
36 | the stack after coroutine/generator is complete.]] | |
37 | [[Throws:] [Nothing.]] | |
38 | ] | |
39 | ||
40 | [heading `attributes( std::size_t size)`] | |
41 | [variablelist | |
42 | [[Effects:] [Argument `size` defines stack size of the new coroutine. | |
43 | Stack unwinding after termination.]] | |
44 | [[Throws:] [Nothing.]] | |
45 | ] | |
46 | ||
47 | [heading `attributes( flag_unwind_t do_unwind)`] | |
48 | [variablelist | |
49 | [[Effects:] [Argument `do_unwind` determines if stack will be unwound after | |
50 | termination or not. The default stacksize is used for the new coroutine.]] | |
51 | [[Throws:] [Nothing.]] | |
52 | ] | |
53 | ||
54 | [heading `attributes( std::size_t size, flag_unwind_t do_unwind)`] | |
55 | [variablelist | |
56 | [[Effects:] [Arguments `size` and `do_unwind` are given by the user.]] | |
57 | [[Throws:] [Nothing.]] | |
58 | ] | |
59 | ||
60 | [endsect] |