@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
| FUntypedBulkData::FUntypedBulkData | ( | const FUntypedBulkData & | Other | ) |
Copy constructor.
Use the common routine to perform the copy.
| Other | the source array to copy |
| void FUntypedBulkData::ClearBulkDataFlags | ( | uint32 | BulkDataFlagsToClear | ) |
Clears the passed in bulk data flags.
| BulkDataFlagsToClear | Bulk data flags to clear |
| 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.
| Priority | Priority 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. |
| CompleteCallback | Called 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. |
| UserSuppliedMemory | A 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. |
| 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.
| OffsetInBulkData | Offset into the bulk data to start reading from. |
| BytesToRead | The 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. |
| Priority | Priority 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. |
| CompleteCallback | Called 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. |
| UserSuppliedMemory | A 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. |
|
static |
Dumps detailed information of bulk data usage.
| Log | FOutputDevice to use for logging |
| uint32 FUntypedBulkData::GetBulkDataAlignment | ( | ) | const |
Gets the current bulk data alignment.
| uint32 FUntypedBulkData::GetBulkDataFlags | ( | ) | const |
Gets the current bulk data flags.
| int64 FUntypedBulkData::GetBulkDataOffsetInFile | ( | ) | const |
Returns the offset into the file the bulk data is located at.
| int64 FUntypedBulkData::GetBulkDataSize | ( | ) | const |
Returns the size of the bulk data in bytes.
| int64 FUntypedBulkData::GetBulkDataSizeOnDisk | ( | ) | const |
Returns the size of the bulk data on disk.
This can differ from GetBulkDataSize if BULKDATA_SerializeCompressed is set.
| 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 |
| bDiscardInternalCopy | Whether to discard/ free the potentially internally allocated copy of the data |
| FBulkDataBuffer< ElementType > FUntypedBulkData::GetCopyAsBuffer | ( | int64 | RequestedElementCount, |
| bool | bDiscardInternalCopy | ||
| ) |
Returns a copy encapsulated by a FBulkDataBuffer.
| RequestedElementCount | If 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. |
| bDiscardInternalCopy | If true then the BulkData object will free it's internal buffer once called. |
| FName FUntypedBulkData::GetDecompressionFormat | ( | ) | const |
Returns flags usable to decompress the bulk data
| int64 FUntypedBulkData::GetElementCount | ( | ) | const |
Returns the number of elements in this bulk data array.
|
pure virtual |
Returns size in bytes of single element.
Pure virtual that needs to be overloaded in derived classes.
在 TQuantizedLightSampleBulkData< QuantizedLightSampleType > 内被实现.
|
inline |
Returns the filename this bulkdata resides in
|
inline |
Returns the io filename hash associated with this bulk data.
| bool FUntypedBulkData::IsAsyncLoadingComplete | ( | ) | const |
Returns whether the bulk data asynchronous load has completed.
| bool FUntypedBulkData::IsAvailableForUse | ( | ) | const |
Returns whether this bulk data is used
| bool FUntypedBulkData::IsBulkDataLoaded | ( | ) | const |
Returns whether the bulk data is currently loaded and resident in memory.
|
inline |
Returns whether this bulk data is currently stored inline or not
|
inline |
Returns whether this bulk data is currently stored in it's own file or not
|
inline |
Returns whether this bulk data represents optional data or not
| bool FUntypedBulkData::IsStoredCompressedOnDisk | ( | ) | const |
Returns whether the bulk data is stored compressed on disk.
|
inline |
Returns whether this bulk data is accessed via the IoDispatcher or not.
| bool FUntypedBulkData::LoadBulkDataWithFileReader | ( | ) |
Load the bulk data using a file reader.
Works even when no archive is attached to the bulk data..
| void * FUntypedBulkData::Lock | ( | uint32 | LockFlags | ) |
Locks the bulk data and returns a pointer to it.
| LockFlags | Flags determining lock behavior |
| 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
| IAsyncReadFileHandle * FUntypedBulkData::OpenAsyncReadHandle | ( | ) | const |
Opens a new IAsyncReadFileHandle that references the file that the BulkData object represents.
| FUntypedBulkData & FUntypedBulkData::operator= | ( | const FUntypedBulkData & | Other | ) |
Copies the source array into this one after detaching from archive.
| Other | the source array to copy |
| void * FUntypedBulkData::Realloc | ( | int64 | InElementCount | ) |
Change size of locked bulk data.
Only valid if locked via read-write lock.
| InElementCount | Number of elements array should be resized to |
|
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 > 重载.
| 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.
| BulkDataFlagsToSet | Bulk data flags to set |
| 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.
| Ar | Archive to serialize with |
| Owner | Object owning the bulk data |
| Idx | Index of bulk data item being serialized |
| bAttemptFileMapping | If true, attempt to map this instead of loading it into malloc'ed memory |
| FileRegionType | When cooking, a hint describing the type of data, used by some platforms to improve compression ratios |
| void FUntypedBulkData::SerializeBulkData | ( | FArchive & | Ar, |
| void * | Data | ||
| ) |
Serialize just the bulk data portion to/ from the passed in memory.
| Ar | Archive to serialize with |
| Data | Memory to serialize either to or from |
|
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.
| Ar | Archive to serialize with |
| Data | Base pointer to data |
| ElementIndex | Index of element to serialize |
在 TQuantizedLightSampleBulkData< QuantizedLightSampleType > 内被实现.
|
protectedvirtual |
Serializes all elements, a single element at a time, allowing backward compatible serialization and endian swapping to be performed.
| Ar | Archive to serialize with |
| Data | Base pointer to data |
| void FUntypedBulkData::SetBulkDataAlignment | ( | uint32 | BulkDataAlignmentToSet | ) |
Sets the passed in bulk data alignment.
| BulkDataAlignmentToSet | Bulk data alignment to set |
| void FUntypedBulkData::SetBulkDataFlags | ( | uint32 | BulkDataFlagsToSet | ) |
Enables the given flags without affecting any previously set flags.
| BulkDataFlagsToSet | Bulk data flags to set |
| 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.
| void FUntypedBulkData::StoreCompressedOnDisk | ( | ECompressionFlags | CompressionFlags | ) |
Sets whether we should store the data compressed on disk.
| CompressionFlags | Flags to use for compressing the data. Use COMPRESS_NONE for no compression, or something like COMPRESS_ZLIB to compress the data |
| bool FUntypedBulkData::UnloadBulkData | ( | ) |
Deallocates bulk data without detaching the archive, so that further bulk data accesses require a reload.
Only supported in editor builds.