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

#include <hikogui/dispatch/task.hpp>

Data Structures

struct  promise_type
 

Public Types

using value_type = void
 
using notifier_type = notifier<void()>
 
using callback_type = notifier_type::callback_type
 
using handle_type = std::coroutine_handle<promise_type>
 

Public Member Functions

 task (handle_type coroutine) noexcept
 
 task (task const &)=delete
 
taskoperator= (task const &)=delete
 
 task (task &&other) noexcept
 
taskoperator= (task &&other) noexcept
 
bool started () const noexcept
 Check if the co-routine was started.
 
bool running () const noexcept
 Check if the co-routine is running.
 
bool done () const noexcept
 Check if the co-routine has completed.
 
void value () const
 Get the return value returned from co_return.
 
template<forward_of< void()> Func>
callback< void()> subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
 
auto operator co_await () const noexcept
 Create an awaiter that can await on this task.
 

Detailed Description

template<bool DestroyFrame>
class v1::task< void, DestroyFrame >
See also
task<>

Member Function Documentation

◆ done()

template<bool DestroyFrame>
bool v1::task< void, DestroyFrame >::done ( ) const
inlinenoexcept

Check if the co-routine has completed.

◆ operator co_await()

template<bool DestroyFrame>
auto v1::task< void, DestroyFrame >::operator co_await ( ) const
inlinenoexcept

Create an awaiter that can await on this task.

◆ running()

template<bool DestroyFrame>
bool v1::task< void, DestroyFrame >::running ( ) const
inlinenoexcept

Check if the co-routine is running.

◆ started()

template<bool DestroyFrame>
bool v1::task< void, DestroyFrame >::started ( ) const
inlinenoexcept

Check if the co-routine was started.

◆ subscribe()

template<bool DestroyFrame>
template<forward_of< void()> Func>
callback< void()> v1::task< void, DestroyFrame >::subscribe ( Func && func,
callback_flags flags = callback_flags::synchronous )
inlinenoexcept
See also
notifier<>::subscribe()

◆ value()

template<bool DestroyFrame>
void v1::task< void, DestroyFrame >::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: