Skip to content

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 UObject

Methods

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() const

GetStacked

inline virtual void GetStacked(FInstancedStruct &OutStackedPoint)

Fills the output with the current stacked point.

Parameters

  • OutStackedPoint (FInstancedStruct)

GetStackedSpace

inline virtual void GetStackedSpace(FInstancedStruct &OutSpace) const

Fills 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> UnstackedSpace

The unstacked space that will be stacked.


StackSize

int32 StackSize = 4

Number of frames to keep in the ring buffer (stack size).


DefaultPoint

TInstancedStruct<FPoint> DefaultPoint

The default point to represent empty slots in the stacked observation.

Protected

Buffer

TRingBuffer<TInstancedStruct<FPoint>> Buffer

Ring buffer of the last StackSize points (newest at logical push position).


NumValid_

int32 NumValid_ = 0

Number of real (pushed) entries in the buffer; remaining slots are DefaultPoint.

Source: Source/Schola/Public/Adapters/StackerBase.h