61 const std::type_info&
ID;
65 Job(
const std::type_info&
id )
102 template<
typename TOther>
103 bool Is() {
return ID ==
typeid(TOther); }
108 template<
typename TOther>
118 template<
typename TJob>
124 " Requested type: <{}>", &
ID, &
typeid(TJob) )
126 auto* result=
dynamic_cast<TJob*
>(
this);
129 "Job casting failed.\n"
131 " Requested type: <{}>", &
ID, &
typeid(TJob) )
142 virtual bool Do() {
return false; }
void DbgOmitDestructionWarning()
Promise()
Default constructor. Sets the state to State::Unfulfilled.
#define ALIB_ASSERT_ERROR(cond, domain,...)
Priority
Possible priorities of jobs assigned to an DedicatedWorker.
@ DeferredDeletion
As the name indicates.
@ Low
As the name indicates.
@ Highest
As the name indicates.
@ High
As the name indicates.
@ Lowest
As the name indicates.
@ Standard
As the name indicates.
threadmodel::JPromise JPromise
Type alias in namespace alib.
threadmodel::Job Job
Type alias in namespace alib.
A simple encapsulated promise.
virtual ~JPromise() override=default
Virtual destructor.
virtual size_t SizeOf() override
virtual void PrepareDeferredDeletion() override
JPromise(const std::type_info &id)
virtual void PrepareDeferredDeletion()
const std::type_info & ID
Job(const std::type_info &id)
virtual ~Job()=default
Protected destructor.