4 #include <fsdk/Types/Result.h>
15 namespace fsdk_internal {
16 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89 static
void swap(
Future& first,
Future& second) noexcept;
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>
155 class FSDK_API Promise : Noncopyable {
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";
State possible after Promised if promise' method.
#define FSDK_API
Dummy.
Definition: Def.h:27
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
T DataType
Alias for stored data type.
Definition: Future.h:79
FutureError
Enumeration of possible Future errors.
Definition: Future.h:57
Helper class to block copy operator&constructor of its descendants.
Definition: Future.h:43
T DataType
Alias for stored data type.
Definition: Future.h:160
ExecutionPolicy
Enum to tell some method how to behave.
Definition: Future.h:26
State indicating some internal error.
State right after future is created from promise.
Lack of internal state: on promise creation and emptying Future.
Promise class to support asynchronous data retrieval Look into std::promise semantics to understand i...
Definition: Future.h:54
FuturePromiseState
Enumeration of possible future or promise states.
Definition: Future.h:32
State possible if during CancelRequested.
State possible if during Promised.
Invalid data is given as input to some method.
PromiseError
Enumeration of possible Promise errors.
Definition: Future.h:141
Future class to support asynchronous data retrieval Look into std::future semantics to understand it...
Definition: Future.h:72
int32_t USec
Alias for micro seconds type.
Definition: Future.h:75