A promise-based interface to QFuture, similar to std::promise for std::future.
More...
#include <promise.h>
|
| QFuture< T > | future () |
| | Return a future that can be used to access the result.
|
| void | abandon () |
| | Mark the result as cancelled.
|
| void | setResult (const T &value) |
| | Set the result value that will be made available through the future.
|
| template<typename U> |
| void | setResult (QFuture< U > future) |
| | Set the result value from the given future. Will block if future is not ready.
|
| template<typename U> |
| void | chainResult (QFuture< U > future) |
| | When the given future is ready, use its result to set the result of this promise.
|
| template<typename F> |
| void | setResultFrom (F &&func) |
| | Invoke a functor and use its return value to set the result.
|
template<typename T>
class swift::misc::CPromise< T >
A promise-based interface to QFuture, similar to std::promise for std::future.
Definition at line 86 of file promise.h.
◆ abandon()
Mark the result as cancelled.
Definition at line 93 of file promise.h.
◆ chainResult()
template<typename T>
template<typename U>
When the given future is ready, use its result to set the result of this promise.
Definition at line 112 of file promise.h.
◆ future()
Return a future that can be used to access the result.
Definition at line 90 of file promise.h.
◆ setResult() [1/2]
Set the result value that will be made available through the future.
Definition at line 100 of file promise.h.
◆ setResult() [2/2]
template<typename T>
template<typename U>
Set the result value from the given future. Will block if future is not ready.
Definition at line 104 of file promise.h.
◆ setResultFrom()
template<typename T>
template<typename F>
Invoke a functor and use its return value to set the result.
Useful for uniform syntax in generic code where T could be void.
Definition at line 120 of file promise.h.
The documentation for this class was generated from the following file: