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

Description:

A simple encapsulated promise.

Definition at line 163 of file jobs.hpp.

#include <jobs.hpp>

Inheritance diagram for JPromise:
[legend]
Collaboration diagram for 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 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 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 (ALIB_DBG_TAKE_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 Promise
enum class  State {
  Unfulfilled , OK , Error , EmergencyStop ,
  Custom
}
 
- Public Field Index: inherited from Job
const std::type_info & ID
 
- Public Field Index: inherited from Promise
lang::CallerInfo DbgFulfillCI
 
lang::CallerInfo DbgWaitCI
 
Ticks::Duration DbgWaitTimeLimit = Ticks::Duration::FromAbsoluteSeconds(2)
 
- Protected Field Index: inherited from Promise
std::future< Statefuture
 Used for implementation.
 
std::promise< Statepromise
 Used for implementation.
 

Constructor(s) / Destructor Details:

◆ 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 168 of file jobs.hpp.

Method Details:

◆ PrepareDeferredDeletion()

virtual void PrepareDeferredDeletion ( )
inlineoverridevirtual

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

Reimplemented from Job.

Definition at line 180 of file jobs.hpp.

Here is the call graph for this function:

◆ SizeOf()

virtual size_t SizeOf ( )
inlineoverridevirtual

Overrides the parent function as necessary.

Returns
The sizeof this derived type.

Reimplemented from Job.

Definition at line 175 of file jobs.hpp.


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