Files
UnrealEngineUWP/Engine/Source/Developer/Virtualization/Private/VirtualizationSourceControlBackend.h
paul chipchase f4e06ebd3a Clean up the code organization for virtualization backends
#rb Per.Larsson
#rnx
#preflight 61a8940b9c77d610079ce7da

- Made all backends final, they should not be derived from.
- Added header files for the remaining backends that were cpp only. The headers are in the modules private directory so will not be used elsewhere and it makes it easier to see the interface.

#ROBOMERGE-AUTHOR: paul.chipchase
#ROBOMERGE-SOURCE: CL 18350848 in //UE5/Release-5.0/... via CL 18350854
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18350856 by paul chipchase in ue5-release-engine-test branch]
2021-12-02 06:21:36 -05:00

52 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "IVirtualizationBackend.h"
#include "Containers/StringView.h"
namespace UE::Virtualization
{
/**
* This backend can be used to access payloads stored in source control.
* The backend doesn't 'check out' a payload file but instead will just download the payload as
* a binary blob.
* It is assumed that the files are stored with the same path convention as the file system
* backend, found in Utils::PayloadIdToPath.
*
* Ini file setup:
* 'Name'=(Type=SourceControl, DepotRoot="//XXX/")
* Where 'Name' is the backend name in the hierarchy and 'XXX' is the path in the source control
* depot where the payload files are being stored.
*/
class FSourceControlBackend final : public IVirtualizationBackend
{
public:
explicit FSourceControlBackend(FStringView ConfigName, FStringView InDebugName);
virtual ~FSourceControlBackend() = default;
private:
/* IVirtualizationBackend implementation */
virtual bool Initialize(const FString& ConfigEntry) override;
virtual EPushResult PushData(const FPayloadId& Id, const FCompressedBuffer& Payload, const FPackagePath& PackageContext) override;
virtual FCompressedBuffer PullData(const FPayloadId& Id) override;
virtual bool DoesPayloadExist(const FPayloadId& Id) override;
virtual bool DoPayloadsExist(TArrayView<const FPayloadId> PayloadIds, TArray<bool>& OutResults) override;
private:
void CreateDepotPath(const FPayloadId& PayloadId, FStringBuilderBase& OutPath);
/** The root where the virtualized payloads are stored in source control */
FString DepotRoot;
};
} // namespace UE::Virtualization