Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataBuild.h
devin doucette 7ae4b64cd6 DDC: Removed IBuild::Load[Type] in favor of exported functions
#rb Zousar.Shaker
#rnx

#ROBOMERGE-SOURCE: CL 17083958 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v853-17066230)

[CL 17083970 by devin doucette in ue5-release-engine-test branch]
2021-08-06 11:58:24 -04:00

119 lines
4.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/StringFwd.h"
#define UE_API DERIVEDDATACACHE_API
struct FGuid;
namespace UE::DerivedData { class FBuildActionBuilder; }
namespace UE::DerivedData { class FBuildDefinitionBuilder; }
namespace UE::DerivedData { class FBuildInputsBuilder; }
namespace UE::DerivedData { class FBuildOutputBuilder; }
namespace UE::DerivedData { class FBuildSession; }
namespace UE::DerivedData { class IBuildFunctionRegistry; }
namespace UE::DerivedData { class IBuildInputResolver; }
namespace UE::DerivedData { class IBuildScheduler; }
namespace UE::DerivedData { class IBuildWorkerRegistry; }
namespace UE::DerivedData { enum class EPriority : uint8; }
namespace UE::DerivedData
{
/**
* Interface to the build system.
*
* Executing a build typically requires a definition, input resolver, session, and function.
*
* Use IBuild::CreateDefinition() to make a new build definition, or use IBuild::LoadDefinition()
* to load a build definition that was previously saved. This references the function to execute,
* and the inputs needed by the function.
*
* Use IBuild::CreateSession() to make a new build session with a build input resolver to resolve
* input references into the referenced data. Use FBuildSession::Build() to schedule a definition
* to build, along with any of its transitive build dependencies.
*
* Implement IBuildFunction, with a unique name and version, to add payloads to the build context
* based on constants and inputs in the context. Use TBuildFunctionFactory to add the function to
* the registry at IBuild::GetFunctionRegistry() to allow the build job to find it.
*/
class IBuild
{
public:
virtual ~IBuild() = default;
/**
* Create a build definition builder.
*
* @param Name The name by which to identify this definition for logging and profiling.
* @param Function The name of the build function with which to build this definition.
*/
virtual FBuildDefinitionBuilder CreateDefinition(FStringView Name, FStringView Function) = 0;
/**
* Create a build action builder.
*
* @param Name The name by which to identify this action for logging and profiling.
* @param Function The name of the build function that produced this action.
*/
virtual FBuildActionBuilder CreateAction(FStringView Name, FStringView Function) = 0;
/**
* Create a build inputs builder.
*
* @param Name The name by which to identify the inputs for logging and profiling.
*/
virtual FBuildInputsBuilder CreateInputs(FStringView Name) = 0;
/**
* Create a build output builder.
*
* @param Name The name by which to identify this output for logging and profiling.
* @param Function The name of the build function that produced this output.
*/
virtual FBuildOutputBuilder CreateOutput(FStringView Name, FStringView Function) = 0;
/**
* Create a build session.
*
* An input resolver is required for the session to perform builds with unresolved inputs, or
* to resolve build payload keys. An input resolver is optional when the session is used only
* to build actions with any inputs provided to the session directly.
*
* A default scheduler is used if one is not provided. Using the default is recommended.
*
* @param Name The name by which to identify this session for logging and profiling.
* @param InputResolver The input resolver to resolve inputs for requested builds. Optional.
* @param Scheduler The scheduler for builds created through the session. Optional.
*/
virtual FBuildSession CreateSession(FStringView Name, IBuildInputResolver* InputResolver = nullptr, IBuildScheduler* Scheduler = nullptr) = 0;
/**
* Returns the version of the build system.
*
* This version is expected to change very infrequently, only when formats and protocols used by
* the build system are changed in a way that breaks compatibility. This version is incorporated
* into build actions to keep the build output separate for different build versions.
*/
virtual const FGuid& GetVersion() const = 0;
/**
* Returns the build function registry used by the build system.
*/
virtual IBuildFunctionRegistry& GetFunctionRegistry() const = 0;
/**
* Returns the build worker registry used by the build system.
*/
virtual IBuildWorkerRegistry& GetWorkerRegistry() const = 0;
};
/** Returns a reference to the build system. Asserts if not available. */
UE_API IBuild& GetBuild();
} // UE::DerivedData
#undef UE_API