blob: f06dfbe8208c541d84c3c87f2606dc3b81e6b963 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Attributes</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Coroutine">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Coroutine">
<link rel="prev" href="coroutine/symmetric/yield_coro.html" title="Class symmetric_coroutine&lt;&gt;::yield_type">
<link rel="next" href="stack.html" title="Stack allocation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="coroutine.attributes"></a><a class="link" href="attributes.html" title="Attributes">Attributes</a>
</h2></div></div></div>
<p>
Class <code class="computeroutput"><span class="identifier">attributes</span></code> is used to
specify parameters required to setup a coroutine's context.
</p>
<pre class="programlisting"><span class="keyword">enum</span> <span class="identifier">flag_unwind_t</span>
<span class="special">{</span>
<span class="identifier">stack_unwind</span><span class="special">,</span>
<span class="identifier">no_stack_unwind</span>
<span class="special">};</span>
<span class="keyword">enum</span> <span class="identifier">flag_fpu_t</span>
<span class="special">{</span>
<span class="identifier">fpu_preserved</span><span class="special">,</span>
<span class="identifier">fpu_not_preserved</span>
<span class="special">};</span>
<span class="keyword">struct</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="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu</span><span class="special">;</span>
<span class="identifier">attributes</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
<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>
<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>
<span class="keyword">explicit</span> <span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<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>
<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_fpu_t</span> <span class="identifier">preserve_fpu_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<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="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<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="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu_</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<h4>
<a name="coroutine.attributes.h0"></a>
<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>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
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
is complete and preserves FPU registers.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h1"></a>
<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>
<span class="identifier">size</span><span class="special">)</span></code></a>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Argument <code class="computeroutput"><span class="identifier">size</span></code> defines
stack size of the new coroutine. Stack unwinding after termination and
preserving FPU registers is set by default.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h2"></a>
<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>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Argument <code class="computeroutput"><span class="identifier">do_unwind</span></code> determines
if stack will be unwound after termination or not. The default stacksize
is used for the new coroutine and FPU registers are preserved.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h3"></a>
<span class="phrase"><a name="coroutine.attributes._code__phrase_role__identifier__attributes__phrase__phrase_role__special_____phrase___phrase_role__identifier__flag_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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_fpu_t__phrase___phrase_role__identifier__preserve_fpu__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">attributes</span><span class="special">(</span> <span class="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu</span><span class="special">)</span></code></a>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Argument <code class="computeroutput"><span class="identifier">preserve_fpu</span></code>
determines if FPU register have to be preserved across context switches.
The default stacksize is used for the new coroutine and its stack will
be unwound after termination.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h4"></a>
<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>
<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>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
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. FPU
registers are preserved across each context switch.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h5"></a>
<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_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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>
<span class="identifier">size</span><span class="special">,</span> <span class="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu</span><span class="special">)</span></code></a>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Arguments <code class="computeroutput"><span class="identifier">size</span></code> and <code class="computeroutput"><span class="identifier">preserve_fpu</span></code> are given by the user.
The stack is automatically unwound after coroutine/generator terminates.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h6"></a>
<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___phrase_role__identifier__flag_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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___phrase_role__identifier__flag_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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> <span class="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu</span><span class="special">)</span></code></a>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Arguments <code class="computeroutput"><span class="identifier">do_unwind</span></code> and
<code class="computeroutput"><span class="identifier">preserve_fpu</span></code> are given
by the user. The stack gets a default value of <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>.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
<h4>
<a name="coroutine.attributes.h7"></a>
<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___phrase_role__identifier__flag_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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___phrase_role__identifier__flag_fpu_t__phrase___phrase_role__identifier__preserve_fpu__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>
<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="identifier">flag_fpu_t</span> <span class="identifier">preserve_fpu</span><span class="special">)</span></code></a>
</h4>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Effects:</span></dt>
<dd><p>
Arguments <code class="computeroutput"><span class="identifier">size</span></code>, <code class="computeroutput"><span class="identifier">do_unwind</span></code> and <code class="computeroutput"><span class="identifier">preserve_fpu</span></code>
are given by the user.
</p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
Nothing.
</p></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 Oliver Kowalke<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>