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

#include <UObjectAnnotation.h>

+ Inheritance diagram for FUObjectAnnotationDense< TAnnotation, bAutoRemove >:

Public Member Functions

virtual void NotifyUObjectDeleted (const UObjectBase *Object, int32 Index)
 
virtual void OnUObjectArrayShutdown () override
 
virtual ~FUObjectAnnotationDense ()
 
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)
 
void RemoveAnnotation (const UObjectBase *Object)
 
void RemoveAnnotation (int32 Index)
 
void RemoveAllAnnotations ()
 
TAnnotation GetAnnotation (const UObjectBase *Object)
 
TAnnotation GetAnnotation (int32 Index)
 
TAnnotationGetAnnotationRef (const UObjectBase *Object)
 
TAnnotationGetAnnotationRef (int32 Index)
 
virtual SIZE_T GetAllocatedSize () const 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>
class FUObjectAnnotationDense< TAnnotation, bAutoRemove >

FUObjectAnnotationDense is a helper class that is used to store dense, fast, temporary, editor only, external or other tangential information about 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.

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

◆ ~FUObjectAnnotationDense()

Destructor, removes all annotations, which removes the annotation as a uobject destruction listener

Member Function Documentation

◆ AddAnnotation() [1/4]

template<typename TAnnotation , bool bAutoRemove>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::AddAnnotation ( const UObjectBase Object,
TAnnotation &&  Annotation 
)
inline

◆ AddAnnotation() [3/4]

template<typename TAnnotation , bool bAutoRemove>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::AddAnnotation ( int32  Index,
TAnnotation &&  Annotation 
)
inline

◆ GetAllocatedSize()

template<typename TAnnotation , bool bAutoRemove>
virtual SIZE_T FUObjectAnnotationDense< TAnnotation, bAutoRemove >::GetAllocatedSize ( ) const
inlineoverridevirtual

Returns the memory allocated by the internal array

Reimplemented from FUObjectArray::FUObjectDeleteListener.

◆ GetAnnotation() [1/2]

template<typename TAnnotation , bool bAutoRemove>
TAnnotation FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
TAnnotation FUObjectAnnotationDense< TAnnotation, bAutoRemove >::GetAnnotation ( int32  Index)
inline

Return the annotation associated with a uobject

Parameters
IndexIndex of the annotation to return

◆ GetAnnotationRef() [1/2]

template<typename TAnnotation , bool bAutoRemove>
TAnnotation & FUObjectAnnotationDense< TAnnotation, bAutoRemove >::GetAnnotationRef ( const UObjectBase Object)
inline

Return the annotation associated with a uobject

Parameters
ObjectObject to return the annotation for
Returns
Reference to annotation.

◆ GetAnnotationRef() [2/2]

template<typename TAnnotation , bool bAutoRemove>
TAnnotation & FUObjectAnnotationDense< TAnnotation, bAutoRemove >::GetAnnotationRef ( int32  Index)
inline

Return the annotation associated with a uobject. Adds one if the object has no annotation yet.

Parameters
IndexIndex of the annotation to return
Returns
Reference to the annotation.

◆ NotifyUObjectDeleted()

template<typename TAnnotation , bool bAutoRemove>
virtual void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
virtual void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::RemoveAllAnnotations ( )
inline

Removes all annotation from the annotation list.

◆ RemoveAnnotation() [1/2]

template<typename TAnnotation , bool bAutoRemove>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::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>
void FUObjectAnnotationDense< TAnnotation, bAutoRemove >::RemoveAnnotation ( int32  Index)
inline

Removes an annotation from the annotation list.

Parameters
ObjectObject to de-annotate.

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