2021-03-10 12:23:29 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Containers/StringFwd.h"
|
2021-05-31 12:43:42 -04:00
|
|
|
#include "Misc/AsciiSet.h"
|
2021-03-10 12:23:29 -04:00
|
|
|
|
2021-05-27 10:16:47 -04:00
|
|
|
class FCbPackage;
|
2021-05-21 12:24:43 -04:00
|
|
|
class FDerivedDataCacheInterface;
|
2021-05-27 10:16:47 -04:00
|
|
|
enum class ECachePolicy : uint8;
|
2021-05-21 12:24:43 -04:00
|
|
|
|
2021-04-19 09:56:34 -04:00
|
|
|
namespace UE::DerivedData { class FCacheBucket; }
|
2021-05-31 12:43:42 -04:00
|
|
|
namespace UE::DerivedData { class FCacheRecord; }
|
2021-04-19 09:56:34 -04:00
|
|
|
namespace UE::DerivedData { class FCacheRecordBuilder; }
|
2021-05-27 10:16:47 -04:00
|
|
|
namespace UE::DerivedData { class FOptionalCacheRecord; }
|
2021-04-19 09:56:34 -04:00
|
|
|
namespace UE::DerivedData { struct FCacheKey; }
|
2021-03-10 12:23:29 -04:00
|
|
|
|
2021-04-19 09:56:34 -04:00
|
|
|
namespace UE::DerivedData::Private
|
2021-03-10 17:33:38 -04:00
|
|
|
{
|
|
|
|
|
|
2021-05-21 12:24:43 -04:00
|
|
|
// Implemented in DerivedDataCache.cpp
|
|
|
|
|
FDerivedDataCacheInterface* CreateCache();
|
|
|
|
|
|
2021-03-10 12:23:29 -04:00
|
|
|
// Implemented in DerivedDataCacheKey.cpp
|
|
|
|
|
FCacheBucket CreateCacheBucket(FStringView Name);
|
|
|
|
|
|
|
|
|
|
// Implemented in DerivedDataCacheRecord.cpp
|
|
|
|
|
FCacheRecordBuilder CreateCacheRecordBuilder(const FCacheKey& Key);
|
2021-05-27 10:16:47 -04:00
|
|
|
FCbPackage SaveCacheRecord(const FCacheRecord& Record);
|
|
|
|
|
FOptionalCacheRecord LoadCacheRecord(const FCbPackage& Package);
|
2021-03-10 12:23:29 -04:00
|
|
|
|
2021-05-31 12:43:42 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
inline bool IsValidCacheBucketName(FStringView Name)
|
|
|
|
|
{
|
|
|
|
|
constexpr FAsciiSet Valid("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
|
|
|
|
return !Name.IsEmpty() && Name.Len() < 256 && FAsciiSet::HasOnly(Name, Valid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline void AssertValidCacheBucketName(FStringView Name)
|
|
|
|
|
{
|
|
|
|
|
checkf(IsValidCacheBucketName(Name),
|
|
|
|
|
TEXT("A cache bucket name must be alphanumeric, non-empty, and contain fewer than 256 code units. ")
|
|
|
|
|
TEXT("Name: '%.*s'"), Name.Len(), Name.GetData());
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-19 09:56:34 -04:00
|
|
|
} // UE::DerivedData::Private
|