engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FAutoDeleteAsyncTask< TTask > 模板类 参考

#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. 更多...
 

详细描述

template<typename TTask>
class FAutoDeleteAsyncTask< TTask >
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(); }

成员函数说明

◆ StartBackgroundTask()

template<typename TTask >
void FAutoDeleteAsyncTask< TTask >::StartBackgroundTask ( FQueuedThreadPool *  InQueuedPool = GThreadPool)
inline

Run this task on the lo priority thread pool.

It is not safe to use this object after this call.

◆ StartSynchronousTask()

template<typename TTask >
void FAutoDeleteAsyncTask< TTask >::StartSynchronousTask ( )
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.


该类的文档由以下文件生成: