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 |
|---|---|---|---|
| DataType | Private | Hash value representing the type of the stored data. |
| DataSize | Private | Size of the stored data in bytes. |
| Data | Private | Unique pointer to a byte array containing the serialized data. |
Functions
Return Type | Signature | Description |
|---|---|---|
|
| Serializes or deserializes the stored data using Unreal Engine's archive system. |
|
| Assignment operator to copy another |
|
| Checks if the stored data type matches a given type. |
|
| Retrieves the stored data as a pointer of a specified type. |
|
| 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
Datamember usesTUniquePtr, ensuring that the memory is automatically managed and freed when no longer needed.Initialization Dependencies: The constructor initializes
DataTypeandDataSizeto invalid values (-1) to indicate an empty state.