1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Attributes</title> 5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Chapter 1. Coroutine"> 8<link rel="up" href="../index.html" title="Chapter 1. Coroutine"> 9<link rel="prev" href="coroutine/symmetric/yield_coro.html" title="Class symmetric_coroutine<>::yield_type"> 10<link rel="next" href="stack.html" title="Stack allocation"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="coroutine/symmetric/yield_coro.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="stack.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="coroutine.attributes"></a><a class="link" href="attributes.html" title="Attributes">Attributes</a> 28</h2></div></div></div> 29<p> 30 Class <code class="computeroutput"><span class="identifier">attributes</span></code> is used to 31 specify parameters required to setup a coroutine's context. 32 </p> 33<pre class="programlisting"><span class="keyword">enum</span> <span class="identifier">flag_unwind_t</span> 34<span class="special">{</span> 35 <span class="identifier">stack_unwind</span><span class="special">,</span> 36 <span class="identifier">no_stack_unwind</span> 37<span class="special">};</span> 38 39<span class="keyword">struct</span> <span class="identifier">attributes</span> 40<span class="special">{</span> 41 <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">;</span> 42 <span class="identifier">flag_unwind_t</span> <span class="identifier">do_unwind</span><span class="special">;</span> 43 44 <span class="identifier">attributes</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span> 45 46 <span class="keyword">explicit</span> <span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 47 48 <span class="keyword">explicit</span> <span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">flag_unwind_t</span> <span class="identifier">do_unwind_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 49 50 <span class="keyword">explicit</span> <span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size_</span><span class="special">,</span> <span class="identifier">flag_unwind_t</span> <span class="identifier">do_unwind_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span> 51<span class="special">};</span> 52</pre> 53<h4> 54<a name="coroutine.attributes.h0"></a> 55 <span class="phrase"><a name="coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="attributes.html#coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="identifier">attributes</span><span class="special">()</span></code></a> 56 </h4> 57<div class="variablelist"> 58<p class="title"><b></b></p> 59<dl class="variablelist"> 60<dt><span class="term">Effects:</span></dt> 61<dd><p> 62 Default constructor using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">context</span><span class="special">::</span><span class="identifier">default_stacksize</span><span class="special">()</span></code>, does unwind the stack after coroutine/generator 63 is complete. 64 </p></dd> 65<dt><span class="term">Throws:</span></dt> 66<dd><p> 67 Nothing. 68 </p></dd> 69</dl> 70</div> 71<h4> 72<a name="coroutine.attributes.h1"></a> 73 <span class="phrase"><a name="coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__size__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="attributes.html#coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__size__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> 74 <span class="identifier">size</span><span class="special">)</span></code></a> 75 </h4> 76<div class="variablelist"> 77<p class="title"><b></b></p> 78<dl class="variablelist"> 79<dt><span class="term">Effects:</span></dt> 80<dd><p> 81 Argument <code class="computeroutput"><span class="identifier">size</span></code> defines 82 stack size of the new coroutine. Stack unwinding after termination. 83 </p></dd> 84<dt><span class="term">Throws:</span></dt> 85<dd><p> 86 Nothing. 87 </p></dd> 88</dl> 89</div> 90<h4> 91<a name="coroutine.attributes.h2"></a> 92 <span class="phrase"><a name="coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__flag_unwind_t__phrase___phrase_role__identifier__do_unwind__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="attributes.html#coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__flag_unwind_t__phrase___phrase_role__identifier__do_unwind__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">flag_unwind_t</span> <span class="identifier">do_unwind</span><span class="special">)</span></code></a> 93 </h4> 94<div class="variablelist"> 95<p class="title"><b></b></p> 96<dl class="variablelist"> 97<dt><span class="term">Effects:</span></dt> 98<dd><p> 99 Argument <code class="computeroutput"><span class="identifier">do_unwind</span></code> determines 100 if stack will be unwound after termination or not. The default stacksize 101 is used for the new coroutine. 102 </p></dd> 103<dt><span class="term">Throws:</span></dt> 104<dd><p> 105 Nothing. 106 </p></dd> 107</dl> 108</div> 109<h4> 110<a name="coroutine.attributes.h3"></a> 111 <span class="phrase"><a name="coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__size__phrase__phrase_role__special_____phrase___phrase_role__identifier__flag_unwind_t__phrase___phrase_role__identifier__do_unwind__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="attributes.html#coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase___phrase_role__identifier__size__phrase__phrase_role__special_____phrase___phrase_role__identifier__flag_unwind_t__phrase___phrase_role__identifier__do_unwind__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> 112 <span class="identifier">size</span><span class="special">,</span> <span class="identifier">flag_unwind_t</span> <span class="identifier">do_unwind</span><span class="special">)</span></code></a> 113 </h4> 114<div class="variablelist"> 115<p class="title"><b></b></p> 116<dl class="variablelist"> 117<dt><span class="term">Effects:</span></dt> 118<dd><p> 119 Arguments <code class="computeroutput"><span class="identifier">size</span></code> and <code class="computeroutput"><span class="identifier">do_unwind</span></code> are given by the user. 120 </p></dd> 121<dt><span class="term">Throws:</span></dt> 122<dd><p> 123 Nothing. 124 </p></dd> 125</dl> 126</div> 127</div> 128<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 129<td align="left"></td> 130<td align="right"><div class="copyright-footer">Copyright © 2009 Oliver Kowalke<p> 131 Distributed under the Boost Software License, Version 1.0. (See accompanying 132 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 133 </p> 134</div></td> 135</tr></table> 136<hr> 137<div class="spirit-nav"> 138<a accesskey="p" href="coroutine/symmetric/yield_coro.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="stack.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 139</div> 140</body> 141</html> 142