|
fiber
|
Represents a coroutine (node) in a reverse-linked list of nested coroutines. More...
#include <Coroutine.hpp>
Public Member Functions | |
| void | destroy () noexcept |
| void | resume () noexcept |
| bool | is_done () const noexcept |
| constexpr | operator bool () |
| constexpr TaskBase * | task () |
| constexpr const TaskBase * | task () const |
| constexpr CoroutineNode * | parent () |
| constexpr const CoroutineNode * | parent () const |
| constexpr std::coroutine_handle | handle () |
| constexpr const std::coroutine_handle | handle () const |
| constexpr void | Register (TaskBase *task) |
| template<class ReturnType> | |
| constexpr void | await_suspend (std::coroutine_handle< CoroutinePromise< ReturnType > > handle) noexcept |
| bool | await_ready () const noexcept |
| constexpr std::suspend_always | final_suspend () noexcept |
| constexpr std::suspend_always | initial_suspend () noexcept |
Public Attributes | |
| std::coroutine_handle | _handle = nullptr |
| TaskBase * | _task = nullptr |
| CoroutineNode * | _parent = nullptr |
Represents a coroutine (node) in a reverse-linked list of nested coroutines.
A coroutine node is the common interface between coroutines of different return types and allows arbitrary nesting of such.
If a new coroutine is being co_awaited, this class makes sure it is being registered at the root TaskBase. Further, it stores a handle to its parent/callers coroutine.
If the coroutine finishes, e.g.: via co_return, then it will un-register itself and re-register the parent/callers coroutine for execution.
Overload the following methods:
void destroy() noexceptvoid resume() noexceptbool is_done() const noexcept
|
inlinenoexcept |
|
constexprnoexcept |
|
inlinenoexcept |
|
constexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlinenoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
| std::coroutine_handle fiber::CoroutineNode::_handle = nullptr |
| CoroutineNode* fiber::CoroutineNode::_parent = nullptr |
| TaskBase* fiber::CoroutineNode::_task = nullptr |