Files
UnrealEngine/Engine/Source/Runtime/Experimental/IndexedCacheStorage/Private/IndexedCacheStorage.cpp
2025-05-18 13:04:45 +08:00

76 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "IndexedCacheStorage.h"
namespace Experimental
{
/**
* Generic implementation of IIndexedCacheStorage
*/
class FGenericIndexedCacheStorage : public Experimental::IIndexedCacheStorage
{
public:
virtual bool SupportsIndexedCacheStorage() override
{
return false;
}
virtual uint32 GetNumIndexedCacheStorages() override
{
return 0;
}
virtual bool CreateCacheStorage(uint64 InRequestNumberOfBytes, int32 CacheStorageIndex) override
{
return false;
}
virtual bool DestroyCacheStorage(int32 InCacheStorageIndex) override
{
return false;
}
virtual void EnumerateCacheStorages(TArray<int32>& OutCacheStorageIndices) override
{
}
virtual void GetCacheStorageInfo(int32 InCacheStorageIndex, uint64& OutCacheStorageSize) override
{
}
virtual void GetCacheStorageMountPath(FString& OutPlatformMountPath, const FString& InMountName) override
{
}
virtual bool MountCacheStorage(FString& OutPlatformMountPath, int32 InCacheStorageIndex, const FString& InMountName) override
{
return false;
}
virtual void UnmountCacheStorage(const FString& InMountName) override
{
}
};
#if !defined(HAS_CUSTOM_INDEXED_CACHE_STORAGE)
# define HAS_CUSTOM_INDEXED_CACHE_STORAGE 0
#endif
#if (HAS_CUSTOM_INDEXED_CACHE_STORAGE == 0)
IIndexedCacheStorage& IIndexedCacheStorageModule::GetOrCreateIndexedCacheStorage()
{
static FGenericIndexedCacheStorage Instance;
return Instance;
}
#endif
IIndexedCacheStorage& IIndexedCacheStorage::Get()
{
return IIndexedCacheStorageModule::Get().GetOrCreateIndexedCacheStorage();
}
}
IMPLEMENT_MODULE(Experimental::IIndexedCacheStorageModule, IndexedCacheStorage);