engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表
FUntypedBulkData结构体 参考abstract

@documentation 更多...

#include <BulkData.h>

+ 类 FUntypedBulkData 继承关系图:

Public 成员函数

bool CanLoadFromDisk () const
 Returns true if the data can be loaded from disk.
 
void ClearBulkDataFlags (uint32 BulkDataFlagsToClear)
 Clears the passed in bulk data flags. 更多...
 
IBulkDataIORequest * CreateStreamingRequest (EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const
 Create an async read request for the bulk data. 更多...
 
IBulkDataIORequest * CreateStreamingRequest (int64 OffsetInBulkData, int64 BytesToRead, EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const
 Create an async read request for the bulk data. 更多...
 
bool DoesExist () const
 Returns true if the data references a file that currently exists and can be referenced by the file system.
 
void ForceBulkDataResident ()
 Forces the bulk data to be resident in memory and detaches the archive.
 
 FUntypedBulkData ()
 Constructor, initializing all member variables.
 
 FUntypedBulkData (const FUntypedBulkData &Other)
 Copy constructor. 更多...
 
uint32 GetBulkDataAlignment () const
 Gets the current bulk data alignment. 更多...
 
uint32 GetBulkDataFlags () const
 Gets the current bulk data flags. 更多...
 
int64 GetBulkDataOffsetInFile () const
 Returns the offset into the file the bulk data is located at. 更多...
 
int64 GetBulkDataSize () const
 Returns the size of the bulk data in bytes. 更多...
 
int64 GetBulkDataSizeOnDisk () const
 Returns the size of the bulk data on disk. 更多...
 
void GetCopy (void **Dest, bool bDiscardInternalCopy=true)
 Retrieves a copy of the bulk data. 更多...
 
template<typename ElementType >
FBulkDataBuffer< ElementType > GetCopyAsBuffer (int64 RequestedElementCount, bool bDiscardInternalCopy)
 Returns a copy encapsulated by a FBulkDataBuffer. 更多...
 
FName GetDecompressionFormat () const
 Returns flags usable to decompress the bulk data 更多...
 
int64 GetElementCount () const
 Returns the number of elements in this bulk data array. 更多...
 
virtual int32 GetElementSize () const =0
 Returns size in bytes of single element. 更多...
 
const FString & GetFilename () const
 Returns the filename this bulkdata resides in 更多...
 
FIoFilenameHash GetIoFilenameHash () const
 Returns the io filename hash associated with this bulk data. 更多...
 
bool IsAsyncLoadingComplete () const
 Returns whether the bulk data asynchronous load has completed. 更多...
 
bool IsAvailableForUse () const
 Returns whether this bulk data is used 更多...
 
bool IsBulkDataLoaded () const
 Returns whether the bulk data is currently loaded and resident in memory. 更多...
 
bool IsInlined () const
 Returns whether this bulk data is currently stored inline or not 更多...
 
bool IsInSeparateFile () const
 Returns whether this bulk data is currently stored in it's own file or not 更多...
 
bool IsLocked () const
 Checks if this bulk is locked
 
bool IsOptional () const
 Returns whether this bulk data represents optional data or not 更多...
 
bool IsStoredCompressedOnDisk () const
 Returns whether the bulk data is stored compressed on disk. 更多...
 
bool IsUsingIODispatcher () const
 Returns whether this bulk data is accessed via the IoDispatcher or not. 更多...
 
bool LoadBulkDataWithFileReader ()
 Load the bulk data using a file reader. 更多...
 
void * Lock (uint32 LockFlags)
 Locks the bulk data and returns a pointer to it. 更多...
 
const void * LockReadOnly () const
 Locks the bulk data and returns a read-only pointer to it. 更多...
 
IAsyncReadFileHandle * OpenAsyncReadHandle () const
 Opens a new IAsyncReadFileHandle that references the file that the BulkData object represents. 更多...
 
FUntypedBulkData & operator= (const FUntypedBulkData &Other)
 Copies the source array into this one after detaching from archive. 更多...
 
void * Realloc (int64 InElementCount)
 Change size of locked bulk data. 更多...
 
void RemoveBulkData ()
 Clears/ removes the bulk data and resets element count to 0.
 
void ResetBulkDataFlags (uint32 BulkDataFlagsToSet)
 Enable the given flags and disable all other flags. 更多...
 
void Serialize (FArchive &Ar, UObject *Owner, int32 Idx=INDEX_NONE, bool bAttemptFileMapping=false, EFileRegionType FileRegionType=EFileRegionType::None)
 Serialize function used to serialize this bulk data structure. 更多...
 
void SerializeBulkData (FArchive &Ar, void *Data)
 Serialize just the bulk data portion to/ from the passed in memory. 更多...
 
void SetBulkDataAlignment (uint32 BulkDataAlignmentToSet)
 Sets the passed in bulk data alignment. 更多...
 
void SetBulkDataFlags (uint32 BulkDataFlagsToSet)
 Enables the given flags without affecting any previously set flags. 更多...
 
bool StartAsyncLoading ()
 Initiates a new asynchronous operation to load the dulkdata from disk assuming that it is not already loaded. 更多...
 
void StoreCompressedOnDisk (ECompressionFlags CompressionFlags)
 Sets whether we should store the data compressed on disk. 更多...
 
bool UnloadBulkData ()
 Deallocates bulk data without detaching the archive, so that further bulk data accesses require a reload. 更多...
 
void Unlock () const
 Unlocks bulk data after which point the pointer returned by Lock no longer is valid.
 
virtual ~FUntypedBulkData ()
 Virtual destructor, free'ing allocated memory.
 

静态 Public 成员函数

static void DumpBulkDataUsage (FOutputDevice &Log)
 Dumps detailed information of bulk data usage. 更多...
 

Protected 成员函数

virtual bool RequiresSingleElementSerialization (FArchive &Ar)
 Returns whether single element serialization is required given an archive. 更多...
 
virtual void SerializeElement (FArchive &Ar, void *Data, int64 ElementIndex)=0
 Serializes a single element at a time, allowing backward compatible serialization and endian swapping to be performed. 更多...
 
virtual void SerializeElements (FArchive &Ar, void *Data)
 Serializes all elements, a single element at a time, allowing backward compatible serialization and endian swapping to be performed. 更多...
 

Protected 属性

FString Filename
 name of the package file containing the bulkdata
 
TWeakObjectPtr< UPackage > Package
 weak pointer to the linker this bulk data originally belonged to.
 

详细描述

@documentation

待办事项:
documentation

构造及析构函数说明

◆ FUntypedBulkData()

FUntypedBulkData::FUntypedBulkData ( const FUntypedBulkData &  Other)

Copy constructor.

Use the common routine to perform the copy.

参数
Otherthe source array to copy

成员函数说明

◆ ClearBulkDataFlags()

void FUntypedBulkData::ClearBulkDataFlags ( uint32  BulkDataFlagsToClear)

Clears the passed in bulk data flags.

参数
BulkDataFlagsToClearBulk data flags to clear

◆ CreateStreamingRequest() [1/2]

IBulkDataIORequest * FUntypedBulkData::CreateStreamingRequest ( EAsyncIOPriorityAndFlags  Priority,
FBulkDataIORequestCallBack *  CompleteCallback,
uint8 *  UserSuppliedMemory 
) const

Create an async read request for the bulk data.

This version will load the entire data range that the FUntypedBulkData represents.

参数
PriorityPriority and flags of the request. If this includes AIOP_FLAG_PRECACHE, then memory will never be returned. The request should always be canceled and waited for, even for a precache request.
CompleteCallbackCalled from an arbitrary thread when the request is complete. Can be nullptr, if non-null, must remain valid until it is called. It will always be called.
UserSuppliedMemoryA pointer to memory for the IO request to be written to, it is up to the caller to make sure that it is large enough. If the pointer is null then the system will allocate memory instead.
返回
A request for the read. This is owned by the caller and must be deleted by the caller.

◆ CreateStreamingRequest() [2/2]

IBulkDataIORequest * FUntypedBulkData::CreateStreamingRequest ( int64  OffsetInBulkData,
int64  BytesToRead,
EAsyncIOPriorityAndFlags  Priority,
FBulkDataIORequestCallBack *  CompleteCallback,
uint8 *  UserSuppliedMemory 
) const

Create an async read request for the bulk data.

This version allows the user to request a subset of the data that the FUntypedBulkData represents.

参数
OffsetInBulkDataOffset into the bulk data to start reading from.
BytesToReadThe number of bytes to read. If this request is AIOP_Preache, the size can be anything, even MAX_int64, otherwise the size and offset must be fully contained in the file.
PriorityPriority and flags of the request. If this includes AIOP_FLAG_PRECACHE, then memory will never be returned. The request should always be canceled and waited for, even for a precache request.
CompleteCallbackCalled from an arbitrary thread when the request is complete. Can be nullptr, if non-null, must remain valid until it is called. It will always be called.
UserSuppliedMemoryA pointer to memory for the IO request to be written to, it is up to the caller to make sure that it is large enough. If the pointer is null then the system will allocate memory instead.
返回
A request for the read. This is owned by the caller and must be deleted by the caller.

◆ DumpBulkDataUsage()

static void FUntypedBulkData::DumpBulkDataUsage ( FOutputDevice &  Log)
static

Dumps detailed information of bulk data usage.

参数
LogFOutputDevice to use for logging

◆ GetBulkDataAlignment()

uint32 FUntypedBulkData::GetBulkDataAlignment ( ) const

Gets the current bulk data alignment.

返回
Bulk data alignment currently set

◆ GetBulkDataFlags()

uint32 FUntypedBulkData::GetBulkDataFlags ( ) const

Gets the current bulk data flags.

返回
Bulk data flags currently set

◆ GetBulkDataOffsetInFile()

int64 FUntypedBulkData::GetBulkDataOffsetInFile ( ) const

Returns the offset into the file the bulk data is located at.

返回
Offset into the file or INDEX_NONE in case there is no association

◆ GetBulkDataSize()

int64 FUntypedBulkData::GetBulkDataSize ( ) const

Returns the size of the bulk data in bytes.

返回
Size of the bulk data in bytes

◆ GetBulkDataSizeOnDisk()

int64 FUntypedBulkData::GetBulkDataSizeOnDisk ( ) const

Returns the size of the bulk data on disk.

This can differ from GetBulkDataSize if BULKDATA_SerializeCompressed is set.

返回
Size of the bulk data on disk or INDEX_NONE in case there's no association

◆ GetCopy()

void FUntypedBulkData::GetCopy ( void **  Dest,
bool  bDiscardInternalCopy = true 
)

Retrieves a copy of the bulk data.

参数
Dest[in/out] Pointer to pointer going to hold copy, can point to NULL pointer in which case memory is allocated
bDiscardInternalCopyWhether to discard/ free the potentially internally allocated copy of the data

◆ GetCopyAsBuffer()

template<typename ElementType >
FBulkDataBuffer< ElementType > FUntypedBulkData::GetCopyAsBuffer ( int64  RequestedElementCount,
bool  bDiscardInternalCopy 
)

Returns a copy encapsulated by a FBulkDataBuffer.

参数
RequestedElementCountIf set to greater than 0, the returned FBulkDataBuffer will be limited to this number of elements. This will give an error if larger than the actual number of elements in the BulkData object.
bDiscardInternalCopyIf true then the BulkData object will free it's internal buffer once called.
返回
A FBulkDataBuffer that owns a copy of the BulkData, this might be a subset of the data depending on the value of RequestedSize.

◆ GetDecompressionFormat()

FName FUntypedBulkData::GetDecompressionFormat ( ) const

Returns flags usable to decompress the bulk data

返回
NAME_None if the data was not compressed on disk, or valid format to pass to FCompression::UncompressMemory for this data

◆ GetElementCount()

int64 FUntypedBulkData::GetElementCount ( ) const

Returns the number of elements in this bulk data array.

返回
Number of elements in this bulk data array

◆ GetElementSize()

virtual int32 FUntypedBulkData::GetElementSize ( ) const
pure virtual

Returns size in bytes of single element.

Pure virtual that needs to be overloaded in derived classes.

返回
Size in bytes of single element

在 TQuantizedLightSampleBulkData< QuantizedLightSampleType > 内被实现.

◆ GetFilename()

const FString & FUntypedBulkData::GetFilename ( ) const
inline

Returns the filename this bulkdata resides in

返回
Filename where this bulkdata can be loaded from

◆ GetIoFilenameHash()

FIoFilenameHash FUntypedBulkData::GetIoFilenameHash ( ) const
inline

Returns the io filename hash associated with this bulk data.

返回
Hash or INVALID_IO_FILENAME_HASH if invalid.

◆ IsAsyncLoadingComplete()

bool FUntypedBulkData::IsAsyncLoadingComplete ( ) const

Returns whether the bulk data asynchronous load has completed.

返回
true if bulk data has been loaded or async loading was not used to load this data, false otherwise

◆ IsAvailableForUse()

bool FUntypedBulkData::IsAvailableForUse ( ) const

Returns whether this bulk data is used

返回
true if BULKDATA_Unused is not set

◆ IsBulkDataLoaded()

bool FUntypedBulkData::IsBulkDataLoaded ( ) const

Returns whether the bulk data is currently loaded and resident in memory.

返回
true if bulk data is loaded, false otherwise

◆ IsInlined()

bool FUntypedBulkData::IsInlined ( ) const
inline

Returns whether this bulk data is currently stored inline or not

返回
true if BULKDATA_PayloadAtEndOfFile is not set

◆ IsInSeparateFile()

bool FUntypedBulkData::IsInSeparateFile ( ) const
inline

Returns whether this bulk data is currently stored in it's own file or not

返回
true if BULKDATA_PayloadInSeperateFile is not set

◆ IsOptional()

bool FUntypedBulkData::IsOptional ( ) const
inline

Returns whether this bulk data represents optional data or not

返回
true if BULKDATA_OptionalPayload is set

◆ IsStoredCompressedOnDisk()

bool FUntypedBulkData::IsStoredCompressedOnDisk ( ) const

Returns whether the bulk data is stored compressed on disk.

返回
true if data is compressed on disk, false otherwise

◆ IsUsingIODispatcher()

bool FUntypedBulkData::IsUsingIODispatcher ( ) const
inline

Returns whether this bulk data is accessed via the IoDispatcher or not.

返回
false as the old BulkData API does not support it

◆ LoadBulkDataWithFileReader()

bool FUntypedBulkData::LoadBulkDataWithFileReader ( )

Load the bulk data using a file reader.

Works even when no archive is attached to the bulk data..

返回
Whether the operation succeeded.

◆ Lock()

void * FUntypedBulkData::Lock ( uint32  LockFlags)

Locks the bulk data and returns a pointer to it.

参数
LockFlagsFlags determining lock behavior

◆ LockReadOnly()

const void * FUntypedBulkData::LockReadOnly ( ) const

Locks the bulk data and returns a read-only pointer to it.

This variant can be called on a const bulkdata

◆ OpenAsyncReadHandle()

IAsyncReadFileHandle * FUntypedBulkData::OpenAsyncReadHandle ( ) const

Opens a new IAsyncReadFileHandle that references the file that the BulkData object represents.

返回
A valid handle if the file can be accessed, if it cannot then nullptr.

◆ operator=()

FUntypedBulkData & FUntypedBulkData::operator= ( const FUntypedBulkData &  Other)

Copies the source array into this one after detaching from archive.

参数
Otherthe source array to copy

◆ Realloc()

void * FUntypedBulkData::Realloc ( int64  InElementCount)

Change size of locked bulk data.

Only valid if locked via read-write lock.

参数
InElementCountNumber of elements array should be resized to

◆ RequiresSingleElementSerialization()

virtual bool FUntypedBulkData::RequiresSingleElementSerialization ( FArchive &  Ar)
protectedvirtual

Returns whether single element serialization is required given an archive.

This e.g. can be the case if the serialization for an element changes and the single element serialization code handles backward compatibility.

被 TQuantizedLightSampleBulkData< QuantizedLightSampleType > 重载.

◆ ResetBulkDataFlags()

void FUntypedBulkData::ResetBulkDataFlags ( uint32  BulkDataFlagsToSet)

Enable the given flags and disable all other flags.

This can be used with GetBulkDataFlags() to effectively reset the flags to a previous state.

参数
BulkDataFlagsToSetBulk data flags to set

◆ Serialize()

void FUntypedBulkData::Serialize ( FArchive &  Ar,
UObject *  Owner,
int32  Idx = INDEX_NONE,
bool  bAttemptFileMapping = false,
EFileRegionType  FileRegionType = EFileRegionType::None 
)

Serialize function used to serialize this bulk data structure.

参数
ArArchive to serialize with
OwnerObject owning the bulk data
IdxIndex of bulk data item being serialized
bAttemptFileMappingIf true, attempt to map this instead of loading it into malloc'ed memory
FileRegionTypeWhen cooking, a hint describing the type of data, used by some platforms to improve compression ratios

◆ SerializeBulkData()

void FUntypedBulkData::SerializeBulkData ( FArchive &  Ar,
void *  Data 
)

Serialize just the bulk data portion to/ from the passed in memory.

参数
ArArchive to serialize with
DataMemory to serialize either to or from

◆ SerializeElement()

virtual void FUntypedBulkData::SerializeElement ( FArchive &  Ar,
void *  Data,
int64  ElementIndex 
)
protectedpure virtual

Serializes a single element at a time, allowing backward compatible serialization and endian swapping to be performed.

Needs to be overloaded by derived classes.

参数
ArArchive to serialize with
DataBase pointer to data
ElementIndexIndex of element to serialize

在 TQuantizedLightSampleBulkData< QuantizedLightSampleType > 内被实现.

◆ SerializeElements()

virtual void FUntypedBulkData::SerializeElements ( FArchive &  Ar,
void *  Data 
)
protectedvirtual

Serializes all elements, a single element at a time, allowing backward compatible serialization and endian swapping to be performed.

参数
ArArchive to serialize with
DataBase pointer to data

◆ SetBulkDataAlignment()

void FUntypedBulkData::SetBulkDataAlignment ( uint32  BulkDataAlignmentToSet)

Sets the passed in bulk data alignment.

参数
BulkDataAlignmentToSetBulk data alignment to set

◆ SetBulkDataFlags()

void FUntypedBulkData::SetBulkDataFlags ( uint32  BulkDataFlagsToSet)

Enables the given flags without affecting any previously set flags.

参数
BulkDataFlagsToSetBulk data flags to set

◆ StartAsyncLoading()

bool FUntypedBulkData::StartAsyncLoading ( )

Initiates a new asynchronous operation to load the dulkdata from disk assuming that it is not already loaded.

Note that a new asynchronous loading operation will not be created if one is already in progress.

返回
True if an asynchronous loading operation is in progress by the time that the method returns and false if the data is already loaded or cannot be loaded from disk.

◆ StoreCompressedOnDisk()

void FUntypedBulkData::StoreCompressedOnDisk ( ECompressionFlags  CompressionFlags)

Sets whether we should store the data compressed on disk.

参数
CompressionFlagsFlags to use for compressing the data. Use COMPRESS_NONE for no compression, or something like COMPRESS_ZLIB to compress the data

◆ UnloadBulkData()

bool FUntypedBulkData::UnloadBulkData ( )

Deallocates bulk data without detaching the archive, so that further bulk data accesses require a reload.

Only supported in editor builds.

返回
Whether the operation succeeded.

该结构体的文档由以下文件生成: