JobResultRef< RESULTVALUETYPE > Class Template Reference 线程

#include <job.h>

详细描述

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

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

公共成员函数

  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 )

成员函数文档编制

◆  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.

参数
[in] timeout Maximum wait interval (or TIMEVALUE_INFINITE for no time-out).
[in] mode WAITMODE::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.
返回
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.

注意
You may only use MoveResult() if you can ensure that nobody else will ask for the result of the job. THREADSAFE.
参数
[in] timeout Maximum wait interval (or TIMEVALUE_INFINITE for no time-out).
[in] mode WAITMODE::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.
返回
Result value on success.