ThreadedUIUpdate< CLASSDATA > Class Template Reference

#include <threaded_update_helper.h>

Inheritance diagram for ThreadedUIUpdate< CLASSDATA >:

Public Member Functions

virtual ~ThreadedUIUpdate ()
Result< void > Start (Delegate< Result< void >(CLASSDATA *self)> &&threadFn, const TimeValue &timerDelay, Bool waitFirstDelay, Delegate< Result< void >(CLASSDATA *self)> &&startWaitFn, const TimeValue &timerInterval, Delegate< void(CLASSDATA *self)> &&timerWaitFn, Delegate< Result< void >(CLASSDATA *self, Error threadError)> &&finalUpdateFunc)
virtual Bool Cancel ()
virtual void Wait ()
virtual Bool IsRunning ()
- Public Member Functions inherited from ThreadedUIUpdateBase
virtual ~ThreadedUIUpdateBase ()

Private Member Functions

Bool CancelI ()

Private Attributes

JobRef _scanThread
JobRef _updateJob
TimerRef _spinningTimer
Bool _isDone

Constructor & Destructor Documentation

◆ ~ThreadedUIUpdate()


Member Function Documentation

◆ Start()

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

Starts a threaded UI update with a given delay and timer update. The function starts the threaded execution immediately, after timerDelay a timer is started to update the ui with a progress update.

[in]threadFnCallback with the code which needs to be executed parallel. This is running in a new thread.
[in]timerDelayThe timer delay after which startWaitFn is triggered.
[in]waitFirstDelayTrue if the function should wait until the first timerDelay is reached. This leads to a wait time in this function. False to do it completely async. A one-shot timer will be used to trigger the first timerDelay. This is the most efficient way.
[in]startWaitFnCallback which will be triggered if the threadFn takes longer than timerDelay. This is running in the UI Queue.
[in]timerIntervalThe timer interval that triggers an UI timer update while the thread is running.
[in]timerWaitFnTimer callback to update the UI with progress informations. This is running in the UI Queue.
[in]finalUpdateFuncFinalize callback to update the UI after all is done. This is running in the UI Queue.
OK on success.

◆ Cancel()

Bool Cancel

Cancel the job.

True if it is still running, in this case a new object needs to be created! False if the thread is unused.

Implements ThreadedUIUpdateBase.

◆ Wait()

void Wait

Implements ThreadedUIUpdateBase.

◆ IsRunning()

Bool IsRunning

Implements ThreadedUIUpdateBase.

◆ CancelI()

Bool CancelI

Member Data Documentation

◆ _scanThread

JobRef _scanThread

◆ _updateJob

JobRef _updateJob

◆ _spinningTimer

TimerRef _spinningTimer

◆ _isDone

Bool _isDone