-
#include "tensorstore/util/future.h"
-
template <typename T>
class [[nodiscard]] tensorstore::ReadyFuture : public Future<T>; Future that is guaranteed to be ready.
This type is effectively just a shared-ownership pointer to the result, and is used as the parameter type for
ExecuteWhenReady
andtensorstore::Link
callbacks.Types¶
- using result_type = typename Future<T>::result_type;
Associated result type.
Constructors¶
- ReadyFuture();
Constructs an null ReadyFuture.
- explicit ReadyFuture(Future<T> future);
Constructs a ReadyFuture from an existing Future, which must either be null or ready.
- ReadyFuture(ReadyFuture<U> other);
Constructs a ReadyFuture from an existing ReadyFuture.
Methods¶
- ReadyFuture& operator=(ReadyFuture<U> other);
Assigns a ReadyFuture from an existing ReadyFuture.
- result_type& result() const;
Returns a reference to the result, guaranteed not to block.
- std::add_lvalue_reference_t<T> value() const;
Returns a reference to the value contained in the result, guaranteed not to block.