32 class FutureSharedState;
83template<
typename ValueType>
86 typedef Value<ValueType> Type;
92 return static_cast<const Type*
>(
value)->
value();
97 return new Type(
value);
109 const ValueType &
value()
const {
return value_; }
111 const ValueType value_;
123 return state_ !=
nullptr;
198 const
System::FutureSharedState * state_;
256 FutureBase::operator=(other);
265 FutureBase::operator=(std::move(other));
282 FutureBase::swap(other);
288 : FutureBase(state) {}
291 SharedFuture(
const System::FutureSharedState * state, moving_init_t t) noexcept
292 : FutureBase(state, t) {}
294 friend class Implementation::FutureHelper;
375 PromiseBase::operator=(other);
384 PromiseBase::operator=(std::move(other));
391 PromiseBase::swap(other);
408 template<
typename ExceptionType>
437 PromiseBase::operator=(other);
446 PromiseBase::operator=(std::move(other));
453 PromiseBase::swap(other);
470 template<
typename ExceptionType>
#define ONIXS_FIXENGINE_API
The base implementation of the SharedFuture<T>.
ONIXS_FIXENGINE_API FutureBase & operator=(const FutureBase &other) noexcept
ONIXS_FIXENGINE_API ~FutureBase() noexcept
ONIXS_FIXENGINE_API bool hasException() const
friend class FutureHelper
ONIXS_FIXENGINE_API FutureBase(const FutureBase &other) noexcept
ONIXS_FIXENGINE_API FutureBase(FutureBase &&other) noexcept
ONIXS_FIXENGINE_API const FutureValue & getValue() const
ONIXS_FIXENGINE_API bool isReady() const
bool valid() const noexcept
ONIXS_FIXENGINE_API FutureStatus::Enum wait(int timeoutInMs=InfiniteTimeout) const
ONIXS_FIXENGINE_API bool hasValue() const
ONIXS_FIXENGINE_API FutureBase(const System::FutureSharedState *state) noexcept
Initializes the instance with shared state.
ONIXS_FIXENGINE_API void getVoid() const
ONIXS_FIXENGINE_API FutureBase & operator=(FutureBase &&other) noexcept
ONIXS_FIXENGINE_API FutureBase(const System::FutureSharedState *state, moving_init_t) noexcept
Initializes the instance with shared state.
ONIXS_FIXENGINE_API std::exception_ptr getExceptionPtr() const
ONIXS_FIXENGINE_API void swap(FutureBase &other) noexcept
FutureValue(ValueBase *value)
ValueBase * value() const
FutureValue(const FutureValue &other)
The base implementation of the PromiseFuture<T>.
ONIXS_FIXENGINE_API void setExceptionImpl()
ONIXS_FIXENGINE_API PromiseBase() noexcept
ONIXS_FIXENGINE_API void setValue(ValueBase *value)
SharedFuture< T > getTypedFuture() const
ONIXS_FIXENGINE_API SharedFuture< FutureValue > getFutureImpl() const
ONIXS_FIXENGINE_API void swap(PromiseBase &other) noexcept
ONIXS_FIXENGINE_API void setVoid()
virtual ~ValueBase()=default
virtual ValueBase * clone() const =0
ValueBase * clone() const override
static const ValueType & value(const ValueBase *value)
static ValueBase * create(const ValueType &value)
Promise< void > & operator=(const Promise< void > &other) noexcept
The copy assignment.
SharedFuture< void > getFuture() const
void set()
Sets the successful result to the given shared state.
Promise(Promise< void > &&other) noexcept
void swap(Promise< void > &other) noexcept
Swaps two Promise objects.
Promise(const Promise< void > &other) noexcept
The copy constructor.
void setException(const ExceptionType &exception)
Promise & operator=(Promise< void > &&other) noexcept
void set(const T &value)
Sets the successful result value to the given shared state.
Promise & operator=(Promise< T > &&other) noexcept
Promise< T > & operator=(const Promise< T > &other) noexcept
The copy assignment.
void setException(const ExceptionType &exception)
Promise(const Promise< T > &other) noexcept
The copy constructor.
SharedFuture< T > getFuture() const
void swap(Promise< T > &other) noexcept
Swaps two Promise objects.
Promise(Promise< T > &&other) noexcept
void swap(SharedFuture< T > &other) noexcept
swaps two SharedFuture objects
SharedFuture(const SharedFuture< T > &other) noexcept
The copy constructor.
SharedFuture(SharedFuture< T > &&other) noexcept
FutureBase & operator=(SharedFuture< T > &&other) noexcept
Implementation::FutureGetReturn< T >::Type get() const
SharedFuture< T > & operator=(const SharedFuture< T > &other) noexcept
The copy assignment.
The state of a SharedFuture object (similar to std::future_status,.
@ timeout
The shared state did not become ready before the specified timeout duration has passed.
@ ready
The shared state is ready.
@ deferred
The shared state contains a deferred function, so the result will be computed only when explicitly re...