Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataBuild.h
devin doucette 35393bbb2b DDC: Split FPayload into separate FValue and FValueId types
A payload was conceptually a value with an ID. That has been formalized by removing the ID from the payload and having separate FValue and FValueId types. This separation cleans up the API in a few areas, and provides a more natural path to providing a basic key/value API.

#rb Zousar.Shaker
#rnx
#preflight 61d704c04c252480ca284d61

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18531844 in //UE5/Release-5.0/... via CL 18531856
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18531864 by devin doucette in ue5-release-engine-test branch]
2022-01-06 11:05:57 -05:00

118 lines
4.3 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 a IBuildFunction, with a unique name and version, to add values 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 value keys.
*
* 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