4#include <fsdk/Types/Result.h>
15namespace fsdk_internal {
16#ifndef DOXYGEN_SHOULD_SKIP_THIS
130#ifndef DOXYGEN_SHOULD_SKIP_THIS
131 Future(fsdk_internal::FutureImpl<T>* impl)
noexcept;
136 fsdk_internal::FutureImpl<T>* m_pimpl =
nullptr;
154 template <
typename T>
210#ifndef DOXYGEN_SHOULD_SKIP_THIS
212 fsdk_internal::PromiseImpl<T>* m_pimpl =
nullptr;
221 static bool isOk(
const FutureError error)
noexcept {
225 static const char* toString(
const FutureError error)
noexcept {
230 return "Invalid data is given as input to some method";
232 return "Error if you call @see Future::cancel on not Promised state";
234 return "Error if you call @see Future::takeInto on not Fulfilled state";
236 return "Error if you try to @see Future::wait on non waitable state";
238 return "Error if your @see Future::waitFor method ran out of time";
240 return "Some internal error";
242 return "Unknown error";
256 static const char* toString(
const PromiseError error)
noexcept {
261 return "Internal error.";
263 return "Error if you call @see Promise::cancel on not CancelRequested state.";
265 return "Error if you call @see Promise::fail on not Promised and not CancelRequested state.";
267 return "Error if you call @see Promise::fulfill on not Promised state.";
269 return "Error if you call @see Promise::future on not Empty state.";
271 return "Unknown error";
#define FSDK_API
Dummy.
Definition Def.h:27
Future class to support asynchronous data retrieval Look into std::future semantics to understand it.
Definition Future.h:72
T DataType
Alias for stored data type.
Definition Future.h:79
Future() noexcept
Constructor for empty useless shell of a future.
int32_t USec
Alias for micro seconds type.
Definition Future.h:75
Helper class to block copy operator&constructor of its descendants.
Definition Future.h:43
Promise class to support asynchronous data retrieval Look into std::promise semantics to understand i...
Definition Future.h:155
Promise() noexcept
Constructor for empty Promise.
T DataType
Alias for stored data type.
Definition Future.h:160
SDK namespace.
Definition IAGSEstimator.h:8
ExecutionPolicy
Enum to tell some method how to behave.
Definition Future.h:26
@ Async
Execute asynchronously.
@ Sync
Execute synchronously.
FuturePromiseState
Enumeration of possible future or promise states.
Definition Future.h:32
@ Canceled
State possible if during CancelRequested.
@ Fulfilled
State possible after Promised if promise' method.
@ Promised
State right after future is created from promise.
@ Broken
State indicating some internal error.
@ Empty
Lack of internal state: on promise creation and emptying Future.
@ Failed
State possible if during Promised.
@ CancelRequested
State possible if.
PromiseError
Enumeration of possible Promise errors.
Definition Future.h:141
@ StateNotCancelable
Error if you call.
@ StateDoesntAllowFutureCreation
Error if you call.
@ Internal
Internal error.
@ StateNotFailable
Error if you call.
@ StateNotFulfillable
Error if you call.
@ Internal
Internal error.
@ InvalidInput
Invalid input.
FutureError
Enumeration of possible Future errors.
Definition Future.h:57
@ NotFulfilled
Error if you call.
@ NonWaitable
Error if you try to.
@ NotPromised
Error if you call.
@ Internal
Some internal error.
@ InvalidInput
Invalid data is given as input to some method.
A structure that encapsulates an action result enumeration.
Definition Result.h:27