engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 友元 | 所有成员列表
FManagedArrayCollection类 参考

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 }

成员函数说明

◆ AddAttribute()

template<typename T >
TManagedArray< T > & FManagedArrayCollection::AddAttribute ( FName  Name,
FName  Group,
FConstructionParameters  Parameters = FConstructionParameters() 
)
inline

Add an attribute of Type(T) to the group

参数
Name- The name of the attribute
Group- The group that manages the attribute
返回
reference to the created ManagedArray<T>

◆ AddElements()

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.
返回
starting index of the new ManagedArray<T> entries.

◆ AddExternalAttribute()

template<typename T >
void FManagedArrayCollection::AddExternalAttribute ( FName  Name,
FName  Group,
TManagedArray< T > &  ValueIn,
FConstructionParameters  Parameters = FConstructionParameters() 
)
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

◆ AddGroup()

void FManagedArrayCollection::AddGroup ( FName  Group)

Create a group on the collection.

Adding attribute will also create unknown groups.

参数
Group- The group name

◆ AttributeNames()

TArray< FName > FManagedArrayCollection::AttributeNames ( FName  Group) const

List all the attributes in a group names.

返回
list of group names

◆ CopyAttribute()

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

◆ CopyMatchingAttributesFrom()

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.

◆ EmptyGroup()

void FManagedArrayCollection::EmptyGroup ( FName  Group)

Empty the group

参数
Group- The group to empty

◆ FindAttribute()

template<typename T >
TManagedArray< T > * FManagedArrayCollection::FindAttribute ( FName  Name,
FName  Group 
)
inline

Returns attribute(Name) of Type(T) from the group

参数
Name- The name of the attribute
Group- The group that manages the attribute
返回
ManagedArray<T> &

◆ FindAttributeTyped()

template<typename T >
TManagedArray< T > * FManagedArrayCollection::FindAttributeTyped ( FName  Name,
FName  Group 
)
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
返回
ManagedArray<T> &

◆ GetAttribute()

template<typename T >
TManagedArray< T > & FManagedArrayCollection::GetAttribute ( FName  Name,
FName  Group 
)
inline

Returns attribute access of Type(T) from the group

参数
Name- The name of the attribute
Group- The group that manages the attribute
返回
ManagedArray<T> &

◆ HasAttribute()

bool FManagedArrayCollection::HasAttribute ( FName  Name,
FName  Group 
) const

Check for the existence of a attribute

参数
Name- The name of the attribute
Group- The group that manages the attribute

◆ HasGroup()

FORCEINLINE bool FManagedArrayCollection::HasGroup ( FName  Group) const
inline

Check for the existence of a group

参数
Group- The group name

◆ NumElements()

int32 FManagedArrayCollection::NumElements ( FName  Group) const

Number of elements in a group

返回
the group size, and Zero(0) if group does not exist.

◆ RemoveAttribute()

void FManagedArrayCollection::RemoveAttribute ( FName  Name,
FName  Group 
)

Remove the attribute from the collection.

参数
Name- The name of the attribute
Group- The group that manages the attribute

◆ RemoveGroup()

void FManagedArrayCollection::RemoveGroup ( FName  Group)

Remove the group from the collection.

参数
Group- The group that manages the attribute

◆ ReorderElements()

virtual void FManagedArrayCollection::ReorderElements ( FName  Group,
const TArray< int32 > &  NewOrder 
)
virtual

Reorders elements in a group.

NewOrder must be the same length as the group.

被 FGeometryCollection 重载.

◆ Reserve()

void FManagedArrayCollection::Reserve ( int32  Size,
FName  Group 
)

Reserve a group

参数
Size- The size of the group
Group- The group to reserve

◆ Resize()

void FManagedArrayCollection::Resize ( int32  Size,
FName  Group 
)

Resize a group

参数
Size- The size of the group
Group- The group to resize

◆ Serialize()

virtual void FManagedArrayCollection::Serialize ( Chaos::FChaosArchive &  Ar)
virtual

Serialize

被 FGeometryCollection , 以及 FTransformCollection 重载.

◆ SyncGroupSizeFrom()

void FManagedArrayCollection::SyncGroupSizeFrom ( const FManagedArrayCollection &  InCollection,
FName  Group 
)
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

该类的文档由以下文件生成: