UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ICookedPackageWriter Class Referenceabstract

#include <PackageWriter.h>

+ Inheritance diagram for ICookedPackageWriter:

Classes

struct  FCookCapabilities
 
struct  FCookInfo
 
struct  FDeleteByFree
 
struct  FPreviousCookedBytesData
 
struct  FReferencedPluginsInfo
 
struct  FUpdatePackageModifiedStatusContext
 

Public Types

enum class  EPackageHeaderFormat { PackageFileSummary , ZenPackageSummary }
 
using FBeginCacheForCookedPlatformDataInfo = UE::PackageWriter::Private::FBeginCacheForCookedPlatformDataInfo
 
typedef TUniqueFunction< EPackageWriterResult(FBeginCacheForCookedPlatformDataInfo &Info)> FBeginCacheCallback
 
typedef TUniqueFunction< void(UObject *SourceObject, const TRefCountPtr< UE::Cook::IDeterminismHelper > &DeterminismHelper)> FRegisterDeterminismHelperCallback
 
- Public Types inherited from IPackageWriter
enum class  EWriteOptions {
  None = 0 , WritePackage = 0x01 , WriteSidecars = 0x02 , Write = WritePackage | WriteSidecars ,
  ComputeHash = 0x04 , SaveForDiff = 0x08
}
 
enum class  ECommitStatus {
  Success , Canceled , NothingToCook , Error ,
  NotCommitted
}
 

Public Member Functions

virtual ~ICookedPackageWriter ()=default
 
virtual void SetCooker (UE::PackageWriter::Private::ICookerInterface *CookerInterface)=0
 
virtual FCookCapabilities GetCookCapabilities () const
 
virtual FDateTime GetPreviousCookTime () const
 
virtual ICookedPackageWriterAsCookedPackageWriter () override
 
virtual void Initialize (const FCookInfo &Info)=0
 
virtual void BeginCook (const FCookInfo &Info)=0
 
virtual void EndCook (const FCookInfo &Info)=0
 
virtual TUniquePtr< FAssetRegistryStateLoadPreviousAssetRegistry ()=0
 
virtual FCbObject GetOplogAttachment (FName PackageName, FUtf8StringView AttachmentKey)=0
 
virtual void GetOplogAttachments (TArrayView< FName > PackageNames, TArrayView< FUtf8StringView > AttachmentKeys, TUniqueFunction< void(FName PackageName, FUtf8StringView AttachmentKey, FCbObject &&Attachment)> &&Callback)=0
 
virtual void GetBaseGameOplogAttachments (TArrayView< FName > PackageNames, TArrayView< FUtf8StringView > AttachmentKeys, TUniqueFunction< void(FName PackageName, FUtf8StringView AttachmentKey, FCbObject &&Attachment)> &&Callback)=0
 
virtual ECommitStatus GetCommitStatus (FName PackageName)=0
 
virtual void RemoveCookedPackages (TArrayView< const FName > PackageNamesToRemove)=0
 
virtual void RemoveCookedPackages ()=0
 
virtual void UpdatePackageModifiedStatus (FUpdatePackageModifiedStatusContext &Context)
 
virtual void UpdatePackageModificationStatus (FName PackageName, bool bIncrementallyUnmodified, bool &bInOutShouldIncrementallySkip)
 
virtual bool GetPreviousCookedBytes (const FPackageInfo &Info, FPreviousCookedBytesData &OutData)
 
virtual void CompleteExportsArchiveForDiff (FPackageInfo &Info, FLargeMemoryWriter &ExportsArchive)
 
virtual EPackageWriterResult BeginCacheForCookedPlatformData (FBeginCacheForCookedPlatformDataInfo &Info)
 
virtual void UpdateSaveArguments (FSavePackageArgs &SaveArgs)
 
virtual bool IsAnotherSaveNeeded (FSavePackageResultStruct &PreviousResult, FSavePackageArgs &SaveArgs)
 
virtual TFuture< FCbObjectWriteMPCookMessageForPackage (FName PackageName)=0
 
virtual bool TryReadMPCookMessageForPackage (FName PackageName, FCbObjectView Message)=0
 
virtual IPackageStoreWriterAsPackageStoreWriter ()
 
virtual TMap< FName, TRefCountPtr< FPackageHashes > > & GetPackageHashes ()=0
 
- Public Member Functions inherited from IPackageWriter
virtual ~IPackageWriter ()=default
 
virtual FCapabilities GetCapabilities () const
 
virtual void BeginPackage (const FBeginPackageInfo &Info)=0
 
virtual void CommitPackage (FCommitPackageInfo &&Info)=0
 
virtual void WritePackageData (const FPackageInfo &Info, FLargeMemoryWriter &ExportsArchive, const TArray< FFileRegion > &FileRegions)=0
 
virtual void WriteBulkData (const FBulkDataInfo &Info, const FIoBuffer &BulkData, const TArray< FFileRegion > &FileRegions)=0
 
virtual void WriteAdditionalFile (const FAdditionalFileInfo &Info, const FIoBuffer &FileData)=0
 
virtual void WriteLinkerAdditionalData (const FLinkerAdditionalDataInfo &Info, const FIoBuffer &Data, const TArray< FFileRegion > &FileRegions)=0
 
virtual int64 GetExportsFooterSize ()
 
virtual void WritePackageTrailer (const FPackageTrailerInfo &Info, const FIoBuffer &Data)=0
 
virtual TUniquePtr< FLargeMemoryWriterCreateLinkerArchive (FName PackageName, UObject *Asset, uint16 MultiOutputIndex)=0
 
virtual TUniquePtr< FLargeMemoryWriterCreateLinkerExportsArchive (FName PackageName, UObject *Asset, uint16 MultiOutputIndex)=0
 
virtual void RegisterDeterminismHelper (UObject *SourceObject, const TRefCountPtr< UE::Cook::IDeterminismHelper > &DeterminismHelper)
 
virtual bool IsPreSaveCompleted () const
 

Detailed Description

Interface for cooking that writes cooked packages to storage usable by the runtime game.

Member Typedef Documentation

◆ FBeginCacheCallback

◆ FBeginCacheForCookedPlatformDataInfo

◆ FRegisterDeterminismHelperCallback

Member Enumeration Documentation

◆ EPackageHeaderFormat

Enumerator
PackageFileSummary 
ZenPackageSummary 

Constructor & Destructor Documentation

◆ ~ICookedPackageWriter()

virtual ICookedPackageWriter::~ICookedPackageWriter ( )
virtualdefault

Member Function Documentation

◆ AsCookedPackageWriter()

virtual ICookedPackageWriter * ICookedPackageWriter::AsCookedPackageWriter ( )
inlineoverridevirtual

Downcast function for IPackageWriters that implement the ICookedPackageWriters inherited interface.

Reimplemented from IPackageWriter.

◆ AsPackageStoreWriter()

virtual IPackageStoreWriter * ICookedPackageWriter::AsPackageStoreWriter ( )
inlinevirtual

Downcast function for ICookedPackageWriters that implement the IPackageStoreWriter inherited interface.

◆ BeginCacheForCookedPlatformData()

virtual EPackageWriterResult ICookedPackageWriter::BeginCacheForCookedPlatformData ( FBeginCacheForCookedPlatformDataInfo Info)
inlinevirtual

◆ BeginCook()

virtual void ICookedPackageWriter::BeginCook ( const FCookInfo Info)
pure virtual

Signal the start of a cooking pass

Package data may only be produced after BeginCook() has been called and before EndCook() is called

◆ CompleteExportsArchiveForDiff()

virtual void ICookedPackageWriter::CompleteExportsArchiveForDiff ( FPackageInfo Info,
FLargeMemoryWriter ExportsArchive 
)
inlinevirtual

Append all data to the Exports archive that would normally be done in CommitPackage, used for diffing.

◆ EndCook()

virtual void ICookedPackageWriter::EndCook ( const FCookInfo Info)
pure virtual

Signal the end of a cooking pass.

◆ GetBaseGameOplogAttachments()

virtual void ICookedPackageWriter::GetBaseGameOplogAttachments ( TArrayView< FName PackageNames,
TArrayView< FUtf8StringView AttachmentKeys,
TUniqueFunction< void(FName PackageName, FUtf8StringView AttachmentKey, FCbObject &&Attachment)> &&  Callback 
)
pure virtual

Read Oplog attachments for the given PackageNames in the BaseGame oplog for the current DLC cook. Returns empty objects if current cook is not a DLC cook or the basegame oplog is unavailable. Callback is called for every cross product pair of PackageNames X AttachmentKeys. The Attachment object passed to the callback is empty if not found.

◆ GetCommitStatus()

virtual ECommitStatus ICookedPackageWriter::GetCommitStatus ( FName  PackageName)
pure virtual

Report commit status for the given package. If cooking incrementally, this reports the status from a previous cook if it has not yet been committed in the current cook.

◆ GetCookCapabilities()

virtual FCookCapabilities ICookedPackageWriter::GetCookCapabilities ( ) const
inlinevirtual

Return cook capabilities/settings this PackageWriter has/requires

◆ GetOplogAttachment()

virtual FCbObject ICookedPackageWriter::GetOplogAttachment ( FName  PackageName,
FUtf8StringView  AttachmentKey 
)
pure virtual

Returns an Attachment that was previously commited for the given PackageName. Returns an empty object if not found.

◆ GetOplogAttachments()

virtual void ICookedPackageWriter::GetOplogAttachments ( TArrayView< FName PackageNames,
TArrayView< FUtf8StringView AttachmentKeys,
TUniqueFunction< void(FName PackageName, FUtf8StringView AttachmentKey, FCbObject &&Attachment)> &&  Callback 
)
pure virtual

Callback is called for every cross product pair of PackageNames X AttachmentKeys. The Attachment object passed to the callback is empty if not found.

◆ GetPackageHashes()

virtual TMap< FName, TRefCountPtr< FPackageHashes > > & ICookedPackageWriter::GetPackageHashes ( )
pure virtual

Cooked package writers asynchronously hash the chunks for each package after CommitPackage. Once cooking has completed, use this to acquire the results. This is synced using void UPackage::WaitForAsyncFileWrites() - do not access the results before that completes. Non-const so that the cooking process can Move the map of hashes.

◆ GetPreviousCookedBytes()

virtual bool ICookedPackageWriter::GetPreviousCookedBytes ( const FPackageInfo Info,
FPreviousCookedBytesData OutData 
)
inlinevirtual

Load the bytes of the previously-cooked package, used for diffing

◆ GetPreviousCookTime()

virtual FDateTime ICookedPackageWriter::GetPreviousCookTime ( ) const
inlinevirtual

Return the timestamp of the previous cook, or FDateTime::MaxValue to indicate previous cook should be assumed newer than any other cook data.

◆ Initialize()

virtual void ICookedPackageWriter::Initialize ( const FCookInfo Info)
pure virtual

Delete outdated cooked data, etc.

◆ IsAnotherSaveNeeded()

virtual bool ICookedPackageWriter::IsAnotherSaveNeeded ( FSavePackageResultStruct PreviousResult,
FSavePackageArgs SaveArgs 
)
inlinevirtual

Report whether an additional save is needed and set up for it if so. Used for diffing.

◆ LoadPreviousAssetRegistry()

virtual TUniquePtr< FAssetRegistryState > ICookedPackageWriter::LoadPreviousAssetRegistry ( )
pure virtual

Returns an AssetRegistry describing the previous cook results. This doesn't mean a cook saved off to another directory - it means the AssetRegistry that's living in the directory we are about to cook in to.

◆ RemoveCookedPackages() [1/2]

virtual void ICookedPackageWriter::RemoveCookedPackages ( )
pure virtual

Remove all cooked packages from storage.

◆ RemoveCookedPackages() [2/2]

virtual void ICookedPackageWriter::RemoveCookedPackages ( TArrayView< const FName PackageNamesToRemove)
pure virtual

Remove the given cooked package(s) from storage; they have been modified since the last cook.

◆ SetCooker()

virtual void ICookedPackageWriter::SetCooker ( UE::PackageWriter::Private::ICookerInterface CookerInterface)
pure virtual

Called by the Cooker for PackageWriters it is using. If provided, the interface must be used to handle the virtual functions of the same name on the ICookedPackageWriter.

◆ TryReadMPCookMessageForPackage()

virtual bool ICookedPackageWriter::TryReadMPCookMessageForPackage ( FName  PackageName,
FCbObjectView  Message 
)
pure virtual

Read PackageData written by WriteMPCookMessageForPackage on a CookWorker. Called only on CookDirector.

◆ UpdatePackageModificationStatus()

virtual void ICookedPackageWriter::UpdatePackageModificationStatus ( FName  PackageName,
bool  bIncrementallyUnmodified,
bool bInOutShouldIncrementallySkip 
)
inlinevirtual

◆ UpdatePackageModifiedStatus()

virtual void ICookedPackageWriter::UpdatePackageModifiedStatus ( FUpdatePackageModifiedStatusContext Context)
inlinevirtual

During incremental cooking, signal the cooked package has been checked for changes, and decide whether it should be incrementally skipped.

◆ UpdateSaveArguments()

virtual void ICookedPackageWriter::UpdateSaveArguments ( FSavePackageArgs SaveArgs)
inlinevirtual

Modify the SaveArgs if required before the first Save. Used for diffing.

◆ WriteMPCookMessageForPackage()

virtual TFuture< FCbObject > ICookedPackageWriter::WriteMPCookMessageForPackage ( FName  PackageName)
pure virtual

Asynchronously create a CompactBinary Object message that replicates all of the package data from package save that is collected in memory and written at end of cook rather than being written to disk during package save. Used during MPCook to transfer this information from CookWorker to CookDirector. Called after CommitPackage, and only on CookWorkers.


The documentation for this class was generated from the following file: