UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk > Class Template Reference

#include <UObjectAnnotation.h>

+ Inheritance diagram for FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >:

Public Member Functions

 FUObjectAnnotationChunked () TSAN_SAFE
 
virtual ~FUObjectAnnotationChunked ()
 
void AddAnnotation (const UObjectBase *Object, const TAnnotation &Annotation)
 
void AddAnnotation (const UObjectBase *Object, TAnnotation &&Annotation)
 
void AddAnnotation (int32 Index, const TAnnotation &Annotation)
 
void AddAnnotation (int32 Index, TAnnotation &&Annotation)
 
TAnnotationAddOrGetAnnotation (const UObjectBase *Object, TFunctionRef< TAnnotation()> NewAnnotationFn)
 
TAnnotationAddOrGetAnnotation (int32 Index, TFunctionRef< TAnnotation()> NewAnnotationFn)
 
void RemoveAnnotation (const UObjectBase *Object)
 
void RemoveAnnotation (int32 Index)
 
TAnnotation GetAnnotation (const UObjectBase *Object)
 
TAnnotation GetAnnotation (int32 Index)
 
UE_FORCEINLINE_HINT int32 GetAnnotationCount () const
 
UE_FORCEINLINE_HINT int32 GetMaxAnnotations () const TSAN_SAFE
 
UE_FORCEINLINE_HINT int32 GetMaxAnnottations () const TSAN_SAFE
 
UE_FORCEINLINE_HINT bool IsValidIndex (int32 Index) const
 
void RemoveAllAnnotations ()
 
void TrimAnnotations ()
 
virtual SIZE_T GetAllocatedSize () const override
 
uint32 GetMaxAllocatedSize () const
 
virtual void NotifyUObjectDeleted (const UObjectBase *Object, int32 Index)
 
virtual void OnUObjectArrayShutdown () override
 
- Public Member Functions inherited from FUObjectArray::FUObjectDeleteListener
virtual ~FUObjectDeleteListener ()
 
virtual void NotifyUObjectDeleted (const class UObjectBase *Object, int32 Index)=0
 

Detailed Description

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.

Parameters
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.

Constructor & Destructor Documentation

◆ FUObjectAnnotationChunked()

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

Constructor : Probably not thread safe

◆ ~FUObjectAnnotationChunked()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
virtual FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::~FUObjectAnnotationChunked ( )
inlinevirtual

Member Function Documentation

◆ AddAnnotation() [1/4]

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.

Parameters
ObjectObject to annotate.
AnnotationAnnotation to associate with Object.

◆ AddAnnotation() [2/4]

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

◆ AddAnnotation() [3/4]

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.

Parameters
IndexIndex of object to annotate.
AnnotationAnnotation to associate with Object.

◆ AddAnnotation() [4/4]

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

◆ AddOrGetAnnotation() [1/2]

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

◆ AddOrGetAnnotation() [2/2]

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.

Parameters
IndexIndex of object to annotate.
AnnotationAnnotation to associate with Object.

◆ GetAllocatedSize()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
virtual SIZE_T FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetAllocatedSize ( ) const
inlineoverridevirtual

Returns the memory allocated by the internal array

Reimplemented from FUObjectArray::FUObjectDeleteListener.

◆ GetAnnotation() [1/2]

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

Return the annotation associated with a uobject

Parameters
ObjectObject to return the annotation for

◆ GetAnnotation() [2/2]

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

Return the annotation associated with a uobject

Parameters
IndexIndex of the annotation to return

◆ GetAnnotationCount()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
UE_FORCEINLINE_HINT 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

Returns
the number of elements in the array

◆ GetMaxAllocatedSize()

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

Returns the maximum memory allocated by the internal arrays

◆ GetMaxAnnotations()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
UE_FORCEINLINE_HINT int32 FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::GetMaxAnnotations ( ) 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

Returns
the maximum number of elements in the array

◆ GetMaxAnnottations()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
UE_FORCEINLINE_HINT 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

Returns
the maximum number of elements in the array

◆ IsValidIndex()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
UE_FORCEINLINE_HINT 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.

Parameters
IndexIndex to test
Returns
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

Parameters
Objectobject that has been destroyed
Indexindex of object that is being deleted

◆ OnUObjectArrayShutdown()

template<typename TAnnotation , bool bAutoRemove, int32 NumAnnotationsPerChunk = 64 * 1024>
virtual void FUObjectAnnotationChunked< TAnnotation, bAutoRemove, NumAnnotationsPerChunk >::OnUObjectArrayShutdown ( )
inlineoverridevirtual

Called when UObject Array is being shut down, this is where all listeners should be removed from it

Implements FUObjectArray::FUObjectDeleteListener.

◆ RemoveAllAnnotations()

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

Removes all annotation from the annotation list.

◆ 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.

Parameters
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.

Parameters
ObjectObject to de-annotate.

◆ TrimAnnotations()

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

Frees chunk memory from empty chunks.


The documentation for this class was generated from the following file: