engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk > 模板类 参考

FUObjectAnnotationChunked is a helper class that is used to store dense, fast and temporary, editor only, external or other tangential information about subsets of UObjects. 更多...

#include <UObjectAnnotation.h>

+ 类 FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk > 继承关系图:

Public 成员函数

void AddAnnotation (const UObjectBase *Object, const TAnnotation &Annotation)
 Add an annotation to the annotation list. 更多...
 
void AddAnnotation (int32 Index, const TAnnotation &Annotation)
 Add an annotation to the annotation list. 更多...
 
TAnnotation & AddOrGetAnnotation (int32 Index, TFunctionRef< TAnnotation()> NewAnnotationFn)
 Add an annotation to the annotation list. 更多...
 
 FUObjectAnnotationChunked () TSAN_SAFE
 Constructor : Probably not thread safe
 
uint32 GetAllocatedSize () const
 Returns the memory allocated by the internal array
 
FORCEINLINE TAnnotation GetAnnotation (const UObjectBase *Object)
 Return the annotation associated with a uobject 更多...
 
FORCEINLINE TAnnotation GetAnnotation (int32 Index)
 Return the annotation associated with a uobject 更多...
 
FORCEINLINE int32 GetAnnotationCount () const
 Return the number of elements in the array Thread safe, but you know, someone might have added more elements before this even returns 更多...
 
uint32 GetMaxAllocatedSize () const
 Returns the maximum memory allocated by the internal arrays
 
FORCEINLINE int32 GetMaxAnnottations () const TSAN_SAFE
 Return the number max capacity of the array Thread safe, but you know, someone might have added more elements before this even returns 更多...
 
FORCEINLINE bool IsValidIndex (int32 Index) const
 Return if this index is valid Thread safe, if it is valid now, it is valid forever. 更多...
 
virtual void NotifyUObjectDeleted (const UObjectBase *Object, int32 Index)
 Interface for FUObjectAllocator::FUObjectDeleteListener 更多...
 
virtual void OnUObjectArrayShutdown () override
 Called when UObject Array is being shut down, this is where all listeners should be removed from it
 
void RemoveAllAnnotations ()
 Removes all annotation from the annotation list.
 
void RemoveAnnotation (const UObjectBase *Object)
 Removes an annotation from the annotation list. 更多...
 
void RemoveAnnotation (int32 Index)
 Removes an annotation from the annotation list. 更多...
 
void TrimAnnotations ()
 Frees chunk memory from empty chunks.
 
- 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
 

详细描述

template<typename TAnnotation, bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
class FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >

FUObjectAnnotationChunked is a helper class that is used to store dense, fast and temporary, editor only, external or other tangential information about subsets of UObjects.

There is a notion of a default annotation and UObjects default to this annotation.

Annotations are automatically returned to the default when UObjects are destroyed. Annotation are not "garbage collection aware", so it isn't safe to store pointers to other UObjects in an annotation unless external guarantees are made such that destruction of the other object removes the annotation. The advantage of FUObjectAnnotationChunked is that it can reclaim memory if subsets of UObjects within predefined chunks no longer have any annotations associated with them.

参数
TAnnotationtype of the annotation
bAutoRemoveif true, annotation will automatically be removed, otherwise in non-final builds it will verify that the annotation was removed by other means prior to destruction.

成员函数说明

◆ AddAnnotation() [1/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::AddAnnotation ( const UObjectBase *  Object,
const TAnnotation &  Annotation 
)
inline

Add an annotation to the annotation list.

If the Annotation is the default, then the annotation is removed.

参数
ObjectObject to annotate.
AnnotationAnnotation to associate with Object.

◆ AddAnnotation() [2/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::AddAnnotation ( int32  Index,
const TAnnotation &  Annotation 
)
inline

Add an annotation to the annotation list.

If the Annotation is the default, then the annotation is removed.

参数
IndexIndex of object to annotate.
AnnotationAnnotation to associate with Object.

◆ AddOrGetAnnotation()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
TAnnotation & FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::AddOrGetAnnotation ( int32  Index,
TFunctionRef< TAnnotation()>  NewAnnotationFn 
)
inline

Add an annotation to the annotation list.

If the Annotation is the default, then the annotation is removed.

参数
IndexIndex of object to annotate.
AnnotationAnnotation to associate with Object.

◆ GetAnnotation() [1/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
FORCEINLINE TAnnotation FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetAnnotation ( const UObjectBase *  Object)
inline

Return the annotation associated with a uobject

参数
ObjectObject to return the annotation for

◆ GetAnnotation() [2/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
FORCEINLINE TAnnotation FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetAnnotation ( int32  Index)
inline

Return the annotation associated with a uobject

参数
IndexIndex of the annotation to return

◆ GetAnnotationCount()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
FORCEINLINE int32 FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetAnnotationCount ( ) const
inline

Return the number of elements in the array Thread safe, but you know, someone might have added more elements before this even returns

返回
the number of elements in the array

◆ GetMaxAnnottations()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
FORCEINLINE int32 FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetMaxAnnottations ( ) const
inline

Return the number max capacity of the array Thread safe, but you know, someone might have added more elements before this even returns

返回
the maximum number of elements in the array

◆ IsValidIndex()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
FORCEINLINE bool FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::IsValidIndex ( int32  Index) const
inline

Return if this index is valid Thread safe, if it is valid now, it is valid forever.

Other threads might be adding during this call.

参数
IndexIndex to test
返回
true, if this is a valid

◆ NotifyUObjectDeleted()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
virtual void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::NotifyUObjectDeleted ( const UObjectBase *  Object,
int32  Index 
)
inlinevirtual

Interface for FUObjectAllocator::FUObjectDeleteListener

参数
Objectobject that has been destroyed
Indexindex of object that is being deleted

◆ RemoveAnnotation() [1/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::RemoveAnnotation ( const UObjectBase *  Object)
inline

Removes an annotation from the annotation list.

参数
ObjectObject to de-annotate.

◆ RemoveAnnotation() [2/2]

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::RemoveAnnotation ( int32  Index)
inline

Removes an annotation from the annotation list.

参数
ObjectObject to de-annotate.

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