Promise< T > Class Template Reference

#include <job.h>

Inheritance diagram for Promise< T >:

Detailed Description

template<typename T>
class maxon::Promise< T >

A rudimentary promise.

Public Member Functions

Result< void > operator() ()
 
- Public Member Functions inherited from JobResultInterface< T >
Result< T > GetResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT) const
 
Result< T > MoveResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT)
 
- Public Member Functions inherited from JobInterface
JOBOPTIONFLAGS GetJobOptions () const
 
const CharGetName () const
 
 JobInterface (const JobInterfaceJumpTablePOD &jmpTable)
 
 ~JobInterface ()
 
 JobInterface (JobInterface &&src)
 
JobInterfaceoperator= (JobInterface &&src)
 
Bool Wait (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT) const
 
Result< void > GetResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT) const
 
Result< void > MoveResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT)
 
void Cancel ()
 
Bool IsCancelled () const
 
void CancelAndWait (WAITMODE mode=WAITMODE::DEFAULT)
 
JobInterfaceEnqueue (JobQueueInterface *queue=JOBQUEUE_CURRENT)
 
Result< void > AddSubJob (JobInterface *subJob)
 
template<typename JOB >
Result< void > AddSubJob (ResultMemT< JOB * > subJob)
 
template<typename JOBREF >
Result< void > AddSubJob (ResultMemT< JOBREF > &&subJob)
 
template<typename GROUP >
Result< void > AddSubGroup (GROUP *subGroup)
 
template<typename GROUP >
Result< void > AddSubGroup (ResultMemT< GROUP * > subGroup)
 
template<typename GROUP >
Result< void > AddSubGroup (ResultMemT< GROUP > subGroup)
 
JobGroupInterfaceGetJobGroup () const
 
ObservableFinishedBase< JobInterfaceObservableFinished ()
 
ObservableCancelledBase< JobInterfaceObservableCancelled ()
 
String ToString (const FormatStatement *formatStatement=nullptr) const
 

Static Public Member Functions

static ResultMemT< PromiseRef< T > > Create ()
 
- Static Public Member Functions inherited from JobInterfaceTemplate< Promise< T >, T >
static ResultMemT< JobResultRef< T > > Create (ARGS &&... args)
 
- Static Public Member Functions inherited from JobInterface
static Int GetCurrentWorkerThreadIndex ()
 
static Int GetCurrentThreadCount ()
 
static Bool IsCurrentJobCancelled (const JobInterface *optionalJob=nullptr)
 
static JobStatusInterfaceGetCurrentJob ()
 

Protected Member Functions

void MoveValue (T &&value)
 
- Protected Member Functions inherited from JobResultInterface< T >
ResultOk< void > SetResult (T &&value)
 
Result< void > Invoke (FN &&obj, ARGS &&... args)
 

Friends

template<typename >
class PromiseRef
 

Member Function Documentation

◆ Create()

static ResultMemT<PromiseRef<T> > Create ( )
static

Creates a promise and returns.

◆ operator()()

Result<void> operator() ( )

◆ MoveValue()

void MoveValue ( T &&  value)
protected

Move assigns the promise value.

Friends And Related Function Documentation

◆ PromiseRef

friend class PromiseRef
friend