FAutoDeleteAsyncTask

[FAutoDeleteAsyncTask](API\Runtime\Core\Async\FAutoDeleteAsyncTask) - template task for jobs that delete themselves when complete

Windows
MacOS
Linux

Inheritance Hierarchy

IQueuedWork

FAutoDeleteAsyncTask

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Async/AsyncWork.h

Include

#include "Async/AsyncWork.h"

Syntax

template<typename TTask>
class FAutoDeleteAsyncTask : private IQueuedWork

Remarks

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(); }

Constructors

Name Description

Public function

FAutoDeleteAsyncTask

(
    T&&... Args
)

Forwarding constructor.

Functions

Name Description

Public function

void

 

StartBackgroundTask

(
    FQueuedThreadPool* InQueuedPoo...
)

Run this task on the lo priority thread pool. It is not safe to use this object after this call.

Public function

void

 

StartSynchronousTask()

Run this task on this thread, now.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss