Files
UnrealEngineUWP/Engine/Source/Developer/DerivedDataCache/Public/DerivedDataBuildJob.h
devin doucette cdedb37d66 DDC: Converted the Build API to UTF-8 where appropriate
#jira UE-133382
#rb Zousar.Shaker
#rnx
#preflight 61e798ee3f00a0a23ef78c49

#ROBOMERGE-AUTHOR: devin.doucette
#ROBOMERGE-SOURCE: CL 18655307 in //UE5/Release-5.0/... via CL 18655320 via CL 18655322
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v900-18638592)

[CL 18655349 by devin doucette in ue5-main branch]
2022-01-19 00:27:48 -05:00

73 lines
2.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
#include "Containers/StringFwd.h"
#include "DerivedDataSharedStringFwd.h"
#include "DerivedDataRequestTypes.h"
template <typename FuncType> class TUniqueFunction;
namespace UE::DerivedData { class FBuildOutput; }
namespace UE::DerivedData { class IBuild; }
namespace UE::DerivedData { class ICache; }
namespace UE::DerivedData { struct FBuildJobCompleteParams; }
namespace UE::DerivedData { struct FCacheKey; }
namespace UE::DerivedData { enum class EBuildStatus : uint32; }
namespace UE::DerivedData
{
using FOnBuildJobComplete = TUniqueFunction<void (FBuildJobCompleteParams&& Params)>;
/**
* A build job is responsible for the execution of one build.
*
* Jobs typically proceed through each one of a sequence of states, though a state may be skipped
* if the action was found in the cache or if the scheduler finds duplicate jobs for a definition
* or an action.
*
* The job depends on the build scheduler to move it through its states. That relationship allows
* the scheduler more control over resources such as: memory, compute, storage, network.
*/
class IBuildJob
{
public:
/** Returns the name by which to identify this job for logging and profiling. */
virtual const FSharedString& GetName() const = 0;
/** Returns the name of the function to build with, or "Unknown" if not resolved yet. */
virtual const FUtf8SharedString& GetFunction() const = 0;
/** Returns the cache associated with this job. */
virtual ICache& GetCache() const = 0;
/** Returns the build system associated with this job. */
virtual IBuild& GetBuild() const = 0;
/** Called by the scheduler to continue this job on the calling thread. */
virtual void StepExecution() = 0;
/** Called by the scheduler to skip remote execution and fall back to local execution if permitted. */
virtual void SkipExecuteRemote() = 0;
/** Called by the scheduler if it has cached output compatible with the build policy. */
virtual void SetOutput(const FBuildOutput& Output) = 0;
};
/** Parameters for the completion callback for build jobs. */
struct FBuildJobCompleteParams
{
/** Job that is complete. */
const IBuildJob& Job;
/** Key for the job in the cache. Empty if the build completes before the key is assigned. */
const FCacheKey& CacheKey;
/** Output for the job that completed or was canceled. */
FBuildOutput&& Output;
/** Detailed status of the job. */
EBuildStatus BuildStatus{};
/** Basic status of the job. */
EStatus Status = EStatus::Error;
};
} // UE::DerivedData