Skip to content

PointAllocator

Visitor class for allocating points that conform to a given space.

This class implements the visitor pattern to traverse space definitions and allocate corresponding point instances with the correct structure and default values. It’s used to create points that match a space’s requirements.

class PointAllocator : public ConstSpaceVisitor

Methods

PointAllocator

inline explicit PointAllocator(TInstancedStruct<FPoint> &InOutPoint)

Constructs a PointAllocator for a specific point instance.

Parameters

  • InOutPoint (TInstancedStruct<FPoint>)

operator()

inline virtual void operator()(const FMultiBinarySpace &InSpace) override

Allocates a MultiBinaryPoint for a MultiBinarySpace.

Parameters

  • InSpace (const FMultiBinarySpace)

operator()

inline virtual void operator()(const FDiscreteSpace &InSpace) override

Allocates a DiscretePoint for a DiscreteSpace.

Parameters

  • InSpace (const FDiscreteSpace)

operator()

inline virtual void operator()(const FMultiDiscreteSpace &InSpace) override

Allocates a MultiDiscretePoint for a MultiDiscreteSpace.

Parameters

  • InSpace (const FMultiDiscreteSpace)

operator()

inline virtual void operator()(const FBoxSpace &InSpace) override

Allocates a BoxPoint for a BoxSpace.

Parameters

  • InSpace (const FBoxSpace)

operator()

inline virtual void operator()(const FDictSpace &InSpace) override

Allocates a DictPoint for a DictSpace.

Parameters

  • InSpace (const FDictSpace)

AllocatePoint

static inline void AllocatePoint(const TInstancedStruct<FSpace> &InSpace,
TInstancedStruct<FPoint> &PointToAllocate)

Static utility function to allocate a point for a given space.

Parameters

  • InSpace (const TInstancedStruct<FSpace>)

  • PointToAllocate (TInstancedStruct<FPoint>)

Source: Source/Schola/Public/Spaces/PointAllocator.h