#include <ComposableCameraRuntimeDataBlock.h>
Flat, contiguous memory block that holds all pin output values, exposed parameter values, internal variable values, and per-instance input pin default values for a single camera instance at runtime.
The layout is computed once from the camera type asset's pin declarations, connections, exposed parameters, internal variables, and per-instance pin overrides. All access is offset-based for performance.
Memory layout: [Output pin slots][Exposed parameter slots][Per-instance default slots][Internal variable slots]
Each slot is aligned to the type's natural alignment. The per-instance default slots mirror the authoring-layer FComposableCameraPinOverride::DefaultValueOverride values (see Nodes/ComposableCameraNodePinTypes.h) pre-parsed into typed bytes so the per-frame resolution path in TryResolveInputPin is a pure pointer lookup — no string parsing on the hot path.
Public Attributes¶
| Return | Name | Description |
|---|---|---|
TArray< uint8 > |
Storage |
Raw storage buffer. Allocated once during camera instantiation. POD pin values live here at real byte offsets; non-POD struct values live in StructSlots below at synthetic offsets >= StructSlotsOffsetBase. |
TArray< FInstancedStruct > |
StructSlots |
Typed storage for non-POD struct slots (ExposedParameter / ExposedVariable / InternalVariable / OutputPin / DefaultValue per-instance override of a USTRUCT containing FString / FText / TArray / TMap / TSet / object refs / delegates – anything IsBytewiseSafeStruct rejects). |
TMap< FComposableCameraPinKey, int32 > |
OutputPinOffsets |
Lookup: (NodeIndex, PinName) for OUTPUT pins → byte offset in Storage. |
TMap< FName, int32 > |
ExposedParameterOffsets |
Lookup: ExposedParameterName → byte offset in Storage. |
TMap< FName, int32 > |
InternalVariableOffsets |
Lookup: InternalVariableName → byte offset in Storage. |
TMap< int32, TObjectPtr< AActor > > |
ActorReferenceSlots |
Object-reference slots mirrored from raw storage for explicit GC collection. |
TMap< int32, TObjectPtr< UObject > > |
ObjectReferenceSlots |
Object-reference slots mirrored from raw storage for explicit GC collection. |
TMap< FComposableCameraPinKey, int32 > |
InputPinSourceOffsets |
Connection table: for each input pin, the offset of its source data. Key = (TargetNodeIndex, TargetPinName), Value = offset in Storage where the source output pin wrote its data. |
TMap< FComposableCameraPinKey, int32 > |
ExposedInputPinOffsets |
Exposure table: for each exposed input pin, the offset of the parameter slot. Key = (TargetNodeIndex, TargetPinName), Value = offset of the exposed parameter in Storage. |
TMap< FComposableCameraPinKey, int32 > |
DefaultValueOffsets |
Per-instance default-value table: for each input pin that has an authored FComposableCameraPinOverride::DefaultValueOverride (see Nodes/ComposableCameraNodePinTypes.h), the offset of the slot holding the pre-parsed typed bytes. Key = (TargetNodeIndex, PinName), Value = offset in Storage. |
int32 |
TotalSize |
Total allocated size. |
Storage¶
TArray< uint8 > Storage
Raw storage buffer. Allocated once during camera instantiation. POD pin values live here at real byte offsets; non-POD struct values live in StructSlots below at synthetic offsets >= StructSlotsOffsetBase.
StructSlots¶
TArray< FInstancedStruct > StructSlots
Typed storage for non-POD struct slots (ExposedParameter / ExposedVariable / InternalVariable / OutputPin / DefaultValue per-instance override of a USTRUCT containing FString / FText / TArray / TMap / TSet / object refs / delegates – anything IsBytewiseSafeStruct rejects).
Each entry is owned (proper ctor / dtor) and GC-walked via AddPropertyReferencesWithStructARO in AddReferencedObjects. The various offset tables below (OutputPinOffsets, ExposedParameterOffsets, etc.) store synthetic offsets >= StructSlotsOffsetBase for non-POD struct entries; the dispatch in ReadValue / WriteValue / TryResolveInputPin detects this and routes to StructSlots[Offset - StructSlotsOffsetBase] instead of memcpying out of Storage.
Activation-time: BuildRuntimeDataLayout pre-allocates one slot per non-POD struct entry via InitializeAs(StructType). Per-frame copy-in (ApplyParameterBlock, WriteOutputPin, CopySlot) reuses the slot's existing memory via CopyScriptStruct – bounded one-time alloc when embedded FString members grow, no alloc when they fit existing capacity.
OutputPinOffsets¶
TMap< FComposableCameraPinKey, int32 > OutputPinOffsets
Lookup: (NodeIndex, PinName) for OUTPUT pins → byte offset in Storage.
ExposedParameterOffsets¶
TMap< FName, int32 > ExposedParameterOffsets
Lookup: ExposedParameterName → byte offset in Storage.
InternalVariableOffsets¶
TMap< FName, int32 > InternalVariableOffsets
Lookup: InternalVariableName → byte offset in Storage.
ActorReferenceSlots¶
TMap< int32, TObjectPtr< AActor > > ActorReferenceSlots
Object-reference slots mirrored from raw storage for explicit GC collection.
ObjectReferenceSlots¶
TMap< int32, TObjectPtr< UObject > > ObjectReferenceSlots
Object-reference slots mirrored from raw storage for explicit GC collection.
InputPinSourceOffsets¶
TMap< FComposableCameraPinKey, int32 > InputPinSourceOffsets
Connection table: for each input pin, the offset of its source data. Key = (TargetNodeIndex, TargetPinName), Value = offset in Storage where the source output pin wrote its data.
ExposedInputPinOffsets¶
TMap< FComposableCameraPinKey, int32 > ExposedInputPinOffsets
Exposure table: for each exposed input pin, the offset of the parameter slot. Key = (TargetNodeIndex, TargetPinName), Value = offset of the exposed parameter in Storage.
DefaultValueOffsets¶
TMap< FComposableCameraPinKey, int32 > DefaultValueOffsets
Per-instance default-value table: for each input pin that has an authored FComposableCameraPinOverride::DefaultValueOverride (see Nodes/ComposableCameraNodePinTypes.h), the offset of the slot holding the pre-parsed typed bytes. Key = (TargetNodeIndex, PinName), Value = offset in Storage.
This is ranked below InputPinSourceOffsets (wired) and ExposedInputPinOffsets (exposed-as-parameter) by TryResolveInputPin. It exists so that per-frame default resolution is a pointer-lookup / memcpy instead of a string-parse, honoring the "no hot-path allocations" rule.
Pins without an authored override are simply absent from this map; their default is resolved by the node's own class-level fallback (e.g. a UPROPERTY on the node template) when TryResolveInputPin returns false.
TotalSize¶
int32 TotalSize = 0
Total allocated size.
Public Methods¶
| Return | Name | Description |
|---|---|---|
bool |
IsStructSlotOffset const inline |
True if Offset addresses a non-POD struct slot in StructSlots. |
int32 |
GetStructSlotIndex const inline |
Convert a synthetic offset to its StructSlots index. |
int32 |
RegisterStructSlot inline |
Reserve a fresh struct slot pre-initialized for StructType, returning the synthetic offset that should be stored in the relevant offset table (ExposedParameterOffsets / OutputPinOffsets / etc.). Called once per non-POD struct entry by BuildRuntimeDataLayout. |
T |
ReadValue const inline |
Read a typed value from the storage at the given byte offset. POD path: memcpy out of Storage. Non-POD struct path (T is a USTRUCT and Offset >= StructSlotsOffsetBase): CopyScriptStruct out of the typed slot in StructSlots. |
void |
WriteValue inline |
Write a typed value to the storage at the given byte offset. POD path: memcpy into Storage. Non-POD struct path: CopyScriptStruct into the existing struct slot's owned memory – no allocation unless an embedded FString grows beyond its existing capacity (see TechDoc.md §7.2 alloc characteristic). |
T |
ReadOutputPin const inline |
Read a value for a specific output pin. |
void |
WriteOutputPin inline |
Write a value for a specific output pin. |
bool |
TryResolveInputPin const inline |
Resolve an input pin's value. Checks in order: |
bool |
ResolveInputPinOffset const inline |
Resolve an input pin to its source slot offset using the same three-tier priority as TryResolveInputPin (wired -> exposed -> per-instance default), but without copying the value out – useful for non-templated paths (auto-resolve Struct case, struct subobject pin dispatch) that need to decide between byte storage and FInstancedStruct slot at runtime. Returns true and writes OutOffset when a slot is found. |
T |
ReadInternalVariable const inline |
Read an internal variable by name. |
void |
WriteInternalVariable inline |
Write an internal variable by name. |
bool |
HasInternalVariable const inline |
Check if a specific internal variable exists. |
void |
CopySlot inline |
Copy raw bytes from one slot to another within the same storage. Used by the exec-chain SetVariable dispatch to transfer a source node's output pin value into an internal variable slot without knowing the concrete C++ type at compile time. |
const FInstancedStruct & |
GetStructSlotChecked const inline |
Direct access to the FInstancedStruct backing a non-POD struct slot. Used by auto-resolve / subobject-pin code paths whose dispatch happens on a runtime EComposableCameraPinType value (not a compile-time T) – the templated ReadValue |
FInstancedStruct & |
GetStructSlotMutableChecked inline |
|
void |
RegisterReferenceSlot |
|
void |
RefreshReferenceSlot |
|
void |
RefreshAllReferenceSlots |
|
void |
AddReferencedObjects |
|
bool |
IsValid const inline |
Check if storage has been allocated. |
void |
ZeroInitialize inline |
Zero-initialize all storage. Called at allocation time. |
IsStructSlotOffset¶
const inline
inline bool IsStructSlotOffset(int32 Offset) const
True if Offset addresses a non-POD struct slot in StructSlots.
GetStructSlotIndex¶
const inline
inline int32 GetStructSlotIndex(int32 Offset) const
Convert a synthetic offset to its StructSlots index.
RegisterStructSlot¶
inline
inline int32 RegisterStructSlot(const UScriptStruct * StructType)
Reserve a fresh struct slot pre-initialized for StructType, returning the synthetic offset that should be stored in the relevant offset table (ExposedParameterOffsets / OutputPinOffsets / etc.). Called once per non-POD struct entry by BuildRuntimeDataLayout.
ReadValue¶
const inline
template<typename T> inline T ReadValue(int32 Offset) const
Read a typed value from the storage at the given byte offset. POD path: memcpy out of Storage. Non-POD struct path (T is a USTRUCT and Offset >= StructSlotsOffsetBase): CopyScriptStruct out of the typed slot in StructSlots.
WriteValue¶
inline
template<typename T> inline void WriteValue(int32 Offset, const T & Value)
Write a typed value to the storage at the given byte offset. POD path: memcpy into Storage. Non-POD struct path: CopyScriptStruct into the existing struct slot's owned memory – no allocation unless an embedded FString grows beyond its existing capacity (see TechDoc.md §7.2 alloc characteristic).
ReadOutputPin¶
const inline
template<typename T> inline T ReadOutputPin(int32 NodeIndex, FName PinName) const
Read a value for a specific output pin.
WriteOutputPin¶
inline
template<typename T> inline void WriteOutputPin(int32 NodeIndex, FName PinName, const T & Value)
Write a value for a specific output pin.
TryResolveInputPin¶
const inline
template<typename T> inline bool TryResolveInputPin(int32 NodeIndex, FName PinName, T & OutValue) const
Resolve an input pin's value. Checks in order:
-
Wired connection (InputPinSourceOffsets)
-
Exposed parameter (ExposedInputPinOffsets)
-
Per-instance default override (DefaultValueOffsets) — authoring-layer FComposableCameraPinOverride::DefaultValueOverride, pre-parsed by BuildRuntimeDataLayout.
-
Returns false if none of the above are found. Callers with a class-level fallback (e.g. a UPROPERTY on the node template) should read it in the false branch; see UComposableCameraFieldOfViewNode::OnTickNode for the canonical pattern.
ResolveInputPinOffset¶
const inline
inline bool ResolveInputPinOffset(int32 NodeIndex, FName PinName, int32 & OutOffset) const
Resolve an input pin to its source slot offset using the same three-tier priority as TryResolveInputPin (wired -> exposed -> per-instance default), but without copying the value out – useful for non-templated paths (auto-resolve Struct case, struct subobject pin dispatch) that need to decide between byte storage and FInstancedStruct slot at runtime. Returns true and writes OutOffset when a slot is found.
ReadInternalVariable¶
const inline
template<typename T> inline T ReadInternalVariable(FName VariableName) const
Read an internal variable by name.
WriteInternalVariable¶
inline
template<typename T> inline void WriteInternalVariable(FName VariableName, const T & Value)
Write an internal variable by name.
HasInternalVariable¶
const inline
inline bool HasInternalVariable(FName VariableName) const
Check if a specific internal variable exists.
CopySlot¶
inline
inline void CopySlot(int32 SourceOffset, int32 TargetOffset, int32 NumBytes)
Copy raw bytes from one slot to another within the same storage. Used by the exec-chain SetVariable dispatch to transfer a source node's output pin value into an internal variable slot without knowing the concrete C++ type at compile time.
Three cases: both POD (memcpy), both non-POD struct (CopyScriptStruct through the slot's owned memory, the struct types must match), or mismatched – the layout builder must never emit a connection between pins of different storage classes, so a mismatch is a bug.
GetStructSlotChecked¶
const inline
inline const FInstancedStruct & GetStructSlotChecked(int32 Offset) const
Direct access to the FInstancedStruct backing a non-POD struct slot. Used by auto-resolve / subobject-pin code paths whose dispatch happens on a runtime EComposableCameraPinType value (not a compile-time T) – the templated ReadValue
GetStructSlotMutableChecked¶
inline
inline FInstancedStruct & GetStructSlotMutableChecked(int32 Offset)
RegisterReferenceSlot¶
void RegisterReferenceSlot(EComposableCameraPinType PinType, int32 Offset)
RefreshReferenceSlot¶
void RefreshReferenceSlot(int32 Offset)
RefreshAllReferenceSlots¶
void RefreshAllReferenceSlots()
AddReferencedObjects¶
void AddReferencedObjects(FReferenceCollector & Collector)
IsValid¶
const inline
inline bool IsValid() const
Check if storage has been allocated.
ZeroInitialize¶
inline
inline void ZeroInitialize()
Zero-initialize all storage. Called at allocation time.
Public Static Attributes¶
| Return | Name | Description |
|---|---|---|
constexpr int32 |
StructSlotsOffsetBase static |
Synthetic offsets >= this value index into StructSlots; offsets < this value are real byte offsets into Storage. INT32_MAX/2 is well outside any plausible Storage size and leaves the same headroom for synthetic range, so collisions are impossible without TotalSize crossing 1 GiB. |
StructSlotsOffsetBase¶
static
constexpr int32 StructSlotsOffsetBase = TNumericLimits<int32>::Max() / 2
Synthetic offsets >= this value index into StructSlots; offsets < this value are real byte offsets into Storage. INT32_MAX/2 is well outside any plausible Storage size and leaves the same headroom for synthetic range, so collisions are impossible without TotalSize crossing 1 GiB.