Navigation
API > API/Runtime > API/Runtime/CoreUObject
FUObjectAnnotationSparse is a helper class that is used to store sparse, slow, temporary, editor only, external or other low priority information about UObjects.
There is a notion of a default annotation and UObjects default to this annotation and this takes no storage.
Annotations are automatically cleaned up 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.
| Name | FUObjectAnnotationSparse |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectAnnotation.h |
| Include Path | #include "UObject/UObjectAnnotation.h" |
Syntax
template<typename TAnnotation, bool bAutoRemove>
class FUObjectAnnotationSparse : public FUObjectArray::FUObjectDeleteListener
Inheritance Hierarchy
- FUObjectArray::FUObjectDeleteListener → FUObjectAnnotationSparse
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FUObjectAnnotationSparse() |
Constructor, initializes to nothing | UObject/UObjectAnnotation.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FUObjectAnnotationSparse() |
Destructor, removes all annotations, which removes the annotation as a uobject destruction listener | 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 | |
TAnnotation GetAndRemoveAnnotation
(
const UObjectBase* Object |
Removes an annotation from the annotation list and returns the annotation if it had one | UObject/UObjectAnnotation.h | |
TAnnotation GetAnnotation
(
const UObjectBase* Object |
Return the annotation associated with a uobject | UObject/UObjectAnnotation.h | |
const TMap< const UObjectBase *, TAnnotation > & GetAnnotationMap() |
Return the annotation map. Caution, this is for low level use | 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 Reserve
(
int32 ExpectedNumElements |
Reserves memory for the annotation map for the specified number of elements, used to avoid reallocations. | UObject/UObjectAnnotation.h |
Overridden from FUObjectDeleteListener
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual SIZE_T GetAllocatedSize() |
Returns the size of heap memory allocated internally by this listener | 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 |