Navigation
API > API/Runtime > API/Runtime/MovieScene > API/Runtime/MovieScene/EntitySystem
References
| Module | MovieScene |
| Header | /Engine/Source/Runtime/MovieScene/Public/EntitySystem/MovieSceneEntitySystemTypes.h |
| Include | #include "EntitySystem/MovieSceneEntitySystemTypes.h" |
Syntax
struct FEntityAllocation
Remarks
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],
Variables
| Type | Name | Description | |
|---|---|---|---|
| FComponentHeader * | ComponentHeaders | Pointer to array of the component headers of size NumComponents (stored in the end padding of this structure). |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Constructor that initializes the defaults for this structure. | |||
FEntityAllocation
(
const FEntityAllocation& |
Entity allocations are non-copyable |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Manually invoked destructor that calls the destructor of each component header according to the number of components |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FComponentHeader * | FindComponentHeader
(
FComponentTypeID ComponentTypeID |
Find a component header by its type | |
| const FComponentHeader * | FindComponentHeader
(
FComponentTypeID ComponentTypeID |
Find a component header by its type | |
| int32 | GetCapacity () |
Retrieve the number of entities this allocation can currently house without reallocation | |
| const void * | Retrieve the address of this allocation's component data. | ||
| FComponentHeader & | GetComponentHeaderChecked
(
FComponentTypeID ComponentTypeID |
Get a reference to a component header by its type. Will fail an assertion if it does not exist. | |
| const FComponentHeader & | GetComponentHeaderChecked
(
FComponentTypeID ComponentTypeID |
Get a reference to a component header by its type. Will fail an assertion if it does not exist. | |
| TArrayView< const FComponentHeader > | Retrieve all of this allocation's component and tag headers. | ||
| TArrayView< FComponentHeader > | Retrieve all of this allocation's component and tag headers. | ||
| EComponentHeaderLockMode | Get this allocation's current lock mode | ||
| TArrayView< const FMovieSceneEntityID > | GetEntityIDs () |
Retrieve all of this allocation's entity IDs | |
| int32 | Retrieve the maximum number of entities that this allocation is allowed to grow to until a new one must be made | ||
| int32 | Get the number of component types and tags that exist within this allocation | ||
| const FMovieSceneEntityID * | Retrieve all of this allocation's entity IDs as a raw ptr | ||
| int32 | GetSlack () |
Retrieve the amount of empty space within this allocation | |
| uint32 | GetUniqueID () |
Get the unique identifier for this allocation. | |
| bool | HasComponent
(
FComponentTypeID ComponentTypeID |
Check whether this allocation has the specified component type | |
| bool | HasStructureChangedSince
(
uint64 InSystemVersion |
Retrieve this allocation's serial number. | |
| int32 | Num () |
Retrieve the number of entities in this allocation | |
| void | PostModifyStructure
(
FEntityAllocationWriteContext InWriteContext |
||
| void | PostModifyStructureExcludingHeaders
(
FEntityAllocationWriteContext InWriteContext |
Called when this allocation has been modified. | |
| TComponentLock< TRead< T > > | ReadComponents
(
TComponentTypeID< T > ComponentType |
Read typed component data for the specified component type | |
| TComponentLock< FReadErased > | ReadComponentsErased
(
FComponentTypeID ComponentType |
Read type-erased component data for the specified component type | |
| TComponentLock< TReadOptional< T > > | TryReadComponents
(
TComponentTypeID< T > ComponentType |
Write typed component data for the specified component type | |
| TComponentLock< FReadErasedOptional > | TryReadComponentsErased
(
FComponentTypeID ComponentType |
Attempt to read type-erased component data for the specified component type | |
| TComponentLock< TWriteOptional< T > > | TryWriteComponents
(
TComponentTypeID< T > ComponentType, |
Attempt to write typed component data for the specified component type | |
| TComponentLock< FWriteErasedOptional > | TryWriteComponentsErased
(
FComponentTypeID ComponentType, |
Attempt to write type-erased component data for the specified component type | |
| TComponentLock< TWrite< T > > | WriteComponents
(
TComponentTypeID< T > ComponentType, |
Write typed component data for the specified component type | |
| TComponentLock< FWriteErased > | WriteComponentsErased
(
FComponentTypeID ComponentType, |
Write type-erased component data for the specified component type |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FEntityAllocation & | operator=
(
const FEntityAllocation& |