|
future< T > | CreateFuture (uint64_t request) |
| Creates a future. More...
|
|
future< T > | MakeReadyFuture (T &&value) |
| Creates a future and makes it immediately ready. More...
|
|
promise< T > | CreatePromise (uint64_t request) |
| Creates a promise. More...
|
|
void | SetValue (uint64_t request, const T &value) |
| Sets a value directly for a future without creating a promise object. More...
|
|
void | SetValue (uint64_t request, T &&value) |
| Sets a value directly for a future without creating a promise object. More...
|
|
void | SetThen (uint64_t request, uint64_t outRequest, ThenFunction func) |
|
bool | IsReady (uint64_t request) noexcept |
|
T | GetResult (uint64_t request) |
|
void | WaitResult (uint64_t request) |
|
template<class Clock , class Duration > |
bool | WaitResultUntil (uint64_t request, const std::chrono::time_point< Clock, Duration > &timeout_time) |
|
| ~PromiseFactoryBase () |
|
bool | IsActive () const |
|
wpi::mutex & | GetResultMutex () |
|
void | Notify () |
|
void | Wait (std::unique_lock< wpi::mutex > &lock) |
|
template<class Clock , class Duration > |
bool | WaitUntil (std::unique_lock< wpi::mutex > &lock, const std::chrono::time_point< Clock, Duration > &timeout_time) |
|
void | IgnoreResult (uint64_t request) |
|
uint64_t | CreateRequest () |
|
bool | EraseRequest (uint64_t request) |
|
uint64_t | CreateErasedRequest () |
|
template<typename T>
class wpi::PromiseFactory< T >
A promise factory for lightweight futures.
The lifetime of the factory must be ensured to be longer than any futures it creates.
Use CreateRequest() to create the future request id, and then CreateFuture() and CreatePromise() to create future and promise objects. A promise should only be created once for any given request id.
- Template Parameters
-
T | the "return" type of the promise/future |