Files
UnrealEngineUWP/Engine/Source/Developer/DesktopPlatform/Public/TargetReceiptBuildWorker.h
bryan sefcik de1956f47b Ran IWYU on Public headers under Engine/Source/Developer/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21064294 by bryan.sefcik
#jira
#preflight 62d5c2111062f2e63015e598

#ROBOMERGE-OWNER: bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21155249 via CL 21158121 via CL 21161259
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21182053 by bryan sefcik in ue5-main branch]
2022-07-20 12:03:45 -04:00

81 lines
2.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Async/TaskGraphInterfaces.h"
#include "Containers/Array.h"
#include "Containers/Map.h"
#include "Containers/StringFwd.h"
#include "Containers/StringView.h"
#include "Containers/UnrealString.h"
#include "HAL/Platform.h"
#include "IO/IoHash.h"
#include "Misc/Guid.h"
#include "Templates/Tuple.h"
#include "Templates/TypeCompatibleBytes.h"
#include <atomic>
class FTargetReceiptBuildWorkerFactory;
struct FIoHash;
struct FTargetReceipt;
/**
* Globally registers a UE::DerivedData::IBuildWorkerFactory instance that runs an executable built by UnrealBuildTool.
* UnrealBuildTool provides the executable information through a TargetReceipt file.
*/
class DESKTOPPLATFORM_API FTargetReceiptBuildWorker
{
public:
FTargetReceiptBuildWorker(const TCHAR* TargetReceiptFilePath);
virtual ~FTargetReceiptBuildWorker();
private:
/**
* Encapsulates a path used by the worker that has both a local and remote representation.
*/
class FWorkerPath
{
public:
FWorkerPath(FStringView InLocalPathRoot, FStringView InLocalPathSuffix, FStringView InRemotePathRoot = FString(), FStringView InRemotePathSuffix = FString());
FString GetLocalPath() const { return LocalPath; }
FString GetRemotePath() const { return RemotePath; }
private:
FString LocalPath;
FString RemotePath;
};
friend class FPopulateWorkerFromTargetReceiptTask;
friend class FTargetReceiptBuildWorkerFactory;
FTargetReceiptBuildWorkerFactory* GetWorkerFactory();
bool TryAddExecutablePath(FStringView Path);
void PopulateWorkerFromReceipt(const FString& TargetReceiptFilePath);
/**
* Dummy type used to indicate the size of an empty class (no members) with virtual functions (contains a virtual function table).
* The FTargetReceiptBuildWorkerFactory type will be created and stored in the space of one of these.
* Size matching is enforced with a static_assert. The purpose of this is to avoid exposing DerivedDataCache types to
* modules that specify a target receipt worker.
*/
class IPureVirtual
{
virtual void Dummy();
};
static const FGuid WorkerReceiptVersion;
TTypeCompatibleBytes<IPureVirtual> InternalFactory;
FGraphEventRef PopulateTaskRef;
FString Name;
FString Platform;
TMap<FString, FString> EnvironmentVariables;
TArray<FWorkerPath> ExecutablePaths;
using FWorkerPathMeta = TTuple<FIoHash, uint64>;
TArray<FWorkerPathMeta> ExecutableMeta;
FGuid BuildSystemVersion;
TArray<TPair<FString, FGuid>> FunctionVersions;
std::atomic<bool> bAbortRequested;
bool bEnabled;
};