...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Class attributes
is used to
transfers parameters required to setup a coroutines's context.
struct attributes { std::size_t size; flag_unwind_t do_unwind; bool preserve_fpu; attributes() BOOST_NOEXCEPT : size( ctx::default_stacksize() ), do_unwind( stack_unwind), preserve_fpu( true) {} explicit attributes( std::size_t size_) BOOST_NOEXCEPT : size( size_), do_unwind( stack_unwind), preserve_fpu( true) {} explicit attributes( flag_unwind_t do_unwind_) BOOST_NOEXCEPT : size( ctx::default_stacksize() ), do_unwind( do_unwind_), preserve_fpu( true) {} explicit attributes( bool preserve_fpu_) BOOST_NOEXCEPT : size( ctx::default_stacksize() ), do_unwind( stack_unwind), preserve_fpu( preserve_fpu_) {} explicit attributes( std::size_t size_, flag_unwind_t do_unwind_) BOOST_NOEXCEPT : size( size_), do_unwind( do_unwind_), preserve_fpu( true) {} explicit attributes( std::size_t size_, bool preserve_fpu_) BOOST_NOEXCEPT : size( size_), do_unwind( stack_unwind), preserve_fpu( preserve_fpu_) {} explicit attributes( flag_unwind_t do_unwind_, bool preserve_fpu_) BOOST_NOEXCEPT : size( ctx::default_stacksize() ), do_unwind( do_unwind_), preserve_fpu( preserve_fpu_) {} };
attributes()
Default constructor using ctx::default_stacksize()
, does unwind the stack after coroutine/generator
is complete and preserves FPU registers.
Nothing.
attributes( std::size_t
size)
Argument size
defines
stack size of the inner context
.
Stack unwinding after termination and preserving FPU registers is set
by default.
Nothing.
attributes( flag_unwind_t do_unwind)
Argument do_unwind
determines
if stack will be unwound after termination or not. The default stacksize
is used for the inner context
and FPU registers are preserved.
Nothing.
attributes( bool preserve_fpu)
Argument preserve_fpu
determines if FPU register have to be preserved if a context
switches. THe default stacksize is used for the inner context
and the stack will be unwound after termination.
Nothing.
attributes( std::size_t
size, flag_unwind_t do_unwind)
Arguments size
and do_unwind
are given by the user. FPU
registers preserved during each context
switch.
Nothing.
attributes( std::size_t
size, bool preserve_fpu)
Arguments size
and preserve_fpu
are given by the user.
The stack is automatically unwound after coroutine/generator terminates.
Nothing.
attributes( flag_unwind_t do_unwind, bool preserve_fpu)
Arguments do_unwind
and
preserve_fpu
are given
by the user. The stack gets a default value of ctx::default_stacksize()
.
Nothing.