Agrarsense
|
#include <TickManager.h>
Static Public Member Functions | |
static FTickEntry | AddTick (UObject *Object, std::function< void(float)> Function, ETickType Type) |
static void | RemoveTick (FTickEntry TickEntry) |
Private Member Functions | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
void | PreTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
void | PostTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
void | FrameCleanup () |
void | TickFunctionsParallel (std::vector< FTickEntry > &functions, const float DeltaTime) |
Static Private Member Functions | |
static void | AddTickInternal (std::vector< FTickEntry > &to, const FTickEntry &newTickEntry) |
static void | RemoveTickInternal (std::vector< FTickEntry > &from, FTickEntry tickEntry) |
Private Attributes | |
FDelegateHandle | OnPreTickDelegate |
FDelegateHandle | OnPostTickDelegate |
FGraphEventRef | FullFrameTaskBeforeLateTick |
FGraphEventRef | FullFrameTask |
Static Private Attributes | |
static ATickManager * | Instance = nullptr |
static std::vector< FTickEntry > | FullFrameTaskFunctions |
static std::vector< FTickEntry > | FullFrameTaskBeforeLateTickFunctions |
static std::vector< FTickEntry > | EarlyTickFunctions |
static std::vector< FTickEntry > | LateTickFunctions |
static std::vector< FTickEntry > | TicksToRemove |
ATickManager is an actor class responsible for ticking of sensor actors (or any added Actor) in parallel. How this works:
– Start of a new frame –
1) OnWorldPreActorTick (PreTick):
2) Regular AActor::Tick occurs.
3) OnWorldPostActorTick (PostTick):
– End of the frame –
Usage (Note: "MyActor::MyFunction" must take a float parameter): FTickEntry entry = ATickManager::AddTick(this, &MyActor::MyFunction, ETickType::FullFrameTaskParallel); ATickManager::RemoveTick(entry);
Definition at line 101 of file TickManager.h.
|
static |
Adds a tick function to the ATickManager.
TickFunction | The tick function to be added. It should take a single float parameter representing DeltaTime. |
Type | The type of tick to which the function should be added. Valid types are:
|
Definition at line 55 of file TickManager.cpp.
References AddTickInternal(), EarlyTickFunctions, FullFrameTaskBeforeLateTickFunctions, FullFrameTaskFunctions, Instance, and LateTickFunctions.
Referenced by ALidarManager::AddRaycastLidar(), ACamera::BeginPlay(), and ATransformSensor::BeginPlay().
|
inlinestaticprivate |
Definition at line 157 of file TickManager.h.
Referenced by AddTick().
|
overrideprivatevirtual |
Definition at line 20 of file TickManager.cpp.
References Destroy, Instance, OnPostTickDelegate, OnPreTickDelegate, PostTick(), and PreTick().
|
overrideprivatevirtual |
Definition at line 38 of file TickManager.cpp.
References EarlyTickFunctions, FullFrameTaskBeforeLateTickFunctions, FullFrameTaskFunctions, Instance, LateTickFunctions, OnPostTickDelegate, OnPreTickDelegate, and TicksToRemove.
|
private |
Definition at line 173 of file TickManager.cpp.
References EarlyTickFunctions, FullFrameTaskBeforeLateTickFunctions, FullFrameTaskFunctions, Instance, LateTickFunctions, RemoveTickInternal(), and TicksToRemove.
Referenced by PostTick().
|
private |
Definition at line 125 of file TickManager.cpp.
References FrameCleanup(), FullFrameTask, FullFrameTaskBeforeLateTick, LateTickFunctions, and TickFunctionsParallel().
Referenced by BeginPlay().
|
private |
Definition at line 96 of file TickManager.cpp.
References EarlyTickFunctions, FullFrameTask, FullFrameTaskBeforeLateTick, FullFrameTaskBeforeLateTickFunctions, FullFrameTaskFunctions, and TickFunctionsParallel().
Referenced by BeginPlay().
|
static |
Removes a tick function from the ATickManager.
TickFunction | The tick function to be removed. It should match the exact function previously added using AddTick. |
Type | The type of tick from which the function should be removed. Valid types are the same as for AddTick:
|
Definition at line 90 of file TickManager.cpp.
References TicksToRemove.
Referenced by ACamera::EndPlay(), ALidarManager::EndPlay(), ATransformSensor::EndPlay(), and ALidarManager::RemoveRaycastLidar().
|
inlinestaticprivate |
Definition at line 175 of file TickManager.h.
Referenced by FrameCleanup().
|
inlineprivate |
Definition at line 148 of file TickManager.cpp.
References FTickEntry::Owner.
Referenced by PostTick(), and PreTick().
|
staticprivate |
Definition at line 153 of file TickManager.h.
Referenced by AddTick(), EndPlay(), FrameCleanup(), and PreTick().
|
private |
Definition at line 148 of file TickManager.h.
Referenced by PostTick(), and PreTick().
|
private |
Definition at line 147 of file TickManager.h.
Referenced by PostTick(), and PreTick().
|
staticprivate |
Definition at line 152 of file TickManager.h.
Referenced by AddTick(), EndPlay(), FrameCleanup(), and PreTick().
|
staticprivate |
Definition at line 151 of file TickManager.h.
Referenced by AddTick(), EndPlay(), FrameCleanup(), and PreTick().
|
staticprivate |
Definition at line 150 of file TickManager.h.
Referenced by AddTick(), BeginPlay(), EndPlay(), and FrameCleanup().
|
staticprivate |
Definition at line 154 of file TickManager.h.
Referenced by AddTick(), EndPlay(), FrameCleanup(), and PostTick().
|
private |
Definition at line 140 of file TickManager.h.
Referenced by BeginPlay(), and EndPlay().
|
private |
Definition at line 137 of file TickManager.h.
Referenced by BeginPlay(), and EndPlay().
|
staticprivate |
Definition at line 155 of file TickManager.h.
Referenced by EndPlay(), FrameCleanup(), and RemoveTick().