Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FPreloadableArchive Class Reference

#include <PreloadableFile.h>

+ Inheritance diagram for FPreloadableArchive:
+ Collaboration diagram for FPreloadableArchive:

Classes

struct  FSavedReadCompleteArguments
 

Public Types

enum  Flags {
  None = 0x0 , ModeBits = 0x1 , PreloadHandle = 0x0 , PreloadBytes = 0x1 ,
  Prime = 0x2
}
 
enum  { DefaultPrimeSize = 1024 , DefaultPageSize = 64*1024 }
 
typedef TUniqueFunction< FArchive *()> FCreateArchive
 
typedef TUniqueFunction< IAsyncReadFileHandle *()> FCreateAsyncArchive
 

Public Member Functions

 FPreloadableArchive (FStringView ArchiveName)
 
virtual ~FPreloadableArchive ()
 
void SetPageSize (int64 PageSize)
 
void InitializeAsync (FCreateArchive &&InCreateArchiveFunction, uint32 InFlags=Flags::None, int64 PrimeSize=DefaultPrimeSize)
 
void InitializeAsync (FCreateAsyncArchive &&InCreateAsyncArchiveFunction, uint32 InFlags=Flags::None, int64 PrimeSize=DefaultPrimeSize)
 
bool IsInitialized () const
 
void WaitForInitialization () const
 
bool StartPreload ()
 
void StopPreload ()
 
bool IsPreloading () const
 
bool AllocateCache ()
 
void ReleaseCache ()
 
bool IsCacheAllocated () const
 
FArchiveDetachLowerLevel ()
 
virtual void Serialize (void *V, int64 Length) final
 
virtual void Seek (int64 InPos) final
 
virtual int64 Tell () final
 
virtual int64 TotalSize () final
 
virtual bool Close () final
 
virtual FString GetArchiveName () const final
 
- Public Member Functions inherited from FArchive
 FArchive ()=default
 
 FArchive (const FArchive &)=default
 
FArchiveoperator= (const FArchive &ArchiveToCopy)=default
 
 ~FArchive ()=default
 
virtual FArchiveoperator<< (FName &Value)
 
virtual FArchiveoperator<< (FText &Value)
 
virtual FArchiveoperator<< (UObject *&Value)
 
virtual FArchiveoperator<< (FField *&Value)
 
template<class T >
FORCEINLINE FArchiveoperator<< (TCheckedObjPtr< T > &Value)
 
virtual FArchiveoperator<< (struct FLazyObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FSoftObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FSoftObjectPath &Value)
 
virtual FArchiveoperator<< (struct FWeakObjectPtr &Value)
 
virtual void ForceBlueprintFinalization ()
 
virtual void SerializeBits (void *V, int64 LengthBits)
 
virtual void SerializeInt (uint32 &Value, uint32 Max)
 
virtual void SerializeIntPacked (uint32 &Value)
 
virtual void Preload (UObject *Object)
 
FArchiveStateGetArchiveState ()
 
const FArchiveStateGetArchiveState () const
 
virtual void AttachBulkData (UObject *Owner, FBulkData *BulkData)
 
virtual void AttachBulkData (UE::Serialization::FEditorBulkData *BulkData)
 
virtual void DetachBulkData (FBulkData *BulkData, bool bEnsureBulkDataIsLoaded)
 
virtual void DetachBulkData (UE::Serialization::FEditorBulkData *BulkData, bool bEnsureBulkDataIsLoaded)
 
virtual bool SerializeBulkData (FBulkData &BulkData, const struct FBulkDataSerializationParams &Params)
 
virtual bool IsProxyOf (FArchive *InOther) const
 
virtual bool Precache (int64 PrecacheOffset, int64 PrecacheSize)
 
virtual void FlushCache ()
 
virtual bool SetCompressionMap (TArray< struct FCompressedChunk > *CompressedChunks, ECompressionFlags CompressionFlags)
 
virtual void Flush ()
 
void SerializeCompressed (void *V, int64 Length, FName CompressionFormatCannotChange, ECompressionFlags Flags=COMPRESS_NoFlags, bool bTreatBufferAsFileReader=false)
 
void SerializeCompressedNew (void *V, int64 Length, FName CompressionFormatToEncode, FName CompressionFormatToDecodeOldV1Files, ECompressionFlags Flags=COMPRESS_NoFlags, bool bTreatBufferAsFileReader=false, int64 *OutPartialReadLength=nullptr)
 
void SerializeCompressedNew (void *V, int64 Length)
 
void ByteSwap (void *V, int32 Length)
 
FORCEINLINE FArchiveByteOrderSerialize (void *V, int32 Length)
 
void StartSerializingDefaults ()
 
void StopSerializingDefaults ()
 
virtual void MarkScriptSerializationStart (const UObject *Obj)
 
virtual void MarkScriptSerializationEnd (const UObject *Obj)
 
virtual void MarkSearchableName (const UObject *TypeObject, const FName &ValueName) const
 
template<typename FmtType , typename... Types>
void Logf (const FmtType &Fmt, Types... Args)
 
virtual void UsingCustomVersion (const struct FGuid &Guid)
 
virtual FArchiveGetCacheableArchive ()
 
virtual void PushSerializedProperty (struct FProperty *InProperty, const bool bIsEditorOnlyProperty)
 
virtual void PopSerializedProperty (struct FProperty *InProperty, const bool bIsEditorOnlyProperty)
 
virtual bool AttachExternalReadDependency (FExternalReadCallback &ReadCallback)
 
template<SIZE_T Size>
FORCEINLINE bool FastPathLoad (void *InDest)
 
virtual void PushFileRegionType (EFileRegionType Type)
 
virtual void PopFileRegionType ()
 
void SetArchiveState (const FArchiveState &InState)
 
void SetError ()
 
void ClearError ()
 
virtual FArchiveStateGetInnermostState ()
 
virtual void CountBytes (SIZE_T InNum, SIZE_T InMax)
 
virtual FLinkerGetLinker ()
 
virtual bool AtEnd ()
 
FORCEINLINE bool IsByteSwapping ()
 
void ThisContainsCode ()
 
void ThisContainsMap ()
 
void ThisRequiresLocalizationGather ()
 
virtual UObjectGetArchetypeFromLoader (const UObject *Obj)
 
FORCEINLINE FPackageFileVersion UEVer () const
 
FORCEINLINE int32 UE4Ver () const
 
FORCEINLINE int32 LicenseeUEVer () const
 
FORCEINLINE FEngineVersionBase EngineVer () const
 
uint32 EngineNetVer () const
 
uint32 GameNetVer () const
 
int32 CustomVer (const struct FGuid &Key) const
 
FORCEINLINE bool IsLoading () const
 
FORCEINLINE bool IsLoadingFromCookedPackage () const
 
FORCEINLINE bool IsSaving () const
 
FORCEINLINE bool IsTransacting () const
 
FORCEINLINE bool IsTextFormat () const
 
FORCEINLINE bool WantBinaryPropertySerialization () const
 
FORCEINLINE bool UseUnversionedPropertySerialization () const
 
FORCEINLINE bool IsForcingUnicode () const
 
FORCEINLINE bool IsPersistent () const
 
FORCEINLINE bool GetError () const
 
FORCEINLINE bool IsError () const
 
FORCEINLINE bool IsCriticalError () const
 
FORCEINLINE bool ContainsCode () const
 
FORCEINLINE bool ContainsMap () const
 
FORCEINLINE bool RequiresLocalizationGather () const
 
FORCEINLINE bool ForceByteSwapping () const
 
FORCEINLINE bool IsSerializingDefaults () const
 
FORCEINLINE bool IsIgnoringArchetypeRef () const
 
FORCEINLINE bool DoDelta () const
 
FORCEINLINE bool DoIntraPropertyDelta () const
 
FORCEINLINE bool IsIgnoringOuterRef () const
 
FORCEINLINE bool IsIgnoringClassGeneratedByRef () const
 
FORCEINLINE bool IsIgnoringClassRef () const
 
FORCEINLINE bool IsAllowingLazyLoading () const
 
FORCEINLINE bool IsObjectReferenceCollector () const
 
FORCEINLINE bool IsModifyingWeakAndStrongReferences () const
 
FORCEINLINE bool IsCountingMemory () const
 
FORCEINLINE uint32 GetPortFlags () const
 
FORCEINLINE bool HasAnyPortFlags (uint32 Flags) const
 
FORCEINLINE bool HasAllPortFlags (uint32 Flags) const
 
FORCEINLINE uint32 GetDebugSerializationFlags () const
 
FORCEINLINE bool ShouldSkipBulkData () const
 
FORCEINLINE int64 GetMaxSerializeSize () const
 
virtual const FCustomVersionContainerGetCustomVersions () const
 
virtual void SetCustomVersions (const FCustomVersionContainer &CustomVersionContainer)
 
virtual void ResetCustomVersions ()
 
void SetCustomVersion (const struct FGuid &Key, int32 Version, FName FriendlyName)
 
void SetByteSwapping (bool Enabled)
 
void SetPortFlags (uint32 InPortFlags)
 
void SetDebugSerializationFlags (uint32 InCustomFlags)
 
bool IsFilterEditorOnly () const
 
virtual void SetFilterEditorOnly (bool InFilterEditorOnly)
 
bool IsSaveGame () const
 
FORCEINLINE bool IsNetArchive () const
 
FORCEINLINE bool IsCooking () const
 
FORCEINLINE const ITargetPlatformCookingTarget () const
 
void SetCookData (FArchiveCookData *InCookData)
 
FArchiveCookDataGetCookData ()
 
FORCEINLINE FArchiveCookContextGetCookContext ()
 
virtual bool UseToResolveEnumerators () const
 
virtual bool ShouldSkipProperty (const FProperty *InProperty) const
 
virtual void SetSerializedProperty (FProperty *InProperty)
 
FORCEINLINE struct FPropertyGetSerializedProperty () const
 
void GetSerializedPropertyChain (TArray< struct FProperty * > &OutProperties) const
 
FORCEINLINE const FArchiveSerializedPropertyChainGetSerializedPropertyChain () const
 
virtual void SetSerializedPropertyChain (const FArchiveSerializedPropertyChain *InSerializedPropertyChain, struct FProperty *InSerializedPropertyOverride=nullptr)
 
virtual void SetSerializeContext (FUObjectSerializeContext *InLoadContext)
 
virtual FUObjectSerializeContextGetSerializeContext ()
 
virtual void Reset ()
 
virtual void SetIsLoading (bool bInIsLoading)
 
virtual void SetIsLoadingFromCookedPackage (bool bInIsLoadingFromCookedPackage)
 
virtual void SetIsSaving (bool bInIsSaving)
 
virtual void SetIsTransacting (bool bInIsTransacting)
 
virtual void SetIsTextFormat (bool bInIsTextFormat)
 
virtual void SetWantBinaryPropertySerialization (bool bInWantBinaryPropertySerialization)
 
virtual void SetUseUnversionedPropertySerialization (bool bInUseUnversioned)
 
virtual void SetForceUnicode (bool bInForceUnicode)
 
virtual void SetIsPersistent (bool bInIsPersistent)
 
virtual void SetUEVer (FPackageFileVersion InVer)
 
FORCEINLINE void SetUE4Ver (int32 InVer)
 
virtual void SetLicenseeUEVer (int32 InVer)
 
virtual void SetEngineVer (const FEngineVersionBase &InVer)
 
virtual void SetEngineNetVer (const uint32 InEngineNetVer)
 
virtual void SetGameNetVer (const uint32 InGameNetVer)
 
FORCEINLINE bool ShouldSkipCompilingAssets () const
 

Protected Member Functions

void InitializeInternalAsync (FCreateArchive &&InCreateArchiveFunction, FCreateAsyncArchive &&InCreateAsyncArchiveFunction, uint32 InFlags, int64 PrimeSize)
 
void InitializeInternal (FCreateArchive &&InCreateArchiveFunction, FCreateAsyncArchive &&InCreateAsyncArchiveFunction, uint32 Flags, int64 PrimeSize)
 
void PausePreload ()
 
void ResumePreload ()
 
bool ResumePreloadNonRecursive ()
 
void OnReadComplete (bool bCanceled, IAsyncReadRequest *ReadRequest)
 
void FreeRetiredRequests ()
 
void SerializeSynchronously (void *V, int64 Length)
 
- Protected Member Functions inherited from FArchive
void SetShouldSkipCompilingAssets (bool Enabled)
 

Protected Attributes

FString ArchiveName
 
int64 Pos = 0
 
int64 Size = -1
 
FEventPendingAsyncComplete = nullptr
 
TAtomic< boolbInitialized
 
TAtomic< boolbIsPreloading
 
TAtomic< boolbIsPreloadingPaused
 
uint8CacheBytes = nullptr
 
TAtomic< int64CacheEnd
 
TUniquePtr< IAsyncReadFileHandle > AsynchronousHandle
 
TUniquePtr< FArchiveSynchronousArchive
 
TArray< IAsyncReadRequest * > RetiredRequests
 
int64 PageSize = DefaultPageSize
 
FCriticalSection PreloadLock
 
bool bReadCompleteWasCalledInline = false
 
bool bIsInlineReadComplete = false
 
struct FPreloadableArchive::FSavedReadCompleteArguments SavedReadCompleteArguments
 

Friends

class FPreloadableFileProxy
 

Additional Inherited Members

- Public Attributes inherited from FArchive
FFastPathLoadBufferActiveFPLB
 
FFastPathLoadBuffer InlineFPLB
 
uint8 ArContainsCode: 1
 
uint8 ArContainsMap: 1
 
uint8 ArRequiresLocalizationGather: 1
 
uint8 ArForceByteSwapping: 1
 
uint8 ArIgnoreArchetypeRef: 1
 
uint8 ArNoDelta: 1
 
uint8 ArNoIntraPropertyDelta: 1
 
uint8 ArIgnoreOuterRef: 1
 
uint8 ArIgnoreClassGeneratedByRef: 1
 
uint8 ArIgnoreClassRef: 1
 
uint8 ArAllowLazyLoading: 1
 
uint8 ArIsObjectReferenceCollector: 1
 
uint8 ArIsModifyingWeakAndStrongReferences: 1
 
uint8 ArIsCountingMemory: 1
 
uint8 ArShouldSkipBulkData: 1
 
uint8 ArIsFilterEditorOnly: 1
 
uint8 ArIsSaveGame: 1
 
uint8 ArIsNetArchive: 1
 
uint8 ArUseCustomPropertyList: 1
 
int32 ArSerializingDefaults
 
uint32 ArPortFlags
 
int64 ArMaxSerializeSize
 
const struct FCustomPropertyListNodeArCustomPropertyList
 
- Static Protected Member Functions inherited from FArchive
static void LinkProxy (FArchiveState &Inner, FArchiveState &Proxy)
 
static void UnlinkProxy (FArchiveState &Inner, FArchiveState &Proxy)
 

Detailed Description

A read-only archive that adds support for asynchronous preloading and priming to an inner archive.

This class supports two mutually-exclusive modes: PreloadBytes: An asynchronous inner archive is opened using the passed-in CreateAsyncArchive function; this call is made asynchronously on a TaskGraph thread. The size is read during initialization. After initialization, when StartPreload is called, an array of bytes equal in size to the inner archive's size is allocated, and an asynchronous ReadRequest is sent to the IAsyncReadFileHandle to read the first <PageSize> bytes of the file. Upon completion of each in-flight ReadRequest, another asynchronous ReadRequest is issued, until the entire file has been read. If serialize functions are called beyond the bytes of the file that have been cached so far, they requests are satisfied by synchronous reads.

Activate this mode by passing an FCreateArchive to InitializeAsync. PreloadHandle: A synchronous inner archive is opened using the passed-in CreateArchive function; this call is made asynchronously on a TaskGraph thread. Optionally, a precache request is sent to the inner archive for the first <PrimeSize> bytes; this call is also made asynchronously. The created and primed lower-level FArchive can then be detached from this class and handed off to a new owner.

Activate this mode by passing an FCreateAsyncArchive and (optionally, for the precache request) Flags::Prime to InitializeAsync.

This class is not threadsafe. The public interface can be used at the same time as internal asynchronous tasks are executing, but the public interface can not be used from multiple threads at once.

Definition at line 49 of file PreloadableFile.h.

Member Typedef Documentation

◆ FCreateArchive

◆ FCreateAsyncArchive

Definition at line 53 of file PreloadableFile.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
DefaultPrimeSize 
DefaultPageSize 

Definition at line 67 of file PreloadableFile.h.

◆ Flags

Enumerator
None 
ModeBits 
PreloadHandle 
PreloadBytes 
Prime 

Definition at line 55 of file PreloadableFile.h.

Constructor & Destructor Documentation

◆ FPreloadableArchive()

FPreloadableArchive::FPreloadableArchive ( FStringView ArchiveName)

◆ ~FPreloadableArchive()

virtual FPreloadableArchive::~FPreloadableArchive ( )
virtual

Member Function Documentation

◆ AllocateCache()

bool FPreloadableArchive::AllocateCache ( )

When in PreloadBytes mode, allocate if necessary the memory for the preloaded bytes. Return whether the memory is now allocated.

◆ Close()

virtual bool FPreloadableArchive::Close ( )
finalvirtual

Attempts to close and finalize any handles used for backing data storage, returns true if it succeeded.

Reimplemented from FArchive.

◆ DetachLowerLevel()

FArchive * FPreloadableArchive::DetachLowerLevel ( )

Return the LowerLevel FArchive if it has been allocated. May return null, even if the FPreloadableFile is currently active. If return value is non-null, caller is responsible for deleting it.

◆ FreeRetiredRequests()

void FPreloadableArchive::FreeRetiredRequests ( )
protected

◆ GetArchiveName()

virtual FString FPreloadableArchive::GetArchiveName ( ) const
finalvirtual

Returns the name of the Archive. Useful for getting the name of the package a struct or object is in when a loading error occurs.

This is overridden for the specific Archive Types

Reimplemented from FArchive.

◆ InitializeAsync() [1/2]

void FPreloadableArchive::InitializeAsync ( FCreateArchive && InCreateArchiveFunction,
uint32 InFlags = Flags::None,
int64 PrimeSize = DefaultPrimeSize )

Initialize the FPreloadableFile asynchronously, performing FileOpen operations on another thread. Use IsInitialized or WaitForInitialization to check progress.

◆ InitializeAsync() [2/2]

void FPreloadableArchive::InitializeAsync ( FCreateAsyncArchive && InCreateAsyncArchiveFunction,
uint32 InFlags = Flags::None,
int64 PrimeSize = DefaultPrimeSize )

◆ InitializeInternal()

void FPreloadableArchive::InitializeInternal ( FCreateArchive && InCreateArchiveFunction,
FCreateAsyncArchive && InCreateAsyncArchiveFunction,
uint32 Flags,
int64 PrimeSize )
protected

Helper function for InitializeAsync, called from a TaskGraph thread.

◆ InitializeInternalAsync()

void FPreloadableArchive::InitializeInternalAsync ( FCreateArchive && InCreateArchiveFunction,
FCreateAsyncArchive && InCreateAsyncArchiveFunction,
uint32 InFlags,
int64 PrimeSize )
protected

Helper function for InitializeAsync, sets up the asynchronous call to InitializeInternal

◆ IsCacheAllocated()

bool FPreloadableArchive::IsCacheAllocated ( ) const

Return whether the cache is currently allocated.

◆ IsInitialized()

bool FPreloadableArchive::IsInitialized ( ) const

Return whether InitializeAsync has completed. If Close is called, state returns to false until the next call to InitializeAsync.

◆ IsPreloading()

bool FPreloadableArchive::IsPreloading ( ) const

Return whether preloading is in progress. Value may not be up to date since asynchronous work might complete in a race condition.

◆ OnReadComplete()

void FPreloadableArchive::OnReadComplete ( bool bCanceled,
IAsyncReadRequest * ReadRequest )
protected

◆ PausePreload()

void FPreloadableArchive::PausePreload ( )
protected

◆ ReleaseCache()

void FPreloadableArchive::ReleaseCache ( )

Free all memory used by the cache or for preloading (calling StopPreload if necessary).

◆ ResumePreload()

void FPreloadableArchive::ResumePreload ( )
protected

◆ ResumePreloadNonRecursive()

bool FPreloadableArchive::ResumePreloadNonRecursive ( )
protected

◆ Seek()

virtual void FPreloadableArchive::Seek ( int64 InPos)
finalvirtual

Attempts to set the current offset into backing data storage, this will do nothing if there is no storage.

Reimplemented from FArchive.

◆ Serialize()

virtual void FPreloadableArchive::Serialize ( void * V,
int64 Length )
finalvirtual

Reimplemented from FArchive.

◆ SerializeSynchronously()

void FPreloadableArchive::SerializeSynchronously ( void * V,
int64 Length )
protected

◆ SetPageSize()

void FPreloadableArchive::SetPageSize ( int64 PageSize)

Set the PageSize used read requests made to the LowerLevel Archive in PreloadBytes mode when reading bytes into the In-Memory cache. Invalid to set after Initialization; PageSize must be constant during use.

◆ StartPreload()

bool FPreloadableArchive::StartPreload ( )

When in PreloadBytes mode, if not already preloading, allocate if necessary the memory for the preloaded bytes and start the chain of asynchronous ReadRequests for the bytes. Returns whether preloading is now active.

◆ StopPreload()

void FPreloadableArchive::StopPreload ( )

Cancel any current asynchronous ReadRequests and wait for the asynchronous work to exit.

◆ Tell()

virtual int64 FPreloadableArchive::Tell ( )
finalvirtual

Returns the current location within the backing data storage, which can possibly be passed to Seek later to restore a read/write location. If this returns -1, there is no backing data storage and Seek will not function.

Reimplemented from FArchive.

◆ TotalSize()

virtual int64 FPreloadableArchive::TotalSize ( )
finalvirtual

Return the size of the file, or -1 if the file does not exist. This is also the amount of memory that will be allocated by AllocateCache.

Reimplemented from FArchive.

◆ WaitForInitialization()

void FPreloadableArchive::WaitForInitialization ( ) const

Wait for InitializeAsync to complete if it is running, otherwise return immediately.

Friends And Related Symbol Documentation

◆ FPreloadableFileProxy

friend class FPreloadableFileProxy
friend

Definition at line 192 of file PreloadableFile.h.

Member Data Documentation

◆ ArchiveName

FString FPreloadableArchive::ArchiveName
protected

Definition at line 127 of file PreloadableFile.h.

◆ AsynchronousHandle

TUniquePtr<IAsyncReadFileHandle> FPreloadableArchive::AsynchronousHandle
protected

The handle used for PreloadBytes mode, to fulfull ReadReqeusts.

Definition at line 152 of file PreloadableFile.h.

◆ bInitialized

TAtomic<bool> FPreloadableArchive::bInitialized
protected

Threadsafe variable that returns true only after all asynchronous initialization is complete. Is also reset to false when public-interface users call Close().

Definition at line 136 of file PreloadableFile.h.

◆ bIsInlineReadComplete

bool FPreloadableArchive::bIsInlineReadComplete = false
protected

Set to true during the ReadRequest call to allow us to detect if OnReadComplete is called inline on the same thread from ReadRequest.

Definition at line 169 of file PreloadableFile.h.

◆ bIsPreloading

TAtomic<bool> FPreloadableArchive::bIsPreloading
protected

Threadsafe variable that is true only during the period between initialization until Preloading stops (either due to EOF reached or due to Serialize turning it off.

Definition at line 138 of file PreloadableFile.h.

◆ bIsPreloadingPaused

TAtomic<bool> FPreloadableArchive::bIsPreloadingPaused
protected

Variable that is set to true from the public interface thread to signal that (temporarily) no further ReadRequests should be sent when the currently active one completes.

Definition at line 140 of file PreloadableFile.h.

◆ bReadCompleteWasCalledInline

bool FPreloadableArchive::bReadCompleteWasCalledInline = false
protected

Set to true if OnReadComplete is called inline on the same thread from ReadRequest; we need special handling for this case.

Definition at line 167 of file PreloadableFile.h.

◆ CacheBytes

uint8* FPreloadableArchive::CacheBytes = nullptr
protected

An array of bytes of size Size. Non-null only in PreloadBytes mode and in-between calls to AllocateCache/ReleaseCache.

Definition at line 143 of file PreloadableFile.h.

◆ CacheEnd

TAtomic<int64> FPreloadableArchive::CacheEnd
protected

Number of bytes in CacheBytes that have already been read. This is used in Serialize to check which bytes are available and in preloading to know for which bytes to issue a read request. This variable is read-only threadsafe. It is guaranteed to be written only after the bytes in CacheBytes have finished writing, and it is guaranteed to be written before bIsPreloading is written. It is not fully threadsafe; threads that need to write to CacheEnd need to do their Read/Write within the PreloadLock CriticalSection.

Definition at line 149 of file PreloadableFile.h.

◆ PageSize

int64 FPreloadableArchive::PageSize = DefaultPageSize
protected

The number of bytes requested from the AsynchronousHandle in each ReadRequest. Larger values have slightly faster results due to per-call overhead, but add greater latency to Serialize calls that read past the end of the cache.

Definition at line 162 of file PreloadableFile.h.

◆ PendingAsyncComplete

FEvent* FPreloadableArchive::PendingAsyncComplete = nullptr
protected

An Event used for synchronization with asynchronous tasks - InitializingAsync or receiving ReadRequests from the AsynchronousHandle.

Definition at line 134 of file PreloadableFile.h.

◆ Pos

int64 FPreloadableArchive::Pos = 0
protected

The Offset into the file or preloaded bytes that will be used in the next call to Serialize.

Definition at line 129 of file PreloadableFile.h.

◆ PreloadLock

FCriticalSection FPreloadableArchive::PreloadLock
protected

CriticalSection used to synchronize access to the CacheBytes.

Definition at line 165 of file PreloadableFile.h.

◆ RetiredRequests

TArray<IAsyncReadRequest*> FPreloadableArchive::RetiredRequests
protected

ReadRequests that have completed but we have not yet deleted.

Definition at line 160 of file PreloadableFile.h.

◆ SavedReadCompleteArguments

struct FPreloadableArchive::FSavedReadCompleteArguments FPreloadableArchive::SavedReadCompleteArguments
protected

◆ Size

int64 FPreloadableArchive::Size = -1
protected

The number of bytes in the file.

Definition at line 131 of file PreloadableFile.h.

◆ SynchronousArchive

TUniquePtr<FArchive> FPreloadableArchive::SynchronousArchive
protected

The archive used in PreloadHandle mode or to service Serialize requests that are beyond CacheEnd when in PreloadBytes mode.

Definition at line 154 of file PreloadableFile.h.


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