![]() |
Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Responsible for syncronization between the task and the receiving thread. More...
#include <Future.h>
Public Member Functions | |
Receiver ()=default | |
~Receiver () | |
Receiver (const Receiver &)=delete | |
Receiver (Receiver &&)=delete | |
bool | IsDoneOrCanceled () const |
void | Wait () |
bool | Cancel () |
If the task is pending, cancel it: the status becomes CANCELED and if the task was completed, the result is destroyed. More... | |
ResultType | GetResult () |
Move the result away from the shared state, mark the future invalid. More... | |
Public Attributes | |
std::atomic< Status > | m_Status = Status::PENDING |
std::mutex | m_Mutex |
std::condition_variable | m_ConditionVariable |
std::tuple< ResultHolder< ResultType >, std::exception_ptr > | m_Outcome |
Static Private Attributes | |
static constexpr bool | VoidResult = std::is_same_v<ResultType, void> |
Responsible for syncronization between the task and the receiving thread.
|
default |
|
inline |
|
delete |
|
delete |
|
inline |
If the task is pending, cancel it: the status becomes CANCELED and if the task was completed, the result is destroyed.
|
inline |
Move the result away from the shared state, mark the future invalid.
|
inline |
|
inline |
std::condition_variable FutureSharedStateDetail::Receiver< ResultType >::m_ConditionVariable |
std::mutex FutureSharedStateDetail::Receiver< ResultType >::m_Mutex |
std::tuple<ResultHolder<ResultType>, std::exception_ptr> FutureSharedStateDetail::Receiver< ResultType >::m_Outcome |
std::atomic<Status> FutureSharedStateDetail::Receiver< ResultType >::m_Status = Status::PENDING |
|
staticconstexprprivate |