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

#include <AsyncFileHandle.h>

+ Inheritance diagram for IAsyncReadRequest:

Public Member Functions

 IAsyncReadRequest (FAsyncFileCallBack *InCallback, bool bInSizeRequest, uint8 *UserSuppliedMemory)
 
virtual ~IAsyncReadRequest ()
 
UE_FORCEINLINE_HINT bool PollCompletion ()
 
bool WaitCompletion (float TimeLimitSeconds=0.0f)
 
virtual void EnsureCompletion ()
 
void Cancel ()
 
int64 GetSizeResults ()
 
uint8GetReadResults ()
 
- Public Member Functions inherited from IAsyncReadRequestFixLayout
virtual ~IAsyncReadRequestFixLayout ()=default
 

Protected Member Functions

 TSAN_ATOMIC (bool) bDataIsReady
 
 TSAN_ATOMIC (bool) bCompleteAndCallbackCalled
 
 TSAN_ATOMIC (bool) bCompleteSync
 
 TSAN_ATOMIC (bool) bCanceled
 
virtual void WaitCompletionImpl (float TimeLimitSeconds)=0
 
virtual void CancelImpl ()=0
 
virtual void ReleaseMemoryOwnershipImpl ()=0
 
void SetDataComplete ()
 
void SetAllComplete ()
 
void SetComplete ()
 

Protected Attributes

union { 
 
   PTRINT   Size 
 
   uint8 *   Memory 
 
};  
 
FAsyncFileCallBack Callback
 
const bool bSizeRequest
 
const bool bUserSuppliedMemory
 

Constructor & Destructor Documentation

◆ IAsyncReadRequest()

IAsyncReadRequest::IAsyncReadRequest ( FAsyncFileCallBack InCallback,
bool  bInSizeRequest,
uint8 UserSuppliedMemory 
)
inline

◆ ~IAsyncReadRequest()

virtual IAsyncReadRequest::~IAsyncReadRequest ( )
inlinevirtual

Member Function Documentation

◆ Cancel()

void IAsyncReadRequest::Cancel ( )
inline

Cancel the request. This is a non-blocking async call and so does not ensure completion!

◆ CancelImpl()

virtual void IAsyncReadRequest::CancelImpl ( )
protectedpure virtual

◆ EnsureCompletion()

virtual void IAsyncReadRequest::EnsureCompletion ( )
inlinevirtual

Waits for the request to complete, with an additional guarantee that the second consecutive call won't ever block, which is not a case for WaitCompletion().

Reimplemented in FGenericBaseRequest.

◆ GetReadResults()

uint8 * IAsyncReadRequest::GetReadResults ( )
inline

Return the bytes of a completed read request. Not legal to call unless the request is complete.

Returns
Returned memory block which if non-null contains the bytes read. Caller owns the memory block and must call FMemory::Free on it when done. Can be null if the file was not found or could not be read or the request was cancelled, or the request had AIOP_FLAG_PRECACHE.

◆ GetSizeResults()

int64 IAsyncReadRequest::GetSizeResults ( )
inline

Return the size of a completed size request. Not legal to call unless the request is complete.

Returns
Returned size of the file or -1 if the file was not found, the request was canceled or other error.

◆ PollCompletion()

UE_FORCEINLINE_HINT bool IAsyncReadRequest::PollCompletion ( )
inline

Nonblocking poll of the state of completion.

Returns
true if the request is complete

◆ ReleaseMemoryOwnershipImpl()

virtual void IAsyncReadRequest::ReleaseMemoryOwnershipImpl ( )
protectedpure virtual

Transfer ownership of Memory from the async request to the outside caller (called in response to GetReadResults). It's only relevant to Read requests, in which case the most common use is to update (decrease) the STAT_AsyncFileMemory stat which is typically incremented when async requests allocate Memory. It doesn't play any role in Size requests, so it may be left empty for them.

Implemented in FGenericSizeRequest, FGenericReadRequest, FMicrosoftReadRequest, FMicrosoftSizeRequest, FMicrosoftFailedRequest, FAsyncReadRequestNull, UE::BulkData::Private::FChunkReadFileRequest, FPakSizeRequest, FPakReadRequestBase, and FPakProcessedReadRequest.

◆ SetAllComplete()

void IAsyncReadRequest::SetAllComplete ( )
inlineprotected

◆ SetComplete()

void IAsyncReadRequest::SetComplete ( )
inlineprotected

◆ SetDataComplete()

void IAsyncReadRequest::SetDataComplete ( )
inlineprotected

◆ TSAN_ATOMIC() [1/4]

IAsyncReadRequest::TSAN_ATOMIC ( bool  )
protected

◆ TSAN_ATOMIC() [2/4]

IAsyncReadRequest::TSAN_ATOMIC ( bool  )
protected

◆ TSAN_ATOMIC() [3/4]

IAsyncReadRequest::TSAN_ATOMIC ( bool  )
protected

◆ TSAN_ATOMIC() [4/4]

IAsyncReadRequest::TSAN_ATOMIC ( bool  )
protected

◆ WaitCompletion()

bool IAsyncReadRequest::WaitCompletion ( float  TimeLimitSeconds = 0.0f)
inline

Waits for the request to complete, but not longer than the given time limit

Parameters
TimeLimitSecondsZero to wait forever, otherwise the maximum amount of time to wait.
Returns
true if the request is complete

◆ WaitCompletionImpl()

virtual void IAsyncReadRequest::WaitCompletionImpl ( float  TimeLimitSeconds)
protectedpure virtual

Waits for the request to complete, but not longer than the given time limit

Parameters
TimeLimitSecondsZero to wait forever, otherwise the maximum amount of time to wait.
Returns
true if the request is complete

Implemented in FMicrosoftReadRequest, FMicrosoftSizeRequest, FMicrosoftFailedRequest, FAsyncReadRequestNull, UE::BulkData::Private::FChunkReadFileRequest, FPakSizeRequest, FPakReadRequestBase, FPakProcessedReadRequest, and FGenericBaseRequest.

Member Data Documentation

◆ [union]

union { ... } IAsyncReadRequest

◆ bSizeRequest

const bool IAsyncReadRequest::bSizeRequest
protected

◆ bUserSuppliedMemory

const bool IAsyncReadRequest::bUserSuppliedMemory
protected

◆ Callback

FAsyncFileCallBack IAsyncReadRequest::Callback
protected

◆ Memory

uint8* IAsyncReadRequest::Memory

◆ Size

PTRINT IAsyncReadRequest::Size

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