|
| task_controller (task_controller const &)=delete |
|
| task_controller (task_controller &&)=delete |
|
task_controller & | operator= (task_controller const &)=delete |
|
task_controller & | operator= (task_controller &&)=delete |
|
| task_controller () noexcept |
| Create a new task_controller.
|
|
template<typename Func , typename... Args>
requires compatible_cancelable_async_callable<ResultType, Func, Args...> |
| task_controller (Func &&func, Args &&... args) |
| Create a new task_controller with a assigned coroutine or function and its arguments.
|
|
template<typename Func , typename... Args>
requires compatible_cancelable_async_callable<ResultType, Func, Args...> |
void | set_function (Func &&func, Args &&... args) |
| Set the coroutine or function and its arguments.
|
|
void | unset_function () |
| Remove the task, so that it can no longer be run.
|
|
cancel_features_type | features () const noexcept |
| The features of the coroutine or function that was assigned.
|
|
bool | runnable () const noexcept |
| Check if a function is assigned.
|
|
bool | started () const noexcept |
| Check if the function was started.
|
|
bool | running () const noexcept |
| Check if the function is currently running.
|
|
bool | done () const noexcept |
| Check if the function has completed.
|
|
void | reset () |
| Reset the state of the function to not-started.
|
|
void | run () |
| Run the assigned coroutine or function with the previous given arguments.
|
|
bool | request_stop () noexcept |
| Request stop.
|
|
float_t | progress () const noexcept |
| Get progress of a function.
|
|
result_type | value () const |
| Get the return value from the coroutine or function.
|
|
template<typename Callback > |
hi::notifier ::callback_type | subscribe (Callback &&callback, callback_flags flags=callback_flags::synchronous) |
| Register a callback to be called when a coroutine or function reports progress.
|
|
template<typename ResultType>
class hi::v1::task_controller< ResultType >
A task controller.
- Template Parameters
-
ResultType | The type of the result of a hi::task or function. |