JobResultRef< RESULTVALUETYPE > Class Template Reference

#include <job.h>

Detailed Description

template<typename RESULTVALUETYPE>
class maxon::JobResultRef< RESULTVALUETYPE >

Reference to a job that returns more than void/Result<void>.

Public Member Functions

 MAXON_DEFAULT_REFERENCE_CONSTRUCTORS (JobResultRef, JobRef)
 
Result< RESULTVALUETYPE > GetResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT) const
 
Result< RESULTVALUETYPE > MoveResult (TimeValue timeout=TIMEVALUE_INFINITE, WAITMODE mode=WAITMODE::DEFAULT)
 

Member Function Documentation

◆ MAXON_DEFAULT_REFERENCE_CONSTRUCTORS()

MAXON_DEFAULT_REFERENCE_CONSTRUCTORS ( JobResultRef< RESULTVALUETYPE >  ,
JobRef   
)

◆ GetResult()

Result<RESULTVALUETYPE> GetResult ( TimeValue  timeout = TIMEVALUE_INFINITE,
WAITMODE  mode = WAITMODE::DEFAULT 
) const

Waits until this job has been executed and returns the result. THREADSAFE.

Parameters
[in]timeoutMaximum wait interval (or TIMEVALUE_INFINITE for no time-out).
[in]modeWAITMODE::DEFAULT by default. WAITMODE::RETURN_ON_CANCEL means that Wait() will return if the caller has been cancelled even if the condition has not been set yet.
Returns
Result value on success.

◆ MoveResult()

Result<RESULTVALUETYPE> MoveResult ( TimeValue  timeout = TIMEVALUE_INFINITE,
WAITMODE  mode = WAITMODE::DEFAULT 
)

Waits until this job has been executed and returns the result via std::move.

Note
You may only use MoveResult() if you can ensure that nobody else will ask for the result of the job. THREADSAFE.
Parameters
[in]timeoutMaximum wait interval (or TIMEVALUE_INFINITE for no time-out).
[in]modeWAITMODE::DEFAULT by default. WAITMODE::RETURN_ON_CANCEL means that Wait() will return if the caller has been cancelled even if the condition has not been set yet.
Returns
Result value on success.