|
| | FEntityAllocation () |
| | Constructor that initializes the defaults for this structure. 更多...
|
| |
|
| FEntityAllocation (const FEntityAllocation &)=delete |
| | Entity allocations are non-copyable
|
| |
| FComponentHeader * | FindComponentHeader (FComponentTypeID ComponentTypeID) |
| | Find a component header by its type 更多...
|
| |
| const FComponentHeader * | FindComponentHeader (FComponentTypeID ComponentTypeID) const |
| | Find a component header by its type 更多...
|
| |
|
int32 | GetCapacity () const |
| | Retrieve the number of entities this allocation can currently house without reallocation
|
| |
| FComponentHeader & | GetComponentHeaderChecked (FComponentTypeID ComponentTypeID) |
| | Get a reference to a component header by its type. 更多...
|
| |
| const FComponentHeader & | GetComponentHeaderChecked (FComponentTypeID ComponentTypeID) const |
| | Get a reference to a component header by its type. 更多...
|
| |
|
TArrayView< FComponentHeader > | GetComponentHeaders () |
| | Retrieve all of this allocation's component and tag headers.
|
| |
|
TArrayView< const FComponentHeader > | GetComponentHeaders () const |
| | Retrieve all of this allocation's component and tag headers.
|
| |
|
TArrayView< const FMovieSceneEntityID > | GetEntityIDs () const |
| | Retrieve all of this allocation's entity IDs
|
| |
|
int32 | GetMaxCapacity () const |
| | Retrieve the maximum number of entities that this allocation is allowed to grow to until a new one must be made
|
| |
|
int32 | GetNumComponentTypes () const |
| | Get the number of component types and tags that exist within this allocation
|
| |
|
const FMovieSceneEntityID * | GetRawEntityIDs () const |
| | Retrieve all of this allocation's entity IDs as a raw ptr
|
| |
|
int32 | GetSlack () const |
| | Retrieve the amount of empty space within this allocation
|
| |
| uint32 | GetUniqueID () const |
| | Get the unique identifier for this allocation. 更多...
|
| |
| bool | HasComponent (FComponentTypeID ComponentTypeID) const |
| | Check whether this allocation has the specified component type 更多...
|
| |
| bool | HasStructureChangedSince (uint64 InSystemVersion) const |
| | Retrieve this allocation's serial number. 更多...
|
| |
|
int32 | Num () const |
| | Retrieve the number of entities in this allocation
|
| |
| void | PostModifyStructureExcludingHeaders (uint64 InSystemSerial) |
| | Called when this allocation has been modified. 更多...
|
| |
|
| ~FEntityAllocation () |
| | Manually invoked destructor that calls the destructor of each component header according to the number of components
|
| |
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],