ThreadedUIUpdate< CLASSDATA > Class Template Reference

#include <threaded_update_helper.h>

Inheritance diagram for ThreadedUIUpdate< CLASSDATA >:

公共成员函数

virtual  ~ThreadedUIUpdate ()
Result < void >  开始 ( 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   取消 ()
virtual void  Wait ()
virtual Bool   IsRunning ()
-  Public Member Functions inherited from ThreadedUIUpdateBase
virtual  ~ThreadedUIUpdateBase ()

私有成员函数

Bool   CancelI ()

Private Attributes

JobRef   _scanThread
JobRef   _updateJob
TimerRef  _spinningTimer
Bool   _isDone

构造函数 & 析构函数文档编制

◆  ~ThreadedUIUpdate()

~ ThreadedUIUpdate
virtual

成员函数文档编制

◆  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] threadFn Callback with the code which needs to be executed parallel. This is running in a new thread.
[in] timerDelay The timer delay after which startWaitFn is triggered.
[in] waitFirstDelay True 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] startWaitFn Callback which will be triggered if the threadFn takes longer than timerDelay. This is running in the UI Queue .
[in] timerInterval The timer interval that triggers an UI timer update while the thread is running.
[in] timerWaitFn Timer callback to update the UI with progress informations. This is running in the UI Queue .
[in] finalUpdateFunc Finalize callback to update the UI after all is done. This is running in the UI Queue .
返回
OK on success.

◆  Cancel()

Bool 取消
virtual

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 virtual

Implements ThreadedUIUpdateBase .

◆  IsRunning()

Bool IsRunning
virtual

Implements ThreadedUIUpdateBase .

◆  CancelI()

Bool CancelI
private

Member Data Documentation

◆  _scanThread

JobRef _scanThread
private

◆  _updateJob

JobRef _updateJob
private

◆  _spinningTimer

TimerRef _spinningTimer private

◆  _isDone

Bool _isDone
private