Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Async
Inheritance Hierarchy
- FInheritedContextBase
- 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 UE::FInheritedContextBase ,
private IQueuedWork
Remarks
FAutoDeleteAsyncTask - template task for jobs that delete themselves when complete
Sample code:
class ExampleAutoDeleteAsyncTask : public FNonAbandonableTask
{
friend class FAutoDeleteAsyncTask
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
/ do an example job now, on this thread (new FAutoDeleteAsyncTask
Constructors
| Type | Name | Description | |
|---|---|---|---|
FAutoDeleteAsyncTask
(
T&&... Args |
Forwarding constructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | StartBackgroundTask
(
FQueuedThreadPool* InQueuedPool, |
Run this task on the lo priority thread pool. It is not safe to use this object after this call. | |
| void | Run this task on this thread, now. |