FUObjectAnnotationChunked

[FUObjectAnnotationChunked](API\Runtime\CoreUObject\UObject\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.

Windows
MacOS
Linux

Inheritance Hierarchy

FUObjectArray::FUObjectDeleteListener

FUObjectAnnotationChunked

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectAnnotation.h

Include

#include "UObject/UObjectAnnotation.h"

Syntax

template<typename TAnnotation, bool bAutoRemove, int32 NumAnnotationsPerChunk>
class FUObjectAnnotationChunked : public FUObjectArray::FUObjectDeleteListener

Remarks

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.

Constructors

Name Description

Public function

FUObjectAnnotationChunked()

Constructor : Probably not thread safe

Destructors

Name Description

Public function Virtual

~FUObjectAnnotationChunked()

Functions

Name Description

Public function

void

 

AddAnnotation

(
    int32 Index,
    TAnnotation&& Annotation
)

Public function

void

 

AddAnnotation

(
    int32 Index,
    const TAnnotation& Annotation
)

Add an annotation to the annotation list.

Public function

void

 

AddAnnotation

(
    const UObjectBase* Object,
    TAnnotation&& Annotation
)

Public function

void

 

AddAnnotation

(
    const UObjectBase* Object,
    const TAnnotation& Annotation
)

Add an annotation to the annotation list.

Public function

TAnnotation ...

 

AddOrGetAnnotation

(
    const UObjectBase* Object,
    TFunctionRef< TAnnotation()> NewAnn...
)

Public function

TAnnotation ...

 

AddOrGetAnnotation

(
    int32 Index,
    TFunctionRef< TAnnotation()> NewAnn...
)

Add an annotation to the annotation list.

Public function Const

uint32

 

GetAllocatedSize()

Returns the memory allocated by the internal array

Public function

TAnnotation

 

GetAnnotation

(
    int32 Index
)

Return the annotation associated with a uobject

Public function

TAnnotation

 

GetAnnotation

(
    const UObjectBase* Object
)

Return the annotation associated with a uobject

Public function Const

int32

 

GetAnnotationCount()

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

Public function Const

uint32

 

GetMaxAllocatedSize()

Returns the maximum memory allocated by the internal arrays

Public function Const

int32

 

GetMaxAnnottations()

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

Public function Const

bool

 

IsValidIndex

(
    int32 Index
)

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

Public function Virtual

void

 

NotifyUObjectDeleted

(
    const UObjectBase* Object,
    int32 Index
)

Interface for FUObjectAllocator::FUObjectDeleteListener

Public function

void

 

RemoveAllAnnotations()

Removes all annotation from the annotation list.

Public function

void

 

RemoveAnnotation

(
    int32 Index
)

Removes an annotation from the annotation list.

Public function

void

 

RemoveAnnotation

(
    const UObjectBase* Object
)

Removes an annotation from the annotation list.

Public function

void

 

TrimAnnotations()

Frees chunk memory from empty chunks.

Overridden from FUObjectDeleteListener

Name Description

Public function Virtual

void

 

OnUObjectArrayShutdown()

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

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss