Limen Framework 0.1 Help

FLimenPolymorphicData

Overview

FLimenPolymorphicData is designed to store any type of data while maintaining type safety. It supports copying, moving, and serialization of the stored data. The struct uses template functions to handle different types dynamically.

Properties

Type

Name

Access

Description

uint32

DataType

Private

Hash value representing the type of the stored data.

int32

DataSize

Private

Size of the stored data in bytes.

TUniquePtr<std::byte[]>

Data

Private

Unique pointer to a byte array containing the serialized data.

Functions

Return Type

Signature

Description

void

Serialize(FArchive& Ar)

Serializes or deserializes the stored data using Unreal Engine's archive system.

FLimenPolymorphicData&

operator=(const FLimenPolymorphicData& InData)

Assignment operator to copy another FLimenPolymorphicData object.

bool

ContainsDataType() const

Checks if the stored data type matches a given type.

T*

As()

Retrieves the stored data as a pointer of a specified type.

FLimenPolymorphicData&

operator=(const T& InData)

Assigns data to the struct, storing it in a type-safe manner.

Usage & Implementation Notes

  • Threading Constraints: This class is not thread-safe and should be used with appropriate synchronization mechanisms if accessed from multiple threads.

  • Replication Requirements: This class does not require replication as it is designed for local use within a single Unreal Engine instance.

  • Memory Lifetime Management: The Data member uses TUniquePtr, ensuring that the memory is automatically managed and freed when no longer needed.

  • Initialization Dependencies: The constructor initializes DataType and DataSize to invalid values (-1) to indicate an empty state.

22 May 2026