ManagedArrayCollection 更多...
#include <ManagedArrayCollection.h>
类 FManagedArrayCollection 继承关系图:Public 成员函数 | |
| template<typename T > | |
| TManagedArray< T > & | AddAttribute (FName Name, FName Group, FConstructionParameters Parameters=FConstructionParameters()) |
| Add an attribute of Type(T) to the group 更多... | |
| int32 | AddElements (int32 NumberElements, FName Group) |
| Add elements to a group 更多... | |
| template<typename T > | |
| void | AddExternalAttribute (FName Name, FName Group, TManagedArray< T > &ValueIn, FConstructionParameters Parameters=FConstructionParameters()) |
| Add an external attribute of Type(T) to the group for size management. 更多... | |
| void | AddGroup (FName Group) |
| Create a group on the collection. 更多... | |
| TArray< FName > | AttributeNames (FName Group) const |
| List all the attributes in a group names. 更多... | |
| void | CopyAttribute (const FManagedArrayCollection &InCollection, FName Name, FName Group) |
| Copy an attribute. 更多... | |
| void | CopyMatchingAttributesFrom (const FManagedArrayCollection &InCollection, const TMap< FName, TSet< FName > > *SkipList=nullptr) |
| Copy attributes that match the input collection. 更多... | |
| void | EmptyGroup (FName Group) |
| Empty the group 更多... | |
| template<typename T > | |
| TManagedArray< T > * | FindAttribute (FName Name, FName Group) |
| Returns attribute(Name) of Type(T) from the group 更多... | |
| template<typename T > | |
| TManagedArray< T > * | FindAttributeTyped (FName Name, FName Group) |
| Returns attribute(Name) of Type(T) from the group if and only if the types of T and the array match 更多... | |
| template<typename T > | |
| TManagedArray< T > & | GetAttribute (FName Name, FName Group) |
| Returns attribute access of Type(T) from the group 更多... | |
| TArray< FName > | GroupNames () const |
| List all the group names. | |
| bool | HasAttribute (FName Name, FName Group) const |
| Check for the existence of a attribute 更多... | |
| FORCEINLINE bool | HasGroup (FName Group) const |
| Check for the existence of a group 更多... | |
| void | MakeDirty () |
| Updated for Render ( Mark it dirty ) question: is this the right place for this? | |
| int32 | NumElements (FName Group) const |
| Number of elements in a group 更多... | |
| void | RemoveAttribute (FName Name, FName Group) |
| Remove the attribute from the collection. 更多... | |
| virtual void | RemoveElements (const FName &Group, const TArray< int32 > &SortedDeletionList, FProcessingParameters Params=FProcessingParameters()) |
| Remove the element at index and reindex the dependent arrays | |
| void | RemoveGroup (FName Group) |
| Remove the group from the collection. 更多... | |
| virtual void | ReorderElements (FName Group, const TArray< int32 > &NewOrder) |
| Reorders elements in a group. 更多... | |
| void | Reserve (int32 Size, FName Group) |
| Reserve a group 更多... | |
| void | Resize (int32 Size, FName Group) |
| Resize a group 更多... | |
| virtual void | Serialize (Chaos::FChaosArchive &Ar) |
| Serialize 更多... | |
| FString | ToString () const |
| Dump the contents to a FString | |
Protected 成员函数 | |
| void | SyncGroupSizeFrom (const FManagedArrayCollection &InCollection, FName Group) |
| Size and order a group so that it matches the group found in the input collection. 更多... | |
友元 | |
| FArchive & | operator<< (FArchive &Ar, FGroupInfo &GroupInfo) |
| operator<<(FGroupInfo) | |
| FArchive & | operator<< (FArchive &Ar, FValueType &ValueIn) |
| operator<<(FValueType) | |
ManagedArrayCollection
The ManagedArrayCollection is an entity system that implements a homogeneous, dynamically allocated, manager of primitive TArray structures. The collection stores groups of TArray attributes, where each attribute within a group is the same length. The collection will make use of the TManagedArray class, providing limited interaction with the underlying TArray.
For example:
FManagedArrayCollection* Collection(NewObject<FManagedArrayCollection>()); Collection->AddElements(10, "GroupBar"); // Create a group GroupBar and add 10 elements. Collection->AddAttribute<FVector>("AttributeFoo", "GroupBar"); // Add a FVector array named AttributeFoo to GroupBar. TManagedArray<FVector>& Foo = Collection->GetAttribute<FVector>("AttributeFoo", "GroupBar"); // Get AttributeFoo for (int32 i = 0; i < Foo.Num(); i++) { Foo[i] = FVector(i, i, i); // Update AttribureFoo's elements }
|
inline |
Add an attribute of Type(T) to the group
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
| int32 FManagedArrayCollection::AddElements | ( | int32 | NumberElements, |
| FName | Group | ||
| ) |
Add elements to a group
| NumberElements | - The number of array entries to add |
| Group | - The group to append entries to. |
|
inline |
Add an external attribute of Type(T) to the group for size management.
Lifetime is managed by the caller, must make sure the array is alive when the collection is
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
| ValueIn | - The array to be managed |
| void FManagedArrayCollection::AddGroup | ( | FName | Group | ) |
Create a group on the collection.
Adding attribute will also create unknown groups.
| Group | - The group name |
List all the attributes in a group names.
| void FManagedArrayCollection::CopyAttribute | ( | const FManagedArrayCollection & | InCollection, |
| FName | Name, | ||
| FName | Group | ||
| ) |
Copy an attribute.
Will perform an implicit group sync. Attribute must exist in both MasterCollection and this collection
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
| void FManagedArrayCollection::CopyMatchingAttributesFrom | ( | const FManagedArrayCollection & | InCollection, |
| const TMap< FName, TSet< FName > > * | SkipList = nullptr |
||
| ) |
Copy attributes that match the input collection.
This is a utility to easily sync collections
| InCollection | - All groups from this collection found in the input will be sized accordingly |
| SkipList | - Group/Attrs to skip. Keys are group names, values are attributes in those groups. |
| void FManagedArrayCollection::EmptyGroup | ( | FName | Group | ) |
Empty the group
| Group | - The group to empty |
|
inline |
Returns attribute(Name) of Type(T) from the group
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
|
inline |
Returns attribute(Name) of Type(T) from the group if and only if the types of T and the array match
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
|
inline |
Returns attribute access of Type(T) from the group
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
Check for the existence of a attribute
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
|
inline |
Check for the existence of a group
| Group | - The group name |
| int32 FManagedArrayCollection::NumElements | ( | FName | Group | ) | const |
Number of elements in a group
Remove the attribute from the collection.
| Name | - The name of the attribute |
| Group | - The group that manages the attribute |
| void FManagedArrayCollection::RemoveGroup | ( | FName | Group | ) |
Remove the group from the collection.
| Group | - The group that manages the attribute |
|
virtual |
Reorders elements in a group.
NewOrder must be the same length as the group.
被 FGeometryCollection 重载.
| void FManagedArrayCollection::Reserve | ( | int32 | Size, |
| FName | Group | ||
| ) |
Reserve a group
| Size | - The size of the group |
| Group | - The group to reserve |
| void FManagedArrayCollection::Resize | ( | int32 | Size, |
| FName | Group | ||
| ) |
Resize a group
| Size | - The size of the group |
| Group | - The group to resize |
|
virtual |
Serialize
被 FGeometryCollection , 以及 FTransformCollection 重载.
|
protected |
Size and order a group so that it matches the group found in the input collection.
| InCollection | - The collection we are ordering our group against. |
| Group | - The group that manages the attribute |