ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::threadmodel::JPromise Struct Reference

Description:

A simple encapsulated promise.

Definition at line 144 of file jobs.inl.

Inheritance diagram for alib::threadmodel::JPromise:
alib::threadmodel::Job alib::threads::Promise

Public Method Index:

 JPromise (const std::type_info &id)
virtual ~JPromise () override=default
 Virtual destructor.
virtual void PrepareDeferredDeletion () override
virtual size_t SizeOf () override
Public Method Index: inherited from alib::threadmodel::Job
 Job (const std::type_info &id)
virtual ~Job ()=default
 Protected destructor.
template<typename TJob>
TJob & Cast ()
virtual bool Do ()
template<typename TOther>
bool Is ()
template<typename TOther>
bool IsNull ()
Public Method Index: inherited from alib::threads::Promise
 Promise ()
 Default constructor.
 ~Promise ()
 Destructor.
void DbgOmitDestructionWarning ()
void Fulfill (const CallerInfo &ci, State state=State::OK)
State Wait (const CallerInfo &ci)
State WaitFor (const Ticks::Duration &maxWaitTimeSpan, const CallerInfo &ci)
State WaitFor (const Ticks::Duration::TDuration &maxWaitTimeSpan, const CallerInfo &ci)
State WaitUntil (const Ticks &wakeUpTime, const CallerInfo &ci)

Additional Inherited Members

Public Type Index: inherited from alib::threads::Promise
enum class  State {
  Unfulfilled , OK , Error , EmergencyStop ,
  Custom
}
Public Field Index: inherited from alib::threadmodel::Job
const std::type_info & ID
Public Field Index: inherited from alib::threads::Promise
lang::CallerInfo DbgFulfillCI
lang::CallerInfo DbgWaitCI
Ticks::Duration DbgWaitTimeLimit = Ticks::Duration::FromAbsoluteSeconds(2)
Protected Field Index: inherited from alib::threads::Promise
std::future< Statefuture
 Used for implementation.
std::promise< Statepromise
 Used for implementation.

Constructor(s) / Destructor Details:

◆ JPromise()

alib::threadmodel::JPromise::JPromise ( const std::type_info & id)
inline

Constructor.

Parameters
idThe type-info of the derived type. Passed to parent class Job.

Definition at line 149 of file jobs.inl.

Method Details:

◆ PrepareDeferredDeletion()

virtual void alib::threadmodel::JPromise::PrepareDeferredDeletion ( )
inlineoverridevirtual

Overrides the parent function only with debug-compilations. Avoids warnings about destroying unused promise

Reimplemented from alib::threadmodel::Job.

Definition at line 161 of file jobs.inl.

◆ SizeOf()

virtual size_t alib::threadmodel::JPromise::SizeOf ( )
inlineoverridevirtual

Overrides the parent function as necessary.

Returns
The sizeof this derived type.

Reimplemented from alib::threadmodel::Job.

Definition at line 156 of file jobs.inl.


The documentation for this struct was generated from the following file: