Files
UnrealEngineUWP/Engine/Source/Editor/Persona/Private/EditorObjectsTracker.h
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

41 lines
1.0 KiB
C++

// Copyright 1998-2017 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
void AddReferencedObjects( FReferenceCollector& Collector ) override;
// 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;
};