![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AsyncWork.h>
Inheritance diagram for FAutoDeleteAsyncTask< TTask >:Public Member Functions | |
| template<typename... T> | |
| FAutoDeleteAsyncTask (T &&... Args) | |
| void | StartSynchronousTask () |
| void | StartBackgroundTask (FQueuedThreadPool *InQueuedPool=GThreadPool, EQueuedWorkPriority InPriority=EQueuedWorkPriority::Normal) |
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(); }
|
inlineexplicit |
Forwarding constructor.
|
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.