#include <core/thread/task.hpp>
template<typename T>
Task class final
Provides a mechanism to access the results of asynchronous operations.
Template parameters | |
---|---|
T | Result type. |
Constructors, destructors, conversion operators
Public functions
- auto operator=(const Task& other) -> Task&
- Copy assigns.
- auto operator=(Task&& other) -> Task& noexcept
- Move assigns.
- void finish(T value)
- Finishes the task, setting its result and notifying a waiting thread.
- void discard()
- Discards any result eventually received. The task is left in an invalid state.
- auto isDone() const -> bool
- Returns whether the task has finished.
- auto result() -> T
- Blocks until the task finishes and then returns its result.
Function documentation
template<typename T>
bool cubos:: core:: thread:: Task<T>:: isDone() const
Returns whether the task has finished.
Returns | Whether the task has finished. |
---|