|
fiber
|
Promise type for an fiber::Coroutine. More...
#include <Coroutine.hpp>
Public Member Functions | |
| CoroutinePromise () | |
| template<class Awaitable> | |
| constexpr auto | await_transform (Awaitable &&awaitable) |
| auto | get_return_object () |
| constexpr void | unhandled_exception () noexcept |
| Print an error message and kill the task. | |
| constexpr void | return_value (const ReturnType &value) |
| constexpr void | return_value (ReturnType &&value) |
| constexpr ReturnType && | get_return_value () |
| constexpr bool | await_ready () const noexcept |
| constexpr ReturnType | await_resume () |
Public Member Functions inherited from fiber::CoroutineNode | |
| 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 |
Static Public Member Functions | |
| static constexpr void * | operator new (std::size_t size) |
| static constexpr void | operator delete (void *ptr, std::size_t size) |
Additional Inherited Members | |
Public Attributes inherited from fiber::CoroutineNode | |
| std::coroutine_handle | _handle = nullptr |
| TaskBase * | _task = nullptr |
| CoroutineNode * | _parent = nullptr |
Promise type for an fiber::Coroutine.
This class implements the coroutine promise required by the C++20 coroutine machinery. CoroutinePromise<ReturnType> is instantiated by the compiler when a coroutine with Coroutine<ReturnType> as its return type is used.
The await_transform() method is used to wrap arbitrary awaitables unless they already derive from a framework-specific AwaitableNode. This supports customization of how co_await expressions behave within the coroutine body.
Overrides operator new and operator delete to allocate memory for the coroutine frame from a custom allocator. In the usual cast this allocator is provided by the root task of the coroutine chain
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Print an error message and kill the task.