Navigation
API > API/Runtime > API/Runtime/CoreUObject
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.
| Name | FUObjectAnnotationChunked |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectAnnotation.h |
| Include Path | #include "UObject/UObjectAnnotation.h" |
Syntax
template<typename TAnnotation, bool bAutoRemove, int32 NumAnnotationsPerChunk>
class FUObjectAnnotationChunked : public FUObjectArray::FUObjectDeleteListener
Inheritance Hierarchy
- FUObjectArray::FUObjectDeleteListener → FUObjectAnnotationChunked
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FUObjectAnnotationChunked() |
Constructor : Probably not thread safe | UObject/UObjectAnnotation.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FUObjectAnnotationChunked() |
UObject/UObjectAnnotation.h |
Structs
| Name | Remarks |
|---|---|
| TAnnotationChunk |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AnnotationArrayCritical | FTransactionallySafeRWLock | Mutex | UObject/UObjectAnnotation.h | |
| Chunks | TArray< TAnnotationChunk > | Primary table to chunks of pointers | UObject/UObjectAnnotation.h | |
| CurrentAllocatedMemory | uint32 | Current allocated memory | UObject/UObjectAnnotation.h | |
| MaxAllocatedMemory | uint32 | Max allocated memory | UObject/UObjectAnnotation.h | |
| MaxAnnotations | int32 | Number of elements we can have | UObject/UObjectAnnotation.h | |
| NumAnnotations | int32 | Number of elements we currently have | UObject/UObjectAnnotation.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddAnnotation
(
const UObjectBase* Object, |
UObject/UObjectAnnotation.h | ||
void AddAnnotation
(
const UObjectBase* Object, |
Add an annotation to the annotation list. | UObject/UObjectAnnotation.h | |
void AddAnnotation
(
int32 Index, |
Add an annotation to the annotation list. | UObject/UObjectAnnotation.h | |
void AddAnnotation
(
int32 Index, |
UObject/UObjectAnnotation.h | ||
TAnnotation & AddOrGetAnnotation
(
int32 Index, |
Add an annotation to the annotation list. | UObject/UObjectAnnotation.h | |
TAnnotation & AddOrGetAnnotation
(
const UObjectBase* Object, |
UObject/UObjectAnnotation.h | ||
TAnnotation GetAnnotation
(
int32 Index |
Return the annotation associated with a uobject | UObject/UObjectAnnotation.h | |
TAnnotation GetAnnotation
(
const UObjectBase* Object |
Return the annotation associated with a uobject | UObject/UObjectAnnotation.h | |
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 | UObject/UObjectAnnotation.h | |
uint32 GetMaxAllocatedSize() |
Returns the maximum memory allocated by the internal arrays | UObject/UObjectAnnotation.h | |
int32 GetMaxAnnotations() |
Return the number max capacity of the array Thread safe, but you know, someone might have added more elements before this even returns | UObject/UObjectAnnotation.h | |
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 | UObject/UObjectAnnotation.h | |
bool IsValidIndex
(
int32 Index |
Return if this index is valid Thread safe, if it is valid now, it is valid forever. | UObject/UObjectAnnotation.h | |
virtual void NotifyUObjectDeleted
(
const UObjectBase* Object, |
Interface for FUObjectAllocator::FUObjectDeleteListener | UObject/UObjectAnnotation.h | |
void RemoveAllAnnotations() |
Removes all annotation from the annotation list. | UObject/UObjectAnnotation.h | |
void RemoveAnnotation
(
const UObjectBase* Object |
Removes an annotation from the annotation list. | UObject/UObjectAnnotation.h | |
void RemoveAnnotation
(
int32 Index |
Removes an annotation from the annotation list. | UObject/UObjectAnnotation.h | |
void TrimAnnotations() |
Frees chunk memory from empty chunks. | UObject/UObjectAnnotation.h |
Overridden from FUObjectDeleteListener
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual SIZE_T GetAllocatedSize() |
Returns the memory allocated by the internal array | UObject/UObjectAnnotation.h | |
virtual void OnUObjectArrayShutdown() |
Called when UObject Array is being shut down, this is where all listeners should be removed from it | UObject/UObjectAnnotation.h |