Lely core libraries
2.2.5
|
The parent class for function objects used as stackless coroutines. More...
#include <coroutine.hpp>
Public Member Functions | |
void | restart () noexcept |
Resets the stackless coroutine so the next invocation starts at the beginning. | |
bool | is_ready () const noexcept |
Returns true if the stackless coroutine has finished. | |
bool | is_parent () const noexcept |
Returns true if the stackless coroutine is the parent of a fork. | |
bool | is_child () const noexcept |
Returns true if the stackless coroutine is the child of a fork. | |
The parent class for function objects used as stackless coroutines.
Derived classes use co_reenter (this) { ... }
in their implementation of operator()
to define the body of the coroutine. Note that local variables are not stored between invocations. It is recommended to use data members for variables that need to be restored.
Definition at line 48 of file coroutine.hpp.