engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Public 属性 | 所有成员列表
UE::MovieScene::FEntityAllocation结构体 参考

FEntityAllocation is the authoritative storage of entity-component data within an FEntityManager. 更多...

#include <MovieSceneEntitySystemTypes.h>

Public 成员函数

 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
 

Public 属性

FComponentHeader * ComponentHeaders
 Pointer to array of the component headers of size NumComponents (stored in the end padding of this structure).
 

详细描述

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],

构造及析构函数说明

◆ FEntityAllocation()

UE::MovieScene::FEntityAllocation::FEntityAllocation ( )
inline

Constructor that initializes the defaults for this structure.

CAUTION: Does not initialize ComponentHeaders - these constructors must be called manually

成员函数说明

◆ FindComponentHeader() [1/2]

FComponentHeader * UE::MovieScene::FEntityAllocation::FindComponentHeader ( FComponentTypeID  ComponentTypeID)
inline

Find a component header by its type

参数
ComponentTypeIDThe type ID for the component header to locate
返回
A pointer to the component header, or nullptr if one was not found

◆ FindComponentHeader() [2/2]

const FComponentHeader * UE::MovieScene::FEntityAllocation::FindComponentHeader ( FComponentTypeID  ComponentTypeID) const
inline

Find a component header by its type

参数
ComponentTypeIDThe type ID for the component header to locate
返回
A pointer to the component header, or nullptr if one was not found

◆ GetComponentHeaderChecked() [1/2]

FComponentHeader & UE::MovieScene::FEntityAllocation::GetComponentHeaderChecked ( FComponentTypeID  ComponentTypeID)
inline

Get a reference to a component header by its type.

Will fail an assertion if it does not exist.

参数
ComponentTypeIDThe type ID for the component header to locate
返回
A reference to the component header

◆ GetComponentHeaderChecked() [2/2]

const FComponentHeader & UE::MovieScene::FEntityAllocation::GetComponentHeaderChecked ( FComponentTypeID  ComponentTypeID) const
inline

Get a reference to a component header by its type.

Will fail an assertion if it does not exist.

参数
ComponentTypeIDThe type ID for the component header to locate
返回
A reference to the component header

◆ GetUniqueID()

uint32 UE::MovieScene::FEntityAllocation::GetUniqueID ( ) const
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

◆ HasComponent()

bool UE::MovieScene::FEntityAllocation::HasComponent ( FComponentTypeID  ComponentTypeID) const
inline

Check whether this allocation has the specified component type

参数
ComponentTypeIDThe type ID for the component to check
返回
true if these entities have the specified component, false otherwise

◆ HasStructureChangedSince()

bool UE::MovieScene::FEntityAllocation::HasStructureChangedSince ( uint64  InSystemVersion) const
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

◆ PostModifyStructureExcludingHeaders()

void UE::MovieScene::FEntityAllocation::PostModifyStructureExcludingHeaders ( uint64  InSystemSerial)
inline

Called when this allocation has been modified.

Will invalidate any cached data based of this allocation's serial number


该结构体的文档由以下文件生成: