![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MovieSceneEntitySystemTypes.h>
Public Attributes | |
| FComponentHeader * | ComponentHeaders |
Friends | |
| struct | FEntityInitializer |
| struct | FEntityAllocationMutexGuard |
FEntityAllocation is the authoritative storage of entity-component data within an FEntityManager. It stores component data in separate contiguous arrays, aligned to a cache line. Storing component data in this way allows for cache-efficient and concurrent access to each component array in isolation. It also allows for write access to component arrays at the same time as concurrent read-access to other component arrays within the same entity allocation.
FEntityAllocations are custom allocated according to the size of its component capacity, which is loosely computed as sizeof(FEntityAllocation) + sizeof(ComponentData), not simply sizeof(FEntityAllocation).
A typical allocation will look like this in memory:
uint32 {UniqueID}, uint16 {NumComponents}, uint16 {Size}, uint16 {Capacity}, uint16 {MaxCapacity}, uint32 {SerialNumber}, FMovieSceneEntityID* {EntityIDs}, <– points to FMovieSceneEntityID array at end of structure FComponentHeader[NumComponents], <– each component header contains a component array ptr that points to its corresponding type array below (padding) FMovieSceneEntityID[Capacity], (padding) ComponentType1[Capacity], (padding) ComponentType2[Capacity], (padding) ComponentType3[Capacity],
|
inline |
Constructor that initializes the defaults for this structure. CAUTION: Does not initialize ComponentHeaders - these constructors must be called manually
|
inline |
Manually invoked destructor that calls the destructor of each component header according to the number of components
|
delete |
Entity allocations are non-copyable
|
inline |
Find a component header by its type
| ComponentTypeID | The type ID for the component header to locate |
|
inline |
Find a component header by its type
| ComponentTypeID | The type ID for the component header to locate |
|
inline |
Retrieve the number of entities this allocation can currently house without reallocation
|
inline |
Retrieve the address of this allocation's component data. Only to be used for construction of TRelativePtrs.
|
inline |
Get a reference to a component header by its type. Will fail an assertion if it does not exist.
| ComponentTypeID | The type ID for the component header to locate |
|
inline |
Get a reference to a component header by its type. Will fail an assertion if it does not exist.
| ComponentTypeID | The type ID for the component header to locate |
|
inline |
Retrieve all of this allocation's component and tag headers.
|
inline |
Retrieve all of this allocation's component and tag headers.
|
inline |
Get this allocation's current lock mode
|
inline |
Retrieve all of this allocation's entity IDs
|
inline |
Retrieve the maximum number of entities that this allocation is allowed to grow to until a new one must be made
|
inline |
Get the number of component types and tags that exist within this allocation
|
inline |
Retrieve all of this allocation's entity IDs as a raw ptr
|
inline |
Retrieve the amount of empty space within this allocation
|
inline |
Get the unique identifier for this allocation. This identifier is unique to the specific allocation and entity manager, but is not globally unique. Typically used for caching component data on a per-allocation basis
|
inline |
Check whether this allocation has the specified component type
| ComponentTypeID | The type ID for the component to check |
|
inline |
Retrieve this allocation's serial number. The serial number is incremented whenever a component is modified on this allocation, or when an entity is added or removed. Typically used for caching component data on a per-allocation basis
|
inline |
Retrieve the number of entities in this allocation
|
delete |
|
inline |
|
inline |
Called when this allocation has been modified. Will invalidate any cached data based of this allocation's serial number
|
inline |
Read typed component data for the specified component type
| FComponentReader UE::MovieScene::FEntityAllocation::ReadComponentsErased | ( | FComponentTypeID | ComponentType | ) | const |
Read type-erased component data for the specified component type
|
inline |
Write typed component data for the specified component type
| FOptionalComponentReader UE::MovieScene::FEntityAllocation::TryReadComponentsErased | ( | FComponentTypeID | ComponentType | ) | const |
Attempt to read type-erased component data for the specified component type
|
inline |
Attempt to write typed component data for the specified component type
| FOptionalComponentWriter UE::MovieScene::FEntityAllocation::TryWriteComponentsErased | ( | FComponentTypeID | ComponentType, |
| FEntityAllocationWriteContext | InWriteContext | ||
| ) | const |
Attempt to write type-erased component data for the specified component type
|
inline |
Write typed component data for the specified component type
| FComponentWriter UE::MovieScene::FEntityAllocation::WriteComponentsErased | ( | FComponentTypeID | ComponentType, |
| FEntityAllocationWriteContext | InWriteContext | ||
| ) | const |
Write type-erased component data for the specified component type
|
friend |
| FComponentHeader* UE::MovieScene::FEntityAllocation::ComponentHeaders |
Pointer to array of the component headers of size NumComponents (stored in the end padding of this structure).