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

Description:

A simple encapsulated promise.

Definition at line 147 of file jobs.inl.

Inheritance diagram for alib::threadmodel::JPromise:
[legend]
Collaboration diagram for alib::threadmodel::JPromise:
[legend]

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. Sets the state to State::Unfulfilled.
 
 ~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 152 of file jobs.inl.

Here is the call graph for this function:

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 164 of file jobs.inl.

Here is the call graph for this function:

◆ 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 159 of file jobs.inl.

Here is the call graph for this function:

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