Navigation
API > API/Plugins > API/Plugins/PCG
A PCG context with helper utility to enable element authors to more easily implement timeslicing.
| Name | TPCGTimeSlicedContext |
| Type | struct |
| Header File | /Engine/Plugins/PCG/Source/PCG/Public/Elements/PCGTimeSlicedElementBase.h |
| Include Path | #include "Elements/PCGTimeSlicedElementBase.h" |
Syntax
template<typename PerExecutionStateT, typename PerIterationStateT, typename BaseContext>
struct TPCGTimeSlicedContext : public FPCGContext
Inheritance Hierarchy
- FPCGContext → TPCGTimeSlicedContext
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InitExecSignature | EPCGTimeSliceInitResult(TPCGTimeSlicedContext *Context, PerExecutionStateT &OutState) | Elements/PCGTimeSlicedElementBase.h | |
| InitIterSignature | EPCGTimeSliceInitResult(PerIterationStateT &OutState, const PerExecutionStateT &ExecState, const uint32 IterationIndex) | Elements/PCGTimeSlicedElementBase.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bPerIterationStateIsInitialized | bool | True if an attempt has been made to initialize the per iteration states | Elements/PCGTimeSlicedElementBase.h | |
| bTimeSliceIsEnabled | bool | True if time slicing is enabled for this context | Elements/PCGTimeSlicedElementBase.h | |
| ExecutionCount | uint32 | The number of times this context has been time sliced | Elements/PCGTimeSlicedElementBase.h | |
| ExecutionStateResult | EPCGTimeSliceInitResult | The result of initializing the per execution state | Elements/PCGTimeSlicedElementBase.h | |
| IterationIndex | int32 | The index of which iteration being processed. | Elements/PCGTimeSlicedElementBase.h | |
| PerExecutionStateData | PerExecutionStateT | The state of the timesliced context that won't change each iteration. Ie. the node settings. | Elements/PCGTimeSlicedElementBase.h | |
| PerIterationStateArray | TArray< PerIterationStateT > | An array of the various states of timesliced context that will change per iteration. | Elements/PCGTimeSlicedElementBase.h | |
| PerIterationStateResultArray | TArray< EPCGTimeSliceInitResult > | Tracks the results of each attempt to initialize an iteration state | Elements/PCGTimeSlicedElementBase.h | |
| TrackedObjectArray | TArray< TObjectPtr< const UObject > > | Tracks rooted UObjects that need to avoid garbage collection during the lifetime of the context | Elements/PCGTimeSlicedElementBase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool DataIsPreparedForExecution () |
Returns true if both the execution state and iteration state were fully initialized and no problems arose that should abort the execution. | Elements/PCGTimeSlicedElementBase.h | |
uint32 GetExecutionCount() |
Retrieves the number of times this context was executed | Elements/PCGTimeSlicedElementBase.h | |
EPCGTimeSliceInitResult GetExecutionStateResult() |
Will return the result of the attempt to initialize the per execution state | Elements/PCGTimeSlicedElementBase.h | |
EPCGTimeSliceInitResult GetIterationStateResult
(
const int32 Index |
Will return the result of the attempt to initialize a specific iteration, by Index | Elements/PCGTimeSlicedElementBase.h | |
PerExecutionStateT & GetPerExecutionState () |
Elements/PCGTimeSlicedElementBase.h | ||
const PerExecutionStateT & GetPerExecutionState () |
Elements/PCGTimeSlicedElementBase.h | ||
TArray< PerIterationStateT > & GetPerIterationStateArray () |
Elements/PCGTimeSlicedElementBase.h | ||
const TArray< PerIterationStateT > & GetPerIterationStateArray () |
Elements/PCGTimeSlicedElementBase.h | ||
const TArray< EPCGTimeSliceInitResult > & GetPerIterationStateInitResultArray() |
Elements/PCGTimeSlicedElementBase.h | ||
EPCGTimeSliceInitResult InitializePerExecutionState
(
TFunctionRef< InitExecSignature > InitFunc |
Initializes per execution state data if required. | Elements/PCGTimeSlicedElementBase.h | |
const TArray< EPCGTimeSliceInitResult > & InitializePerIterationStates
(
int32 NumIterations, |
Initializes per execution state data if required. | Elements/PCGTimeSlicedElementBase.h | |
void SetTimeSliceIsEnabled
(
const bool bEnableTimeSlice |
Elements/PCGTimeSlicedElementBase.h | ||
void TrackObject
(
const UObject* Object |
Fire and forget function to make sure a UObject will not be GC'ed for the duration of the Context. | Elements/PCGTimeSlicedElementBase.h |
Overridden from FPCGContext
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool TimeSliceIsEnabled() |
Time slicing is not enabled by default. | Elements/PCGTimeSlicedElementBase.h |
Protected
Overridden from FPCGContext
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddExtraStructReferencedObjects
(
FReferenceCollector& Collector |
Elements/PCGTimeSlicedElementBase.h |