86 bool Wait(uint64_t uTimeoutMs)
const;
138 template <
typename ResultType =
void>
156 bool Get(ResultType *pValue)
const;
167 const ResultType &Get()
const;
178 bool Get(ResultType *pValue, uint32_t uTimeoutMs)
const;
189 const ResultType &Get(uint32_t uTimeoutMs)
const;
198 bool Set(
const ResultType &rValue);
204 bool SetCompleted(
const ResultType &rValue);
249 template <
typename ResultType>
269 bool Get(ResultType **pValue)
const;
284 const ResultType *Get()
const;
297 bool Get(ResultType **pValue, uint32_t uTimeoutMs)
const;
312 const ResultType *Get(uint32_t uTimeoutMs)
const;
342 ResultType *Take(uint32_t uTimeoutMs);
353 bool Set(ResultType *pValue);
359 bool SetCompleted(ResultType *pValue);
362 ResultType *m_pResult;
363 bool m_bHasOwnershipOfResult;
369 template <
typename ResultType>
381 #include "YiFuture.inl" CYISignal Cancelled
A signal triggered when this object is cancelled.
Definition: YiFuture.h:89
virtual ~CYIAbstractFuture()
CYISignal Completed
A signal triggered when this object is marked as completed.
Definition: YiFuture.h:236
void ExclusiveLock() const
Locks both this object and the associated task (if it exists).
Definition: YiMutex.h:110
bool SetTask(CYITaskBase *pTask)
Sets the task asssociated with this object to the provided task. Returns true if the task was associa...
void ExclusiveUnlock() const
Unlocks both this object and the associated task (if it exists).
void DisconnectFromTask()
Removes the task reference, if it exists. If an associated task exists, an attempt is made at cancell...
CYISignal ExecutionStarted
A signal triggered when an associated task begins execution.
Definition: YiFuture.h:88
Definition: YiFuture.h:22
void NotifyStateChanged() const
Notify waiters (e.g. threads blocked on calls to Wait, Get or Take) of state change.
bool WaitNonLocking() const
Equivalent to the Wait() function, but the caller must have m_mutex locked.
CYISignal< const ResultType & > Completed
A signal triggered when a value is assigned to this object.
Definition: YiFuture.h:201
bool CancelInternal(bool bWait)
friend class CYIFuture
Definition: YiFuture.h:25
CYISignal Completed
A signal triggered when a value is assigned to this object. Does not pass a pointer to the contained ...
Definition: YiFuture.h:356
Definition: YiFuture.h:139
A class used to block a thread until a condition is met, as signaled by a different thread...
Definition: YiWaitCondition.h:64
Signals and slots are a thread-safe and flexible communication framework that will allow various obje...
Definition: YiSignal.h:164
bool SetCancelledNonLocking()
Sets the 'cancelled' flag on this object, if it hasn't been done already and the future hasn't had a ...