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

#include <FileCache.h>

+ Inheritance diagram for IFileCacheHandle:

Public Member Functions

virtual ~IFileCacheHandle ()
 
virtual IMemoryReadStreamRef ReadData (FGraphEventArray &OutCompletionEvents, int64 Offset, int64 BytesToRead, EAsyncIOPriorityAndFlags Priority)=0
 
virtual FGraphEventRef PreloadData (const FFileCachePreloadEntry *PreloadEntries, int32 NumEntries, EAsyncIOPriorityAndFlags Priority)=0
 
virtual void WaitAll ()=0
 

Static Public Member Functions

static CORE_API void EvictAll ()
 
static CORE_API IFileCacheHandleCreateFileCacheHandle (const TCHAR *InFileName, int64 InBaseOffset=0)
 
static CORE_API IFileCacheHandleCreateFileCacheHandle (IAsyncReadFileHandle *FileHandle, int64 InBaseOffset=0)
 
static CORE_API int64 GetFileCacheSize ()
 

Detailed Description

All methods may be safely called from multiple threads simultaneously, unless otherwise noted

Also note, if you create several IFileCacheHandle's to the same file on separate threads these will be considered as individual separate files from the cache point of view and thus each will have their own cache data allocated.

Constructor & Destructor Documentation

◆ ~IFileCacheHandle()

virtual IFileCacheHandle::~IFileCacheHandle ( )
inlinevirtual

Member Function Documentation

◆ CreateFileCacheHandle() [1/2]

IFileCacheHandle * IFileCacheHandle::CreateFileCacheHandle ( const TCHAR InFileName,
int64  InBaseOffset = 0 
)
static

Create a IFileCacheHandle from a filename.

Parameters
InFileNameA path to a file.
Returns
A IFileCacheHandle that can be used to make read requests. This will be a nullptr if the target file can not be accessed for any given reason.

◆ CreateFileCacheHandle() [2/2]

IFileCacheHandle * IFileCacheHandle::CreateFileCacheHandle ( IAsyncReadFileHandle FileHandle,
int64  InBaseOffset = 0 
)
static

Create a IFileCacheHandle from a IAsyncReadFileHandle.

Parameters
FileHandleA valid IAsyncReadFileHandle that has already been created elsewhere.
Returns
A IFileCacheHandle that can be used to make read requests. This will be a nullptr if the FileHandle was not valid.

◆ EvictAll()

void IFileCacheHandle::EvictAll ( )
static

◆ GetFileCacheSize()

int64 IFileCacheHandle::GetFileCacheSize ( )
static

Return size of underlying file cache in bytes.

◆ PreloadData()

virtual FGraphEventRef IFileCacheHandle::PreloadData ( const FFileCachePreloadEntry PreloadEntries,
int32  NumEntries,
EAsyncIOPriorityAndFlags  Priority 
)
pure virtual

Implemented in FFileCacheHandle.

◆ ReadData()

virtual IMemoryReadStreamRef IFileCacheHandle::ReadData ( FGraphEventArray OutCompletionEvents,
int64  Offset,
int64  BytesToRead,
EAsyncIOPriorityAndFlags  Priority 
)
pure virtual

Read a byte range form the file. This can be a high-throughput operation and done lots of times for small reads. The system will handle this efficiently.

Parameters
OutCompletionEventsMust wait until these events are complete before returned data is valid
Returns
Memory stream that contains the requested range. May return nullptr in rare cases if the request could not be serviced Data read from this stream will not be valid until all events returned in OutCompletionEvents are complete

Implemented in FFileCacheHandle.

◆ WaitAll()

virtual void IFileCacheHandle::WaitAll ( )
pure virtual

Wait until all outstanding read requests complete.

Implemented in FFileCacheHandle.


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