HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions
v1::scoped_task< void > Class Reference

#include <hikogui/coroutine/scoped_task.hpp>

Data Structures

struct  promise_type
 

Public Types

using value_type = void
 
using notifier_type = notifier<>
 
using callback_token = notifier_type::callback_token
 
using callback_proto = notifier_type::callback_proto
 
using handle_type = std::coroutine_handle<promise_type>
 

Public Member Functions

 scoped_task (handle_type coroutine) noexcept
 
 scoped_task (scoped_task const &)=delete
 
scoped_taskoperator= (scoped_task const &)=delete
 
 scoped_task (scoped_task &&other) noexcept
 
scoped_taskoperator= (scoped_task &&other) noexcept
 
bool done () const noexcept
 
 operator bool () const noexcept
 
void value () const
 Get the return value returned from co_return.
 
callback_token subscribe (forward_of< callback_proto > auto &&callback, callback_flags flags=callback_flags::synchronous) noexcept
 

Detailed Description

See also
scoped_task<>

Member Function Documentation

◆ done()

bool v1::scoped_task< void >::done ( ) const
inlinenoexcept
See also
scoped_task<>::completed()

◆ operator bool()

v1::scoped_task< void >::operator bool ( ) const
inlineexplicitnoexcept

◆ subscribe()

callback_token v1::scoped_task< void >::subscribe ( forward_of< callback_proto > auto && callback,
callback_flags flags = callback_flags::synchronous )
inlinenoexcept
See also
notifier<>::subscribe()

◆ value()

void v1::scoped_task< void >::value ( ) const
inline

Get the return value returned from co_return.

Note
It is undefined behavior to call this function if the co-routine is incomplete.
Exceptions
Theexception thrown from the co-routine.

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