UStackerBase
Abstract base for stackers that hold a ring buffer of points and expose stacked point/space.
Subclasses (e.g. UDictStacker, UBoxStacker) implement GetStacked and GetStackedSpace for their concrete types.
Subclassed by UBoxStacker, UDictStacker
class UStackerBase : public UObjectMethods
Public
Push
virtual void Push(const FInstancedStruct &InPoint, FInstancedStruct &OutStackedPoint)Pushes a point into the ring buffer (overwrites oldest when full).
Parameters
-
InPoint(const FInstancedStruct) -
OutStackedPoint(FInstancedStruct)
Reset
void Reset()Resets the ring buffer; next push will start at index 0 again.
GetNumValid
inline int32 GetNumValid() constGetStacked
inline virtual void GetStacked(FInstancedStruct &OutStackedPoint)Fills the output with the current stacked point.
Parameters
OutStackedPoint(FInstancedStruct)
GetStackedSpace
inline virtual void GetStackedSpace(FInstancedStruct &OutSpace) constFills the output with the stacked space.
Parameters
OutSpace(FInstancedStruct)
Protected
PopulateBufferWithDefaults
void PopulateBufferWithDefaults()Fills unused slots in Buffer with DefaultPoint after resize or reset.
ValidateDefaultPointAndSpace
virtual void ValidateDefaultPointAndSpace()Ensures DefaultPoint and UnstackedSpace are compatible for this stacker; assert or log on failure.
Attributes
Public
UnstackedSpace
TInstancedStruct<FSpace> UnstackedSpaceThe unstacked space that will be stacked.
StackSize
int32 StackSize = 4Number of frames to keep in the ring buffer (stack size).
DefaultPoint
TInstancedStruct<FPoint> DefaultPointThe default point to represent empty slots in the stacked observation.
Protected
Buffer
TRingBuffer<TInstancedStruct<FPoint>> BufferRing buffer of the last StackSize points (newest at logical push position).
NumValid_
int32 NumValid_ = 0Number of real (pushed) entries in the buffer; remaining slots are DefaultPoint.