Lely core libraries  2.3.4
lely::util::Coroutine Class Reference

The parent class for function objects used as stackless coroutines. More...

#include <coroutine.hpp>

Inheritance diagram for lely::util::Coroutine:

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.
 

Detailed Description

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.


The documentation for this class was generated from the following file: