fiber
Loading...
Searching...
No Matches
fiber::AwaitableWrapper< Awaitable, is_lvalue > Class Template Reference

Wraps awaitables that are not yet derived from fiber::AwaitableNode More...

#include <Coroutine.hpp>

Public Member Functions

constexpr AwaitableWrapper (Awaitable &awaitable)
 
constexpr bool await_ready () const noexcept
 
constexpr auto await_resume () noexcept
 
constexpr CoSignal await_suspend_signal () const noexcept
 
template<class ReturnType>
constexpr auto await_suspend (std::coroutine_handle< fiber::CoroutinePromise< ReturnType > > handle) noexcept
 

Static Public Member Functions

static bool s_await_ready (const AwaitableWrapper *This)
 

Detailed Description

template<class Awaitable, bool is_lvalue = true>
class fiber::AwaitableWrapper< Awaitable, is_lvalue >

Wraps awaitables that are not yet derived from fiber::AwaitableNode

If wraps arbitrary awaitables that do not derive from fiber::AwaitableNode that implements the registration infrastructure relied on by fiber::Coroutine and fiber::TaskBase.

Specialises for awaitable passed as lvalues.

Intended to be used only by CoroutinePromise::await_transform(awaitable)

Template Parameters
Awaitablean awaitable that implements .await_ready(), .await_resume() and .await_suspend(handle).
See also
fiber::AwaitableNode
fiber::Coroutine
fiber::CoroutinePromise
fiber::TaskBase
fiber::wrap_awaitable(Awaitable&& awaitable)

Constructor & Destructor Documentation

◆ AwaitableWrapper()

template<class Awaitable, bool is_lvalue = true>
fiber::AwaitableWrapper< Awaitable, is_lvalue >::AwaitableWrapper ( Awaitable & awaitable)
inlineconstexpr

Member Function Documentation

◆ await_ready()

template<class Awaitable, bool is_lvalue = true>
bool fiber::AwaitableWrapper< Awaitable, is_lvalue >::await_ready ( ) const
inlineconstexprnoexcept

◆ await_resume()

template<class Awaitable, bool is_lvalue = true>
auto fiber::AwaitableWrapper< Awaitable, is_lvalue >::await_resume ( )
inlineconstexprnoexcept

◆ await_suspend()

template<class Awaitable, bool is_lvalue = true>
template<class ReturnType>
auto fiber::AwaitableWrapper< Awaitable, is_lvalue >::await_suspend ( std::coroutine_handle< fiber::CoroutinePromise< ReturnType > > handle)
inlineconstexprnoexcept

◆ await_suspend_signal()

template<class Awaitable, bool is_lvalue = true>
CoSignal fiber::AwaitableWrapper< Awaitable, is_lvalue >::await_suspend_signal ( ) const
inlineconstexprnoexcept

◆ s_await_ready()

template<class Awaitable, bool is_lvalue = true>
static bool fiber::AwaitableWrapper< Awaitable, is_lvalue >::s_await_ready ( const AwaitableWrapper< Awaitable, is_lvalue > * This)
inlinestatic

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