fiber
Loading...
Searching...
No Matches
fiber::AwaitCallable< Callable, lvalue_reference > Class Template Reference

Awaitable that waits for a function to return true. More...

#include <Await.hpp>

Public Member Functions

 AwaitCallable (bool expected, const Callable &callable)
 
constexpr bool await_ready () const noexcept
 Returns the value of the callable.
 
constexpr void await_resume ()
 no operation. For coroutine machinery.
 
template<class Handle>
constexpr void await_suspend (const Handle &handle) noexcept
 no operation. suspends always. For coroutine machinery.
 

Detailed Description

template<class Callable, bool lvalue_reference = true>
class fiber::AwaitCallable< Callable, lvalue_reference >

Awaitable that waits for a function to return true.

Useful if you need to wait for an condition or register value

Example:

co_await fiber::TrueAwait([]{return ptr->to->register->bit;})
Template Parameters
Callablea callable that returns true

Constructor & Destructor Documentation

◆ AwaitCallable()

template<class Callable, bool lvalue_reference = true>
fiber::AwaitCallable< Callable, lvalue_reference >::AwaitCallable ( bool expected,
const Callable & callable )
inline

Member Function Documentation

◆ await_ready()

template<class Callable, bool lvalue_reference = true>
bool fiber::AwaitCallable< Callable, lvalue_reference >::await_ready ( ) const
inlineconstexprnoexcept

Returns the value of the callable.

◆ await_resume()

template<class Callable, bool lvalue_reference = true>
void fiber::AwaitCallable< Callable, lvalue_reference >::await_resume ( )
inlineconstexpr

no operation. For coroutine machinery.

◆ await_suspend()

template<class Callable, bool lvalue_reference = true>
template<class Handle>
void fiber::AwaitCallable< Callable, lvalue_reference >::await_suspend ( const Handle & handle)
inlineconstexprnoexcept

no operation. suspends always. For coroutine machinery.


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