ThreadedUIUpdateRef< T > Class Template Reference

#include <threaded_update_helper.h>

Detailed Description

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

Helper class to create threaded UI updates with a single call.

struct TexGuiThreadUpdate : public maxon::ThreadedUIUpdate<TexGuiThreadUpdate>
{
};
_texGuiThreadedPtr.Start(
[](TexGuiThreadUpdate* self) -> maxon::Result<void>
{
// worker thread, non-UI thread!!!
//...
return OK;
},
maxon::Milliseconds(100.0), false,
[this](TexGuiThreadUpdate* self) -> maxon::Result<void>
{
// first delay, UI thread!!!
return maxon::OK;
},
[this](TexGuiThreadUpdate* self) -> void
{
// progress timer, UI thread!!!
},
[this](TexGuiThreadUpdate* self, maxon::Error threadError) -> maxon::Result<void>
{
// progress timer, UI thread!!!
if (threadError)
{
}
else
{
}
return maxon::OK;
}
Timer value in milliseconds.
Definition: timevalue.h:422
Definition: threaded_update_helper.h:27
Definition: threaded_update_helper.h:115
Result< void > Start(Delegate< Result< void >(T *self)> &&threadFn, const TimeValue &timerDelay, Bool waitFirstDelay, Delegate< Result< void >(T *self)> &&startWaitFn, const TimeValue &timerInterval, Delegate< void(T *self)> &&timerWaitFn, Delegate< Result< void >(T *self, Error threadError)> &&finalUpdateFunc)
Definition: threaded_update_helper.h:118
return OK
Definition: apibase.h:2690
#define iferr_scope
Definition: resultbase.h:1384
#define iferr_return
Definition: resultbase.h:1519
Template Parameters
Ttype that needs to be declared like: struct TexGuiThreadUpdate : public maxon::ThreadedUIUpdate<TexGuiThreadUpdate> {};

Public Member Functions

Result< void > Start (Delegate< Result< void >(T *self)> &&threadFn, const TimeValue &timerDelay, Bool waitFirstDelay, Delegate< Result< void >(T *self)> &&startWaitFn, const TimeValue &timerInterval, Delegate< void(T *self)> &&timerWaitFn, Delegate< Result< void >(T *self, Error threadError)> &&finalUpdateFunc)
 
void Free ()
 
StrongRef< T > GetRef ()
 

Private Attributes

StrongRef< T > _ref
 

Member Function Documentation

◆ Start()

Result<void> Start ( Delegate< Result< void >(T *self)> &&  threadFn,
const TimeValue timerDelay,
Bool  waitFirstDelay,
Delegate< Result< void >(T *self)> &&  startWaitFn,
const TimeValue timerInterval,
Delegate< void(T *self)> &&  timerWaitFn,
Delegate< Result< void >(T *self, Error threadError)> &&  finalUpdateFunc 
)

◆ Free()

void Free ( )

◆ GetRef()

StrongRef<T> GetRef ( )

Member Data Documentation

◆ _ref

StrongRef<T> _ref
private