Module |
|
Header |
/Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntitySystemTypes.h |
Include |
#include "EntitySystem/MovieSceneEntitySystemTypes.h" |
struct FEntityAllocation
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],
Name | Description | ||
---|---|---|---|
|
ComponentHeaders |
Pointer to array of the component headers of size NumComponents (stored in the end padding of this structure). |
Name | Description | |
---|---|---|
|
FEntityAllocation() |
Constructor that initializes the defaults for this structure. |
|
FEntityAllocation ( |
Entity allocations are non-copyable |
Name | Description | |
---|---|---|
|
~FEntityAllocation() |
Manually invoked destructor that calls the destructor of each component header according to the number of components |
Name | Description | ||
---|---|---|---|
|
FComponentHe... |
FindComponentHeader ( |
Find a component header by its type |
|
const FCompo... |
FindComponentHeader ( |
Find a component header by its type |
|
GetCapacity() |
Retrieve the number of entities this allocation can currently house without reallocation |
|
|
FComponentHe... |
GetComponentHeaderChecked ( |
Get a reference to a component header by its type. Will fail an assertion if it does not exist. |
|
const FCompo... |
GetComponentHeaderChecked ( |
Get a reference to a component header by its type. Will fail an assertion if it does not exist. |
|
TArrayView< ... |
GetComponentHeaders() |
Retrieve all of this allocation's component and tag headers. |
|
TArrayView< ... |
GetComponentHeaders() |
Retrieve all of this allocation's component and tag headers. |
|
TArrayView< ... |
GetEntityIDs() |
Retrieve all of this allocation's entity IDs |
|
GetMaxCapacity() |
Retrieve the maximum number of entities that this allocation is allowed to grow to until a new one must be made |
|
|
GetNumComponentTypes() |
Get the number of component types and tags that exist within this allocation |
|
|
const FMovie... |
GetRawEntityIDs() |
Retrieve all of this allocation's entity IDs as a raw ptr |
|
GetSlack() |
Retrieve the amount of empty space within this allocation |
|
|
GetUniqueID() |
Get the unique identifier for this allocation. |
|
|
HasComponent ( |
Check whether this allocation has the specified component type |
|
|
HasStructureChangedSince ( |
Retrieve this allocation's serial number. |
|
|
Num() |
Retrieve the number of entities in this allocation |
|
|
PostModifyStructure ( |
||
|
PostModifyStructureExcludingHeaders ( |
Called when this allocation has been modified. |
|
|
TComponentLo... |
ReadComponents ( |
Read typed component data for the specified component type |
|
TComponentLo... |
ReadComponentsErased ( |
Read type-erased component data for the specified component type |
|
TComponentLo... |
TryReadComponents ( |
Write typed component data for the specified component type |
|
TComponentLo... |
TryReadComponentsErased ( |
Attempt to read type-erased component data for the specified component type |
|
TComponentLo... |
TryWriteComponents ( |
Attempt to write typed component data for the specified component type |
|
TComponentLo... |
TryWriteComponentsErased ( |
Attempt to write type-erased component data for the specified component type |
|
TComponentLo... |
WriteComponents ( |
Write typed component data for the specified component type |
|
TComponentLo... |
WriteComponentsErased ( |
Write type-erased component data for the specified component type |
Name | Description | ||
---|---|---|---|
|
FEntityAlloc... |
operator= ( |