Files
UnrealEngineUWP/Engine/Source/Editor/Persona/Private/EditorObjectsTracker.h
aurel cordonnier 50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00

45 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/GCObject.h"
//////////////////////////////////////////////////////////////////////////
// FEditorObjectTracker
class FEditorObjectTracker : public FGCObject
{
public:
FEditorObjectTracker(bool bInAllowOnePerClass = true)
: bAllowOnePerClass(bInAllowOnePerClass)
{}
// FGCObject interface
virtual void AddReferencedObjects( FReferenceCollector& Collector ) override;
virtual FString GetReferencerName() const override
{
return TEXT("FEditorObjectTracker");
}
// End of FGCObject interface
/** Returns an existing editor object for the specified class or creates one
if none exist */
UObject* GetEditorObjectForClass( UClass* EdClass );
void SetAllowOnePerClass(bool bInAllowOnePerClass)
{
bAllowOnePerClass = bInAllowOnePerClass;
}
private:
/** If true, it uses TMap, otherwise, it just uses TArray */
bool bAllowOnePerClass;
/** Tracks editor objects created for details panel */
TMap< UClass*, UObject* > EditorObjMap;
/** Tracks editor objects created for detail panel */
TArray<UObject*> EditorObjectArray;
};