|
HikoGUI
A low latency retained GUI
|
#include <hikogui/coroutine/scoped_task.hpp>
Data Structures | |
| struct | promise_type |
Public Types | |
| using | value_type = T |
| using | notifier_type = notifier<void(value_type)> |
| 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_task & | operator= (scoped_task const &)=delete |
| scoped_task (scoped_task &&other) noexcept | |
| scoped_task & | operator= (scoped_task &&other) noexcept |
| bool | done () const noexcept |
| Check if the co-routine has completed. | |
| operator bool () const noexcept | |
| Check if the co-routine has completed. | |
| value_type const & | value () const |
| Get the return value returned from co_return. | |
| value_type const & | operator* () 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 |
| Subscribe a callback for when the co-routine is completed. | |
A scoped_task.
Like the hi::task instance this implements a asynchronous co-routine task.
If the scoped_task object is destroyed, the potentially non-completed co-routine will be destroyed as well. A scoped_task is a move-only object.
| T | The type returned by co_return. |
|
inlinenoexcept |
Check if the co-routine has completed.
|
inlineexplicitnoexcept |
Check if the co-routine has completed.
|
inline |
Get the return value returned from co_return.
| The | exception thrown from the co-routine. |
|
inlinenoexcept |
Subscribe a callback for when the co-routine is completed.
| flags | The callback flags used to be passed to the notifier. |
| callback | The callback to call when the co-routine executed co_return. If co_return has a non-void expression then the callback must accept the expression as an argument. |
|
inline |
Get the return value returned from co_return.
| The | exception thrown from the co-routine. |