#include <AsyncWork.h>
类 FAutoDeleteAsyncTask< TTask > 继承关系图:Public 成员函数 | |
| template<typename... T> | |
| FAutoDeleteAsyncTask (T &&... Args) | |
| Forwarding constructor. | |
| void | StartBackgroundTask (FQueuedThreadPool *InQueuedPool=GThreadPool) |
| Run this task on the lo priority thread pool. 更多... | |
| void | StartSynchronousTask () |
| Run this task on this thread, now. 更多... | |
FAutoDeleteAsyncTask - template task for jobs that delete themselves when complete
Sample code:
class ExampleAutoDeleteAsyncTask : public FNonAbandonableTask
{
friend class FAutoDeleteAsyncTask<ExampleAutoDeleteAsyncTask>;
int32 ExampleData;
ExampleAutoDeleteAsyncTask(int32 InExampleData)
: ExampleData(InExampleData)
{
}
void DoWork()
{
... do the work here
}
FORCEINLINE TStatId GetStatId() const
{
RETURN_QUICK_DECLARE_CYCLE_STAT(ExampleAutoDeleteAsyncTask, STATGROUP_ThreadPoolAsyncTasks);
}
};
void Example()
{
start an example job (new FAutoDeleteAsyncTask<ExampleAutoDeleteAsyncTask>(5)->StartBackgroundTask();
do an example job now, on this thread (new FAutoDeleteAsyncTask<ExampleAutoDeleteAsyncTask>(5)->StartSynchronousTask(); }
|
inline |
Run this task on the lo priority thread pool.
It is not safe to use this object after this call.
|
inline |
Run this task on this thread, now.
Will end up destroying myself, so it is not safe to use this object after this call.