MetaSoul

Loading...
Searching...
No Matches
EmoShapeLambdaRunnable.h
Go to the documentation of this file.
1#pragma once
2#include "Engine/Classes/Engine/LatentActionManager.h"
3#include "LatentActions.h"
4#include "Async/TaskGraphInterfaces.h"
5
6 class EMOSHAPESUBSYSTEM_API FEmoShapeLatentAction : public FPendingLatentAction
7{
8 public:
9 TFunction<void()> OnCancelNotification = nullptr;
10
12 static FEmoShapeLatentAction* CreateLatentAction(struct FLatentActionInfo& LatentInfo, UObject* WorldContext);
13
14 FEmoShapeLatentAction(const FLatentActionInfo& LatentInfo);
15
16 virtual void UpdateOperation(FLatentResponse& Response) override;
17
18 void Call();
19 void Cancel();
20
21 virtual void NotifyObjectDestroyed() override;
22 virtual void NotifyActionAborted() override;
23
24#if WITH_EDITOR
25 virtual FString GetDescription() const override;
26#endif
27
28 const FName ExecutionFunction;
29 const int32 OutputLink;
30 const FWeakObjectPtr CallbackTarget;
31
32 private:
33 bool Called;
34};
35
39 class EMOSHAPESUBSYSTEM_API FEmoShapeLambdaRunnable
40{
41 public:
42
46 static void RunLambdaOnBackGroundThread(TFunction< void()> InFunction);
47
51 static void RunLambdaOnBackGroundThreadPool(TFunction< void()> InFunction);
52
56 static FGraphEventRef RunShortLambdaOnGameThread(TFunction< void()> InFunction);
57
61 static FGraphEventRef RunShortLambdaOnBackGroundTask(TFunction< void()> InFunction);
62
67 static void SetTimeout(TFunction<void()>OnDone, float DurationInSec, bool bCallbackOnGameThread = true);
68
69};
FEmoShapeLambdaRunnable
Definition EmoShapeLambdaRunnable.h:40
FEmoShapeLatentAction
Definition EmoShapeLambdaRunnable.h:7
FEmoShapeLatentAction::CallbackTarget
const FWeakObjectPtr CallbackTarget
Definition EmoShapeLambdaRunnable.h:30
FEmoShapeLatentAction::ExecutionFunction
const FName ExecutionFunction
Definition EmoShapeLambdaRunnable.h:28
FEmoShapeLatentAction::OutputLink
const int32 OutputLink
Definition EmoShapeLambdaRunnable.h:29