You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* Globals in ClassMaps.cpp have been moved into FHeaderParser, FNativeClassHeaderGenerator, and UnrealHeaderTool_Main(). This is to illustrate how data flows through the program for further refactoring in the near future. * Static variables have been removed from FHeaderParser. * UnrealHeaderTool_Main() and associated functions have been moved into UnrealHeaderToolMain.cpp. * Commented out several sections of code that are not required for code generation. This code will be refactored later. [CL 14221982 by fredric echols in ue5-main branch]
32 lines
942 B
C++
32 lines
942 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ClassMaps.h"
|
|
#include "UnrealHeaderTool.h"
|
|
#include "UnrealTypeDefinitionInfo.h"
|
|
|
|
void FClassDeclarations::AddIfMissing(FName Name, TUniqueFunction<TSharedRef<FClassDeclarationMetaData>()>&& DeclConstructFunc)
|
|
{
|
|
FRWScopeLock Lock(ClassDeclLock, SLT_Write);
|
|
if (!ClassDeclarations.Contains(Name))
|
|
{
|
|
TSharedRef<FClassDeclarationMetaData> ClassDecl = DeclConstructFunc();
|
|
ClassDeclarations.Add(Name, MoveTemp(ClassDecl));
|
|
}
|
|
}
|
|
|
|
FClassDeclarationMetaData* FClassDeclarations::Find(FName Name) const
|
|
{
|
|
FRWScopeLock Lock(ClassDeclLock, SLT_ReadOnly);
|
|
if (const TSharedRef<FClassDeclarationMetaData>* ClassDecl = ClassDeclarations.Find(Name))
|
|
{
|
|
return &ClassDecl->Get();
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
FClassDeclarationMetaData& FClassDeclarations::FindChecked(FName Name) const
|
|
{
|
|
FRWScopeLock Lock(ClassDeclLock, SLT_ReadOnly);
|
|
return ClassDeclarations.FindChecked(Name).Get();
|
|
}
|