Asynchronous result wrapping std::future<T>. More...
#include <future.h>
Public Member Functions | |
| Future ()=default | |
| Constructs an invalid (empty) Future. | |
| Future (std::future< T > &&f) | |
| Constructs a Future from a std::future. | |
| ~Future ()=default | |
| Destructor. | |
| Future (const Future &)=delete | |
| Future & | operator= (const Future &)=delete |
| Future (Future &&other)=default | |
| Move constructor. | |
| Future & | operator= (Future &&other)=default |
| Move assignment. | |
| bool | isReady () const |
| Checks whether the result is ready without blocking. | |
| Result< T > | result (unsigned int timeoutMs=0) |
| Returns the result, blocking until available or timeout. | |
| void | waitForFinished () |
| Blocks until the result is ready. | |
| Error | waitForFinished (unsigned int timeoutMs) |
| Blocks until the result is ready or the timeout expires. | |
| bool | isValid () const |
| Returns whether this Future holds a valid shared state. | |
Asynchronous result wrapping std::future<T>.
Returned by Promise<T>::future() and ThreadPool::submit().
| T | The result type. |
Checks whether the result is ready without blocking.
Returns whether this Future holds a valid shared state.
Returns the result, blocking until available or timeout.
| timeoutMs | Maximum time to wait in milliseconds. A value of 0 (the default) waits indefinitely. |
Blocks until the result is ready or the timeout expires.
| timeoutMs | Maximum time to wait in milliseconds. |