UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IndexedCacheStorageManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Containers/Map.h"
8#include "HAL/Platform.h"
11
12#define UE_API INDEXEDCACHESTORAGE_API
13
14namespace Experimental
15{
16
18{
19public:
21 virtual void StartupModule() override;
22 virtual void ShutdownModule() override;
23};
24
26
27// Manager to handle ref-counting of ICS entries
29{
30public:
31
33
34 // Returns whether ICS is supported
36
37 // Returns the cache index registered to that storage name. Registration happens in the config section:
38 // [IndexedCacheStorage]
39 // +Storage=(Name="StorageName",Index=StorageIndex,Mount="StorageMount",EarlyStartup=IniName:[IniSection]:IniKey)
40 // The EarlyStartup attribute is optional. It will try to fetch the value from the specified init path
41 // The value in the ini file can be written as 512, 512KB, 512MB or 512GB
42 // Requires that ones of the entries in the Storage array is called EarlyStartupCache
44
45 // Returns 0 if no early startup size configured
47
48 // returns all registered storage names. The assoaciated cache storages might not have been created
50
51 // Create a new storage at the specified index. Will destroy the previous one if it had a different capacity
53
54 // Destroy the specified cache storage
55 UE_API void DestroyCacheStorage(int32 CacheIndex);
56
57 // Returns 0 if no cache currently exists
59
60 // Returns the path of the mounted cache
61 UE_API FString MountCacheStorage(int32 CacheIndex);
62
63 // Requests unmounting for CacheIndex. Actually unmounts if # of UnmountCacheEntry == # of MountCacheStorage for the same index
64 UE_API void UnmountCacheStorage(int32 CacheIndex);
65
66 // Returns mount name in cache index is mounted, empty if not mounted
67 UE_API FString GetMountName(int32 CacheIndex);
68
69 // Helper to retrieve the mount path. Equivalent to GetCacheStorageMountPath(GetMountName)
70 UE_API FString GetMountPath(int32 CacheIndex);
71
72private:
74
75 void Initialize();
76 void EnsureEarlyStartupCache(const TArray<bool>& CacheStorageAlreadyExists);
77 FCacheStorageMetaData* GetCacheStorageMetaData(int32 CacheIndex);
78
79 TUniquePtr<struct FIndexedCacheStorageMetaData> IndexedCacheStorageMetaData;
80 TMap<FString, int32> StorageNameToStorageIndex;
81 bool bHasRegisteredEntries = false;
82};
83
100
101
102}
103
104#undef UE_API
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_API
Definition SColorGradingComponentViewer.h:12
Definition IndexedCacheStorageManager.cpp:28
Definition IndexedCacheStorageManager.h:29
UE_API bool SupportsIndexedCacheStorage()
Definition IndexedCacheStorageManager.cpp:612
UE_API void DestroyCacheStorage(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:656
UE_API void EnumerateCacheStorages(TArray< FString > &OutCacheStorageNames)
Definition IndexedCacheStorageManager.cpp:635
UE_API bool CreateCacheStorage(uint64 RequestNumberOfBytes, int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:644
static UE_API FIndexedCacheStorageManager & Get()
Definition IndexedCacheStorageManager.cpp:302
UE_API FString GetMountPath(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:716
UE_API void UnmountCacheStorage(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:692
UE_API FString GetMountName(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:704
UE_API uint64 GetCacheEarlyStartupSize(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:623
UE_API int32 GetStorageIndex(const FString &CacheStorageName)
Definition IndexedCacheStorageManager.cpp:617
UE_API FString MountCacheStorage(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:680
UE_API uint64 GetCacheStorageCapacity(int32 CacheIndex)
Definition IndexedCacheStorageManager.cpp:668
Definition IndexedCacheStorageManager.h:18
virtual void StartupModule() override
Definition IndexedCacheStorageModule.cpp:10
virtual void ShutdownModule() override
Definition IndexedCacheStorageModule.cpp:15
Definition ModuleInterface.h:14
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition RobinHoodHashTable.h:18
Definition IndexedCacheStorageManager.h:85
const int32 MountPoint
Definition IndexedCacheStorageManager.h:98
FIndexedCacheStorageScopeMount(int32 InMountPoint)
Definition IndexedCacheStorageManager.h:86
~FIndexedCacheStorageScopeMount()
Definition IndexedCacheStorageManager.h:92
FString MountPath
Definition IndexedCacheStorageManager.h:97