UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ICookInfo.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "HAL/Platform.h"
7
8#if WITH_EDITOR
9#include "Containers/Array.h"
11#include "Delegates/Delegate.h"
12#include "UObject/CookEnums.h"
13#include "UObject/NameTypes.h"
14#include "Templates/Tuple.h"
15#endif
16
17#if WITH_EDITOR
18
19enum class EDataValidationResult : uint8;
21class ITargetPlatform;
22class IPlugin;
23class UPackage;
24
25namespace UE::Cook { class ICookArtifact; }
26namespace UE::Cook { class IMPCollector; }
27#endif
28
52enum class ECookLoadType : uint8
53{
57
58 Unexpected UE_DEPRECATED(5.6, "Use ECookLoadType::Unspecified") = Unspecified,
59};
60
61#if WITH_EDITOR
62
63namespace UE::Cook
64{
65
72#define EINSTIGATOR_VALUES(CallbackMacro) \
73 \
74 CallbackMacro(InvalidCategory, true) \
75 CallbackMacro(NotYetRequested, true) \
76 CallbackMacro(Unspecified, false) \
77 CallbackMacro(StartupPackage, true) \
78 CallbackMacro(StartupPackageCookLoadScope, true) \
79 CallbackMacro(AlwaysCookMap, true) \
80 CallbackMacro(IniMapSection, false) \
81 CallbackMacro(IniAllMaps, true) \
82 CallbackMacro(CommandLinePackage, true) \
83 CallbackMacro(CommandLineDirectory, true) \
84 CallbackMacro(DirectoryToAlwaysCook, false) \
85 CallbackMacro(FullDepotSearch, true) \
86 CallbackMacro(GameDefaultObject, false) \
87 CallbackMacro(InputSettingsIni, true) \
88 CallbackMacro(StartupSoftObjectPath, true) \
89 CallbackMacro(PackagingSettingsMapToCook, true) \
90 CallbackMacro(ModifyCookDelegate, true) \
91 CallbackMacro(AssetManagerModifyCook, true) \
92 CallbackMacro(AssetManagerModifyDLCCook, true) \
93 CallbackMacro(TargetPlatformExtraPackagesToCook, true) \
94 CallbackMacro(ConsoleCommand, true) \
95 CallbackMacro(CookOnTheFly, true) \
96 CallbackMacro(LegacyIterativeCook, true) \
97 CallbackMacro(PreviousAssetRegistry, true) \
98 CallbackMacro(RequestPackageFunction, true) \
99 CallbackMacro(Dependency, false) \
100 CallbackMacro(HardDependency, false) \
101 CallbackMacro(HardEditorOnlyDependency, false) \
102 CallbackMacro(SoftDependency, false) \
103 CallbackMacro(Unsolicited, false) \
104 CallbackMacro(EditorOnlyLoad, false) \
105 CallbackMacro(SaveTimeHardDependency, false) \
106 CallbackMacro(SaveTimeSoftDependency, false) \
107 CallbackMacro(ForceExplorableSaveTimeSoftDependency, false) \
108 CallbackMacro(GeneratedPackage, false) \
109 CallbackMacro(BuildDependency, false) \
110
111
113enum class EInstigator : uint8
114{
115#define EINSTIGATOR_VALUE_CALLBACK(Name, bAllowUnparameterized) Name,
117#undef EINSTIGATOR_VALUE_CALLBACK
118 Count,
119};
121
123struct FInstigator
124{
125 FName Referencer;
127
129 {
130 }
132 {
133 }
134
135 COREUOBJECT_API FString ToString() const;
136};
137
142enum class EPackageCookRule
143{
144 /* No action specified, the rule will be ignored. */
145 None,
147 AddToCook,
149 NeverCook,
150
151 // IgnoreStartupPackage is not yet implemented, coming in a future version. For now, only FCookLoadScope
152 // provides this functionality.
170 // IgnoreStartupPackage,
171};
172
177struct FPackageCookRule
178{
180 FName PackageName;
181
184
185 // TargetPlatform is not yet implemented, coming in a future version. For now, TargetPlatform is ignored and
186 // all rules apply to all platforms.
192 // const ITargetPlatform* TargetPlatform = nullptr;
193
195 EPackageCookRule CookRule = EPackageCookRule::None;
196};
197
199class ICookInfo
200{
201public:
206 virtual FInstigator GetInstigator(FName PackageName) = 0;
211 virtual TArray<FInstigator> GetInstigatorChain(FName PackageName) = 0;
212
214 virtual UE::Cook::ECookType GetCookType() = 0;
216 virtual UE::Cook::ECookingDLC GetCookingDLC() = 0;
218 virtual FString GetDLCName() = 0;
223 virtual FString GetBasedOnReleaseVersion() = 0;
225 virtual FString GetCreateReleaseVersion() = 0;
226
239 virtual bool IsIncremental() = 0;
240 UE_DEPRECATED(5.6, "Use IsIncremental instead.")
242 {
243 return IsIncremental();
244 }
245
260 virtual FString GetCookOutputFolder(const ITargetPlatform* TargetPlatform) = 0;
261
269 virtual const TSet<IPlugin*>* GetEnabledPlugins(const ITargetPlatform* TargetPlatform) = 0;
270
281 virtual void RegisterCollector(IMPCollector* Collector,
288 virtual void UnregisterCollector(IMPCollector* Collector) = 0;
289
296 virtual void RegisterArtifact(ICookArtifact* Artifact) = 0;
302 virtual void UnregisterArtifact(ICookArtifact* Artifact) = 0;
303
307 virtual void GetCulturesToCook(TArray<FString>& OutCulturesToCook) const = 0;
308};
309
312 FDataValidationContext& /*ValidationContext*/);
315 TArray<FPackageCookRule>& /* InOutPackageCookRules */);
316DECLARE_MULTICAST_DELEGATE_ThreeParams(FCookUpdateDisplayEvent, ICookInfo& /* CookInfo */, int32 /* CookedPackagesCount */, int32 /* CookPendingCount */)
317DECLARE_MULTICAST_DELEGATE_FourParams(FCookSaveIdleEvent, ICookInfo& /* CookInfo */, int32 /* NumPackagesInSaveQueue */, int32 /* NumPendingCookedPlatformData */, bool /* bExpectedDueToSlowBuildOperations */)
318DECLARE_MULTICAST_DELEGATE_TwoParams(FCookLoadIdleEvent, ICookInfo& /* CookInfo */, int32 /* NumPackagesInLoadQueue */)
319
320
321struct FDelegates
322{
323public:
324 UE_DEPRECATED(5.5, "Use CookStarted, possibly restricting to the case CookInfo.GetCookType() == ECookType::ByTheBook.")
326 UE_DEPRECATED(5.5, "Use CookFinished, possibly restricting to the case CookInfo.GetCookType() == ECookType::ByTheBook.")
347};
348
349
360
366
367} // namespace UE::Cook
368
371{
374
377
378private:
381};
382
383#else // WITH_EDITOR
384
396
397// Provide a forward declare but no definition for ICookInfo, to remove the need to have WITH_EDITOR around some types that include a pointer to it
398namespace UE::Cook { class ICookInfo; }
399
400#endif // WITH_EDITOR
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
ECookLoadType
Definition ICookInfo.h:53
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:58
#define DECLARE_MULTICAST_DELEGATE_FourParams(DelegateName, Param1Type, Param2Type, Param3Type, Param4Type)
Definition DelegateCombinations.h:76
#define DECLARE_DELEGATE_RetVal_TwoParams(ReturnValueType, DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:63
#define DECLARE_MULTICAST_DELEGATE_ThreeParams(DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:67
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
const bool
Definition NetworkReplayStreaming.h:178
EDataValidationResult
Definition UObjectGlobals.h:4225
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition DataValidation.h:40
Definition NameTypes.h:617
Definition IPluginManager.h:111
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition Object.h:95
Definition Package.h:216
Category
Definition DiffResults.h:63
FString ToString(uint16 Value)
Definition PathFollowingComponent.cpp:82
Definition CookOnTheFly.h:19
EProcessType
Definition CookEnums.h:32
const TCHAR * LexToString(ECookOnTheFlyMessage Message)
Definition CookOnTheFly.h:59
ECookValidationOptions
Definition CookEnums.h:60
ECookingDLC
Definition CookEnums.h:19
ECookType
Definition CookEnums.h:12
TValue GetCurrentValue(const FPropertyPath &Path, TPred Pred)
Definition SNumericPropertyValue.cpp:95
Definition ICookInfo.h:387
UE_FORCEINLINE_HINT FCookLoadScope(ECookLoadType ScopeType)
Definition ICookInfo.h:388
UE_FORCEINLINE_HINT ~FCookLoadScope()
Definition ICookInfo.h:392
Definition Tuple.h:652