Choose your operating system:
Windows
macOS
Linux
| IQueuedWork
|
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Async/AsyncWork.h |
Include |
#include "Async/AsyncWork.h" |
template<typename TTask>
class FAutoDeleteAsyncTask : private IQueuedWork
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); } };
/ do an example job now, on this thread (new FAutoDeleteAsyncTask<ExampleAutoDeleteAsyncTask>(5)->StartSynchronousTask(); }
Name | Description | |
---|---|---|
|
FAutoDeleteAsyncTask ( |
Forwarding constructor. |
Name | Description | ||
---|---|---|---|
|
StartBackgroundTask ( |
Run this task on the lo priority thread pool. It is not safe to use this object after this call. |
|
|
StartSynchronousTask() |
Run this task on this thread, now. |