Top-level manager class that is responsible for all entity data and interaction/ 更多...
#include <MovieSceneEntityManager.h>
类 UE::MovieScene::FEntityManager 继承关系图:Public 成员函数 | |
| void | AccumulateMask (const FEntityComponentFilter &InFilter, FComponentMask &OutMask) const |
| Accumulate a mask from all entity types that match the specified filter 更多... | |
| void | AddChild (FMovieSceneEntityID ParentID, FMovieSceneEntityID ChildID) |
| Set up an entity to be a child of another. 更多... | |
| void | AddComponent (FMovieSceneEntityID EntityID, FComponentTypeID ComponentTypeID) |
| Add the specified component type to an entity. 更多... | |
| template<typename T , typename ValueType > | |
| void | AddComponent (FMovieSceneEntityID EntityID, TComponentTypeID< T > ComponentTypeID, ValueType &&InValue) |
| Add the specified component value to an entity 更多... | |
| void | AddComponents (FMovieSceneEntityID EntityID, const FComponentMask &EntityComponentMask) |
| Add the specified components to an entity. 更多... | |
| void | AddMutualComponents () |
| Run through all entities in this entity manager, ensuring that all mutual components exist | |
| void | AddReferencedObjects (FReferenceCollector &ReferenceCollector) |
| Explicitly add referenced objects from an external source. 更多... | |
| FEntityDataLocation | AllocateContiguousEntities (const FComponentMask &EntityComponentMask, int32 *InOutNum) |
| Attempt to allocate a number of entities of the same type contiguously in memory 更多... | |
| FMovieSceneEntityID | AllocateEntity () |
| Allocate a new entity with no components 更多... | |
| FEntityInfo | AllocateEntity (const FComponentMask &EntityComponentMask) |
| Allocate a single entity with the specified components 更多... | |
| void | ChangeEntityType (FMovieSceneEntityID InEntity, const FComponentMask &InNewMask) |
| Changes the components that exist on an entity to a new mask 更多... | |
| void | CombineComponents (FMovieSceneEntityID DestinationEntityID, FMovieSceneEntityID SourceEntityID, const FComponentMask *OptionalMask=nullptr) |
| Combine the components from one entity into another, overwriting any pre-existing component values. 更多... | |
| void | Compact () |
| Goes through all entity data and compacts like-for-like allocations into as few allocations as possible, resulting in the optimal data layout | |
| bool | Contains (const FEntityComponentFilter &InFilter) const |
| Efficiently test whether this entity manager contains any allocations that match the specified filter 更多... | |
| bool | ContainsAllComponents (std::initializer_list< FComponentTypeID > ComponentTypeIDs) const |
| Check whether all of the specified components exist anywhere in this entity manager 更多... | |
| bool | ContainsAnyComponent (std::initializer_list< FComponentTypeID > ComponentTypeIDs) const |
| Check whether any entity in this manager has any of the specified components 更多... | |
| bool | ContainsComponent (FComponentTypeID ComponentTypeID) const |
| Check whether any entity in this manager has the specified component 更多... | |
| bool | CopyComponent (FMovieSceneEntityID SrcEntityID, FMovieSceneEntityID DstEntityID, FComponentTypeID ComponentTypeID) |
| Copy the specified component type from an entity if it exists. 更多... | |
| void | CopyComponents (FMovieSceneEntityID SrcEntityID, FMovieSceneEntityID DstEntityID, const FComponentMask &ComponentsToCopy) |
| Copy any and all the specified component types from one entity onto another. 更多... | |
| void | CountMemory (FArchive &Ar, FMovieSceneEntityID EntityID) |
| Run a serialization routine over the specified entity to approximate the memory it is using 更多... | |
| int32 | DefineInstancedChildInitializer (TInlineValue< FChildEntityInitializer > &&InInitializer) |
| Defines a new child initializer that applies only to entities factoried within this entity manager 更多... | |
| void | Destroy () |
| Destroy this entity manager and all the entities and components contained within it, resetting it back to its default state | |
| void | DestroyInstancedChildInitializer (int32 Index) |
| Destroy a previously registered instanced child initializer using its index | |
| FMovieSceneEntityID | DuplicateEntity (FMovieSceneEntityID InOther) |
| Duplicate an entity, by creating an exact copy with a new ID 更多... | |
| void | EnterIteration () const |
| Efficiently test whether this entity manager contains any allocations that match the specified filter 更多... | |
| void | FilterComponents (FMovieSceneEntityID EntityID, const FComponentMask &EntitiesToKeep) |
| Remove all but the specified components from an entity. 更多... | |
| int32 | FreeEntities (const FEntityComponentFilter &Filter, TSet< FMovieSceneEntityID > *OutFreedEntities=nullptr) |
| Free all entities that match the specified filter 更多... | |
| int32 | FreeEntities (const FFreeEntityOperation &Operation, TSet< FMovieSceneEntityID > *OutFreedEntities=nullptr) |
| Free all entities defined by the specified operation 更多... | |
| void | FreeEntity (FMovieSceneEntityID EntityID) |
| Free an entity and relinquish its entity ID 更多... | |
| const FComponentMask & | GetAccumulatedMask () const |
| Retrieve an up-to-date accumulation of all components present on entities in this manager | |
| void | GetChildren_ParentFirst (FMovieSceneEntityID ParentID, TArray< FMovieSceneEntityID > &OutChildren) const |
| Retrieve all children, grandchildren etc of the specified entity using a parent first traversal 更多... | |
| FEntityInfo | GetEntity (FMovieSceneEntityID EntityID) const |
| Retrieve an entity's allocation and component offset from its ID 更多... | |
| FEntityHandle | GetEntityHandle (FMovieSceneEntityID EntityID) |
| Retrieve a handle to an entity 更多... | |
| FComponentMask | GetEntityType (FMovieSceneEntityID InEntity) const |
| Retrieve the type mask for this component 更多... | |
| void | GetImmediateChildren (FMovieSceneEntityID ParentID, TArray< FMovieSceneEntityID > &OutChildren) const |
| Retrieve the immediate children of the specified entity 更多... | |
| uint64 | GetSystemSerial () const |
| Get the current serial number for any system ovserving this entity manager. 更多... | |
| EEntityThreadingModel | GetThreadingModel () const |
| Compute and retrieve this entity manager's threading model | |
| bool | HasComponent (FMovieSceneEntityID EntityID, FComponentTypeID ComponentTypeID) const |
| Check whether the specified component has a component of the specified type 更多... | |
| bool | HasStructureChangedSince (uint64 CachedSerial) const |
| Check whether the structure of this entity manager has changed at all since the specified serial number | |
| void | IncrementSystemSerial () |
| Increment the current serial number for systems observing this manager. 更多... | |
| void | InitializeChildAllocation (const FComponentMask &ParentType, const FComponentMask &ChildType, const FEntityAllocation *ParentAllocation, TArrayView< const int32 > ParentAllocationOffsets, const FEntityRange &InChildEntityRange) |
| Runs all initializers for the specified parent/child allocation | |
| void | InitializeMutualComponents (FMovieSceneEntityID EntityID) |
| Initialize a single entity using the mutual initializers | |
| bool | IsAllocated (FMovieSceneEntityID EntityID) const |
| Check whether an entity is allocated. 更多... | |
| bool | IsHandleValid (FEntityHandle EntityID) const |
| Check whether the specified entity handle is still valid 更多... | |
| FEntityAllocationIteratorProxy | Iterate (const FEntityComponentFilter *InFilter) const |
| Iterate through all the allocations that match the specified component filter 更多... | |
| template<typename IteratorType > | |
| void | IterateChildren_ParentFirst (FMovieSceneEntityID ParentID, IteratorType &&Iterator) const |
| Iterate all children, grandchildren etc of the specified entity using a parent first traversal 更多... | |
| template<typename IteratorType > | |
| void | IterateImmediateChildren (FMovieSceneEntityID ParentID, IteratorType &&Iterator) const |
| Itereate the immediate children of the specified entity 更多... | |
| void | MimicStructureChanged () |
| Called in order to mimic the entity structure changing, even if it has not | |
| int32 | MutateAll (const FEntityComponentFilter &Filter, const IMovieSceneEntityMutation &Mutation) |
| Efficiently mutate all entities that match a filter. 更多... | |
| void | OverwriteEntityWithDuplicate (FMovieSceneEntityID &InOutEntity, FMovieSceneEntityID InEntityToDuplicate) |
| Duplicate an entity over the top of an existing entity ID 更多... | |
| template<typename T > | |
| TComponentPtr< const T > | ReadComponent (FMovieSceneEntityID Entity, TComponentTypeID< T > ComponentTypeID) const |
| Attempt to read a component from an entity. 更多... | |
| template<typename T > | |
| T | ReadComponentChecked (FMovieSceneEntityID Entity, TComponentTypeID< T > ComponentTypeID) const |
| Read a component value from an entity that is known to exist. 更多... | |
| void | RemoveComponent (FMovieSceneEntityID EntityID, FComponentTypeID ComponentTypeID) |
| Remove the specified component type from an entity if it exists. 更多... | |
| void | RemoveComponents (FMovieSceneEntityID EntityID, const FComponentMask &ComponentsToRemove) |
| Remove the specified components from an entity, if they exist. 更多... | |
| void | ReplaceEntityID (FMovieSceneEntityID &InOutEntity, FMovieSceneEntityID EntityToDiscard) |
| Replace an entity ID with the components from another, discarding the provided entity ID in the process 更多... | |
| void | SetDebugName (FString &&InNewDebugName) |
| Set a debug name for this entity manager | |
| void | TouchEntity (FMovieSceneEntityID EntityID) |
| Touch the specified entity, cause the allocation and component serial numbers to be incremented. 更多... | |
| template<typename T > | |
| TComponentPtr< T > | WriteComponent (FMovieSceneEntityID Entity, TComponentTypeID< T > ComponentTypeID) |
| Attempt to write to an entity's component. 更多... | |
| template<typename T , typename ValueType > | |
| void | WriteComponentChecked (FMovieSceneEntityID Entity, TComponentTypeID< T > ComponentTypeID, ValueType &&Value) const |
| Write a component value that is known to exist to an entity. 更多... | |
Public 成员函数 继承自 FUObjectArray::FUObjectDeleteListener | |
| virtual void | NotifyUObjectDeleted (const class UObjectBase *Object, int32 Index)=0 |
| Provides notification that a UObjectBase has been removed from the uobject array 更多... | |
| virtual void | OnUObjectArrayShutdown ()=0 |
| Called when UObject Array is being shut down, this is where all listeners should be removed from it | |
静态 Public 成员函数 | |
| static IComponentTypeHandler * | FindComponentTypeHandler (const FGuid &ComponentGuid) |
| Find a component type hander from its registered GUID | |
Top-level manager class that is responsible for all entity data and interaction/
An entity is a stable index into the manager's EntityLocations, which defines the location for that entity's data. This allows the manager to relocate entity data at will without invalidating client held entity IDs. An entity may contain 0 or more components. Components are concrete pieces of data with a unique type identifier. Additionally, tags can be added to entities or whole batches of entities with zero memory overhead.
Entity Component data is stored in allocations organized by each unique combination of components. Each component type is stored as a contiguous array within each allocation, with each entity's component being a fixed offset from the start of each component array. This enables efficient read/write access into specific component arrays and makes issuing parallel tasks that require component data trivial. See FEntityAllocation for a more detailed explanation of entity component data layout.
| void UE::MovieScene::FEntityManager::AccumulateMask | ( | const FEntityComponentFilter & | InFilter, |
| FComponentMask & | OutMask | ||
| ) | const |
Accumulate a mask from all entity types that match the specified filter
| InFilter | The filter to match allocations against. Filter is copied into the iterator. |
| OutMask | The mask to receive the binary OR accumulation of all entities that pass the filter |
| void UE::MovieScene::FEntityManager::AddChild | ( | FMovieSceneEntityID | ParentID, |
| FMovieSceneEntityID | ChildID | ||
| ) |
Set up an entity to be a child of another.
Child entities will only be cleaned up if their parents are marked Unlink, and TagOrphanedChildren is called
| ParentID | The ID of the parent |
| ChildID | The ID of the child |
| void UE::MovieScene::FEntityManager::AddComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) |
Add the specified component type to an entity.
The component value will be default-initialized.
| EntityID | The ID of the entity to add the component to |
| ComponentTypeID | The ID of the component type to add to the entity |
|
inline |
Add the specified component value to an entity
| EntityID | The ID of the entity to add the component to |
| ComponentTypeID | The ID of the component type to add to the entity |
| InValue | The value of the component to add |
| void UE::MovieScene::FEntityManager::AddComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | EntityComponentMask | ||
| ) |
Add the specified components to an entity.
Existing components will remain unchanged. New component values will be default-initialized.
| EntityID | The ID of the entity to add the components to |
| EntityComponentMask | A mask constituting the components that should be added (set bits indicate components to add) |
| void UE::MovieScene::FEntityManager::AddReferencedObjects | ( | FReferenceCollector & | ReferenceCollector | ) |
Explicitly add referenced objects from an external source.
This is not called by default for the global entity manager because each entity owner should do so to avoid cyclic dependencies.
| FEntityDataLocation UE::MovieScene::FEntityManager::AllocateContiguousEntities | ( | const FComponentMask & | EntityComponentMask, |
| int32 * | InOutNum | ||
| ) |
Attempt to allocate a number of entities of the same type contiguously in memory
| EntityComponentMask | Defines the components that should exist on the allocated components. Set bits denote allocated components and tags. |
| InOutNum | A valid pointer to the desired number to allocate. Is overwritten with the number that were actually allocated. |
| FMovieSceneEntityID UE::MovieScene::FEntityManager::AllocateEntity | ( | ) |
Allocate a new entity with no components
| FEntityInfo UE::MovieScene::FEntityManager::AllocateEntity | ( | const FComponentMask & | EntityComponentMask | ) |
Allocate a single entity with the specified components
| EntityComponentMask | Defines the components that should exist on the allocated components. Set bits denote allocated components and tags. |
| void UE::MovieScene::FEntityManager::ChangeEntityType | ( | FMovieSceneEntityID | InEntity, |
| const FComponentMask & | InNewMask | ||
| ) |
Changes the components that exist on an entity to a new mask
| InEntity | The ID of the entity |
| InNewMask | The new mask of the entity that defines which components it should have |
| void UE::MovieScene::FEntityManager::CombineComponents | ( | FMovieSceneEntityID | DestinationEntityID, |
| FMovieSceneEntityID | SourceEntityID, | ||
| const FComponentMask * | OptionalMask = nullptr |
||
| ) |
Combine the components from one entity into another, overwriting any pre-existing component values.
Does not free any entities.
| DestinationEntityID | The ID of the entity to add new components to |
| SourceEntityID | The ID of the entity to copy components from |
| OptionalMask | (Optional) A mask constituting the components that should be copied |
| bool UE::MovieScene::FEntityManager::Contains | ( | const FEntityComponentFilter & | InFilter | ) | const |
Efficiently test whether this entity manager contains any allocations that match the specified filter
| InFilter | The filter to match allocations against. |
|
inline |
Check whether all of the specified components exist anywhere in this entity manager
| ComponentTypeIDs | The types of the components that are being tested for |
|
inline |
Check whether any entity in this manager has any of the specified components
| ComponentTypeIDs | The types of the component that are being tested for |
|
inline |
Check whether any entity in this manager has the specified component
| ComponentTypeID | The type of the component that is being tested for |
| bool UE::MovieScene::FEntityManager::CopyComponent | ( | FMovieSceneEntityID | SrcEntityID, |
| FMovieSceneEntityID | DstEntityID, | ||
| FComponentTypeID | ComponentTypeID | ||
| ) |
Copy the specified component type from an entity if it exists.
| SrcEntityID | The ID of the entity to copy from |
| DstEntityID | The ID of the entity to copy to |
| ComponentTypeID | The ID of the component type to copy. Must exist on SrcEntityID |
| void UE::MovieScene::FEntityManager::CopyComponents | ( | FMovieSceneEntityID | SrcEntityID, |
| FMovieSceneEntityID | DstEntityID, | ||
| const FComponentMask & | ComponentsToCopy | ||
| ) |
Copy any and all the specified component types from one entity onto another.
Missing components on the source entity are handled gracefully.
| SrcEntityID | The ID of the entity to copy from |
| DstEntityID | The ID of the entity to copy to |
| ComponentsToCopy | A mask constituting the components that should be copied (set bits indicate components to copy) |
| void UE::MovieScene::FEntityManager::CountMemory | ( | FArchive & | Ar, |
| FMovieSceneEntityID | EntityID | ||
| ) |
Run a serialization routine over the specified entity to approximate the memory it is using
| Ar | The archive to save to. Ar.IsCountingMemory() must be true. |
| EntityID | Identifier for the entity to replace object references within |
|
inline |
Defines a new child initializer that applies only to entities factoried within this entity manager
| InInitializer | The initializer to insert |
| FMovieSceneEntityID UE::MovieScene::FEntityManager::DuplicateEntity | ( | FMovieSceneEntityID | InOther | ) |
Duplicate an entity, by creating an exact copy with a new ID
| InOther | The ID of the entity to duplicate |
| void UE::MovieScene::FEntityManager::EnterIteration | ( | ) | const |
Efficiently test whether this entity manager contains any allocations that match the specified filter
| InFilter | The filter to match allocations against. |
| void UE::MovieScene::FEntityManager::FilterComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | EntitiesToKeep | ||
| ) |
Remove all but the specified components from an entity.
| EntityID | The ID of the entity to remove the components from |
| EntitiesToKeep | A mask constituting the components that should be kept on the entity |
| int32 UE::MovieScene::FEntityManager::FreeEntities | ( | const FEntityComponentFilter & | Filter, |
| TSet< FMovieSceneEntityID > * | OutFreedEntities = nullptr |
||
| ) |
Free all entities that match the specified filter
| Filter | A filter that defines the entities to free. Any entity that passes the filter will be destroyed. |
| OutFreedEntities | (Optional) A set to populate with all the entities that were freed (including any children) |
| int32 UE::MovieScene::FEntityManager::FreeEntities | ( | const FFreeEntityOperation & | Operation, |
| TSet< FMovieSceneEntityID > * | OutFreedEntities = nullptr |
||
| ) |
Free all entities defined by the specified operation
| Operation | A pre-populated free entity operation definition |
| OutFreedEntities | (Optional) A set to populate with all the entities that were freed (including any children) |
| void UE::MovieScene::FEntityManager::FreeEntity | ( | FMovieSceneEntityID | EntityID | ) |
Free an entity and relinquish its entity ID
| EntityID | A valid entity ID to free |
| void UE::MovieScene::FEntityManager::GetChildren_ParentFirst | ( | FMovieSceneEntityID | ParentID, |
| TArray< FMovieSceneEntityID > & | OutChildren | ||
| ) | const |
Retrieve all children, grandchildren etc of the specified entity using a parent first traversal
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
| FEntityInfo UE::MovieScene::FEntityManager::GetEntity | ( | FMovieSceneEntityID | EntityID | ) | const |
Retrieve an entity's allocation and component offset from its ID
| FEntityHandle UE::MovieScene::FEntityManager::GetEntityHandle | ( | FMovieSceneEntityID | EntityID | ) |
Retrieve a handle to an entity
| FComponentMask UE::MovieScene::FEntityManager::GetEntityType | ( | FMovieSceneEntityID | InEntity | ) | const |
Retrieve the type mask for this component
| InEntity | The ID of the entity |
| void UE::MovieScene::FEntityManager::GetImmediateChildren | ( | FMovieSceneEntityID | ParentID, |
| TArray< FMovieSceneEntityID > & | OutChildren | ||
| ) | const |
Retrieve the immediate children of the specified entity
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
Get the current serial number for any system ovserving this entity manager.
This serial number acts as a timestamp for the current state of this entity manager - any serial number more recent than this dictates more recent logic or state.
| bool UE::MovieScene::FEntityManager::HasComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) | const |
Check whether the specified component has a component of the specified type
| EntityID | The ID of the entity to check |
| ComponentTypeID | The type of the component that is being tested for |
|
inline |
Increment the current serial number for systems observing this manager.
Should be called after any system is run
|
inline |
Check whether an entity is allocated.
| bool UE::MovieScene::FEntityManager::IsHandleValid | ( | FEntityHandle | EntityID | ) | const |
Check whether the specified entity handle is still valid
| FEntityAllocationIteratorProxy UE::MovieScene::FEntityManager::Iterate | ( | const FEntityComponentFilter * | InFilter | ) | const |
Iterate through all the allocations that match the specified component filter
| InFilter | (required, non-null) The filter to match allocations against. Filter is copied into the iterator. |
|
inline |
Iterate all children, grandchildren etc of the specified entity using a parent first traversal
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
|
inline |
Itereate the immediate children of the specified entity
| ParentID | The ID of the parent |
| OutChildren | (out) Array to populate with child entities. |
| int32 UE::MovieScene::FEntityManager::MutateAll | ( | const FEntityComponentFilter & | Filter, |
| const IMovieSceneEntityMutation & | Mutation | ||
| ) |
Efficiently mutate all entities that match a filter.
Mutations can add or remove components from batches of entity data.
| Filter | The filter to match entity allocations against. Only entities that match the filter will be mutated |
| Mutation | Implementation that defines how to mutate the entities that match the filter |
| void UE::MovieScene::FEntityManager::OverwriteEntityWithDuplicate | ( | FMovieSceneEntityID & | InOutEntity, |
| FMovieSceneEntityID | InEntityToDuplicate | ||
| ) |
Duplicate an entity over the top of an existing entity ID
| InOutEntity | The ID of the entity to overwrite. Doesn't have to be valid. |
| InEntityToDuplicate | The ID of the entity to duplicate |
|
inline |
Attempt to read a component from an entity.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
|
inline |
Read a component value from an entity that is known to exist.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
| void UE::MovieScene::FEntityManager::RemoveComponent | ( | FMovieSceneEntityID | EntityID, |
| FComponentTypeID | ComponentTypeID | ||
| ) |
Remove the specified component type from an entity if it exists.
| EntityID | The ID of the entity to remove the component from |
| ComponentTypeID | The ID of the component type to remove from the entity |
| void UE::MovieScene::FEntityManager::RemoveComponents | ( | FMovieSceneEntityID | EntityID, |
| const FComponentMask & | ComponentsToRemove | ||
| ) |
Remove the specified components from an entity, if they exist.
| EntityID | The ID of the entity to remove the components from |
| ComponentsToRemove | A mask constituting the components that should be removed (set bits indicate components to add) |
| void UE::MovieScene::FEntityManager::ReplaceEntityID | ( | FMovieSceneEntityID & | InOutEntity, |
| FMovieSceneEntityID | EntityToDiscard | ||
| ) |
Replace an entity ID with the components from another, discarding the provided entity ID in the process
| InOutEntity | The entity ID to be reassigned. If it is already valid, the existing entity will be freed |
| EntityToDiscard | The entity containing the components to replace InOutEntity with. This Entity ID will be invalid after this function call. |
| void UE::MovieScene::FEntityManager::TouchEntity | ( | FMovieSceneEntityID | EntityID | ) |
Touch the specified entity, cause the allocation and component serial numbers to be incremented.
Will invalidate any transient caches maintained for serial such numbers.
| EntityID | The ID of the entity to touch. |
|
inline |
Attempt to write to an entity's component.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
|
inline |
Write a component value that is known to exist to an entity.
| Entity | The ID of the entity to read from |
| ComponentTypeID | The component that is to be read |
| Value | The value to write |