ThreadResultRef< RESULTVALUETYPE > Class Template Reference

#include <thread.h>

Detailed Description

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

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

Public Member Functions

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

Constructor & Destructor Documentation

◆ ThreadResultRef() [1/2]

ThreadResultRef ( const ThreadRef src)
explicit

◆ ThreadResultRef() [2/2]

ThreadResultRef ( ThreadRef &&  src)
explicit

Member Function Documentation

◆ GetResult()

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

Waits until this thread 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
OK on success.