#include <BulkData.h>
|
| | FBulkData ()=default |
| |
| COREUOBJECT_API | FBulkData (const FBulkData &Other) |
| |
| COREUOBJECT_API | ~FBulkData () |
| |
| COREUOBJECT_API FBulkData & | operator= (const FBulkData &Other) |
| |
| COREUOBJECT_API int64 | GetBulkDataSize () const |
| |
| COREUOBJECT_API int64 | GetBulkDataSizeOnDisk () const |
| |
| COREUOBJECT_API int64 | GetBulkDataOffsetInFile () const |
| |
| COREUOBJECT_API bool | IsStoredCompressedOnDisk () const |
| |
| COREUOBJECT_API bool | CanLoadFromDisk () const |
| |
| COREUOBJECT_API bool | DoesExist () const |
| |
| COREUOBJECT_API FName | GetDecompressionFormat () const |
| |
| COREUOBJECT_API bool | IsBulkDataLoaded () const |
| |
| COREUOBJECT_API bool | IsAsyncLoadingComplete () const |
| |
| COREUOBJECT_API bool | IsAvailableForUse () const |
| |
| bool | IsOptional () const |
| |
| bool | IsInlined () const |
| |
| bool | IsInSeparateFile () const |
| |
| bool | IsInExternalResource () const |
| |
| bool | IsUsingIODispatcher () const |
| |
| bool | IsDataMemoryMapped () const |
| |
| bool | IsSingleUse () const |
| |
| bool | IsDuplicateNonOptional () const |
| |
| COREUOBJECT_API void | SetBulkDataFlags (uint32 BulkDataFlagsToSet) |
| |
| COREUOBJECT_API void | ResetBulkDataFlags (uint32 BulkDataFlagsToSet) |
| |
| COREUOBJECT_API uint32 | GetBulkDataFlags () const |
| |
| COREUOBJECT_API uint32 | GetBulkDataAlignment () const |
| |
| COREUOBJECT_API void | ClearBulkDataFlags (uint32 BulkDataFlagsToClear) |
| |
| FIoFilenameHash | GetIoFilenameHash () const |
| |
| COREUOBJECT_API FIoChunkId | CreateChunkId () const |
| |
| COREUOBJECT_API FString | GetDebugName () const |
| |
| COREUOBJECT_API void | GetCopy (void **Dest, bool bDiscardInternalCopy=true) |
| |
| COREUOBJECT_API void * | Lock (uint32 LockFlags) |
| |
| COREUOBJECT_API const void * | LockReadOnly () const |
| |
| COREUOBJECT_API void * | Realloc (int64 ElementCount, int64 ElementSize) |
| |
| COREUOBJECT_API void | Unlock () const |
| |
| bool | IsLocked () const |
| |
| bool | IsUnlocked () const |
| |
| COREUOBJECT_API void | RemoveBulkData () |
| |
| COREUOBJECT_API void | ForceBulkDataResident () |
| |
| COREUOBJECT_API void | StoreCompressedOnDisk (FName CompressionFormat) |
| |
| COREUOBJECT_API bool | UnloadBulkData () |
| |
| COREUOBJECT_API void | Serialize (FArchive &Ar, UObject *Owner, bool bAttemptFileMapping, int32 ElementSize, EFileRegionType FileRegionType) |
| |
| void | SerializeBulkData (FArchive &Ar, void *Data, EBulkDataFlags InBulkDataFlags) |
| |
| FOwnedBulkDataPtr * | StealFileMapping () |
| |
| COREUOBJECT_API void | GetBulkDataVersions (FArchive &InlineArchive, FPackageFileVersion &OutUEVersion, int32 &OutLicenseeUEVersion, FCustomVersionContainer &OutCustomVersions) const |
| |
| COREUOBJECT_API IAsyncReadFileHandle * | OpenAsyncReadHandle () const |
| |
| COREUOBJECT_API IBulkDataIORequest * | CreateStreamingRequest (EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const |
| |
| COREUOBJECT_API IBulkDataIORequest * | CreateStreamingRequest (int64 OffsetInBulkData, int64 BytesToRead, EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const |
| |
◆ BulkDataRangeArray
◆ FSerializeBulkDataElements
◆ FBulkData() [1/2]
Constructor, initializing all member variables.
◆ FBulkData() [2/2]
| FBulkData::FBulkData |
( |
const FBulkData & |
Other | ) |
|
Copy constructor. Use the common routine to perform the copy.
- Parameters
-
| Other | the source array to copy |
◆ ~FBulkData()
| FBulkData::~FBulkData |
( |
| ) |
|
Virtual destructor, free'ing allocated memory.
◆ CanLoadFromDisk()
| bool FBulkData::CanLoadFromDisk |
( |
| ) |
const |
Returns true if the data can be loaded from disk.
◆ ClearBulkDataFlags()
| void FBulkData::ClearBulkDataFlags |
( |
uint32 |
BulkDataFlagsToClear | ) |
|
Clears the passed in bulk data flags.
- Parameters
-
| BulkDataFlagsToClear | Bulk data flags to clear |
◆ ClearBulkDataFlagsOn()
Disable the given flags in the given accumulator variable.
◆ CreateChunkId()
Returns a FIoChunkId for the bulkdata payload, this will be invalid if the bulkdata is not stored in the IoStore
◆ CreateStreamingRequest() [1/2]
Create an async read request for the bulk data. This version will load the entire data range that the FBulkData represents.
- Parameters
-
| 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. |
- Returns
- A request for the read. This is owned by the caller and must be deleted by the caller.
◆ CreateStreamingRequest() [2/2]
Create an async read request for the bulk data. This version allows the user to request a subset of the data that the FBulkData represents.
- Parameters
-
| 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. |
- Returns
- A request for the read. This is owned by the caller and must be deleted by the caller.
◆ DoesExist()
| bool FBulkData::DoesExist |
( |
| ) |
const |
Returns true if the data references a file that currently exists and can be referenced by the file system.
◆ DumpBulkDataUsage()
Dumps detailed information of bulk data usage.
- Parameters
-
◆ ForceBulkDataResident()
| void FBulkData::ForceBulkDataResident |
( |
| ) |
|
Forces the bulk data to be resident in memory and detaches the archive.
◆ GetBulkDataAlignment()
| uint32 FBulkData::GetBulkDataAlignment |
( |
| ) |
const |
Gets the current bulk data alignment.
- Returns
- Bulk data alignment currently set
◆ GetBulkDataFlags()
| uint32 FBulkData::GetBulkDataFlags |
( |
| ) |
const |
Gets the current bulk data flags.
- Returns
- Bulk data flags currently set
◆ GetBulkDataOffsetInFile()
| int64 FBulkData::GetBulkDataOffsetInFile |
( |
| ) |
const |
Returns the offset into the file the bulk data is located at.
- Returns
- Offset into the file or INDEX_NONE in case there is no association
◆ GetBulkDataSize()
| int64 FBulkData::GetBulkDataSize |
( |
| ) |
const |
Returns the size of the bulk data in bytes.
- Returns
- Size of the bulk data in bytes
◆ GetBulkDataSizeOnDisk()
| int64 FBulkData::GetBulkDataSizeOnDisk |
( |
| ) |
const |
Returns the size of the bulk data on disk. This can differ from GetBulkDataSize if BULKDATA_SerializeCompressed is set.
- Returns
- Size of the bulk data on disk or INDEX_NONE in case there's no association
◆ GetBulkDataVersions()
Get the CustomVersions used in the file containing the BulkData payload. If !IsInSeparateFile, this will be the custom versions from the archive used to serialize the FBulkData, which the caller must provide. Otherwise, the CustomVersions come from the separate file and this function will look them up.
- Parameters
-
| InlineArchive | The archive that was used to load this object |
◆ GetCopy()
Retrieves a copy of the bulk data.
- Parameters
-
| 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 |
◆ GetDebugName()
| FString FBulkData::GetDebugName |
( |
| ) |
const |
Returns a string representing the bulk data for debugging purposes.
◆ GetDecompressionFormat() [1/2]
| FName FBulkData::GetDecompressionFormat |
( |
| ) |
const |
Returns flags usable to decompress the bulk data
- Returns
- NAME_None if the data was not compressed on disk, or valid format to pass to FCompression::UncompressMemory for this data
Returns flags usable to decompress the bulk data
- Returns
- COMPRESS_NONE if the data was not compressed on disk, or valid flags to pass to FCompression::UncompressMemory for this data
◆ GetDecompressionFormat() [2/2]
Returns decompress method flags specified by the given bulk data flags.
◆ GetIoFilenameHash()
Returns the io filename hash associated with this bulk data.
- Returns
- Hash or INVALID_IO_FILENAME_HASH if invalid.
◆ HasFlags()
Returns whether all of the specified flags are set.
◆ IsAsyncLoadingComplete()
| bool FBulkData::IsAsyncLoadingComplete |
( |
| ) |
const |
Deprecated
- Returns
- As of 5.5 this will always return true as StartAsyncLoading was removed
◆ IsAvailableForUse()
| bool FBulkData::IsAvailableForUse |
( |
| ) |
const |
Returns whether this bulk data is used
- Returns
- true if BULKDATA_Unused is not set
◆ IsBulkDataLoaded()
| bool FBulkData::IsBulkDataLoaded |
( |
| ) |
const |
Returns whether the bulk data is currently loaded and resident in memory.
- Returns
- true if bulk data is loaded, false otherwise
◆ IsDataMemoryMapped()
| bool FBulkData::IsDataMemoryMapped |
( |
| ) |
const |
|
inline |
Returns whether this bulk data is memory mapped or not.
◆ IsDuplicateNonOptional()
| bool FBulkData::IsDuplicateNonOptional |
( |
| ) |
const |
|
inline |
Returns whether this bulk data represents duplicate non-optional data or not
- Returns
- true if BULKDATA_DuplicateNonOptionalPayload is set
◆ IsInExternalResource()
| bool FBulkData::IsInExternalResource |
( |
| ) |
const |
|
inline |
Returns whether this bulk data is stored in a PackageExternalResource rather than in a neighboring segment of its owner's PackagePath.
◆ IsInlined()
| bool FBulkData::IsInlined |
( |
| ) |
const |
|
inline |
Returns whether this bulk data is currently stored inline or not
- Returns
- true if BULKDATA_PayloadAtEndOfFile is not set
◆ IsInSeparateFile()
| bool FBulkData::IsInSeparateFile |
( |
| ) |
const |
|
inline |
Returns whether this bulk data is currently stored in it's own file or not
- Returns
- true if BULKDATA_PayloadInSeparateFile is set
◆ IsLocked()
| bool FBulkData::IsLocked |
( |
| ) |
const |
|
inline |
Checks if this bulk is locked
◆ IsOptional()
| bool FBulkData::IsOptional |
( |
| ) |
const |
|
inline |
Returns whether this bulk data represents optional data or not
- Returns
- true if BULKDATA_OptionalPayload is set
◆ IsSingleUse()
| bool FBulkData::IsSingleUse |
( |
| ) |
const |
|
inline |
Returns whether to deallocate the bulk data after lock
◆ IsStoredCompressedOnDisk()
| bool FBulkData::IsStoredCompressedOnDisk |
( |
| ) |
const |
Returns whether the bulk data is stored compressed on disk.
- Returns
- true if data is compressed on disk, false otherwise
◆ IsUnlocked()
| bool FBulkData::IsUnlocked |
( |
| ) |
const |
|
inline |
Checks if this bulk is unlocked
◆ IsUsingIODispatcher()
| bool FBulkData::IsUsingIODispatcher |
( |
| ) |
const |
|
inline |
Returns whether this bulk data is accessed via the IoDispatcher or not.
- Returns
- false as the old BulkData API does not support it
◆ Lock()
Locks the bulk data and returns a pointer to it.
- Parameters
-
| LockFlags | Flags determining lock behavior |
◆ LockReadOnly()
| const void * FBulkData::LockReadOnly |
( |
| ) |
const |
Locks the bulk data and returns a read-only pointer to it. This variant can be called on a const bulkdata
◆ OpenAsyncReadHandle()
Opens a new IAsyncReadFileHandle that references the file that the BulkData object represents.
- Returns
- A valid handle if the file can be accessed, if it cannot then nullptr.
◆ operator=()
Copies the source array into this one after detaching from archive.
- Parameters
-
| Other | the source array to copy |
◆ Realloc()
Change size of locked bulk data. Only valid if locked via read-write lock.
- Parameters
-
| ElementCount | Number of elements to allocate. |
| ElementSize | Size in bytes of the individual element. |
WITH_EDITOR
◆ RemoveBulkData()
| void FBulkData::RemoveBulkData |
( |
| ) |
|
Clears/removes any currently allocated data payload and resets element count to 0.
Note that once this has been called, the bulkdata object will no longer be able to reload it's payload from disk!
Clears/ removes the bulk data and resets element count to 0.
◆ ResetBulkDataFlags()
| void FBulkData::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.
- Parameters
-
| BulkDataFlagsToSet | Bulk data flags to set |
◆ Serialize()
Serialize function used to serialize this bulk data structure.
- Parameters
-
| 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 |
WITH_EDITOR
◆ SerializeBulkData() [1/2]
Serialize just the bulk data portion to/ from the passed in memory.
- Parameters
-
| Ar | Archive to serialize with |
| Data | Memory to serialize either to or from |
| InBulkDataFlags | Flags describing how the data was/shouldbe serialized |
◆ SerializeBulkData() [2/2]
◆ SetBulkDataFlags()
| void FBulkData::SetBulkDataFlags |
( |
uint32 |
BulkDataFlagsToSet | ) |
|
Enables the given flags without affecting any previously set flags.
- Parameters
-
| BulkDataFlagsToSet | Bulk data flags to set |
Sets the passed in bulk data flags.
- Parameters
-
| BulkDataFlagsToSet | Bulk data flags to set |
◆ SetBulkDataFlagsOn()
Enable the given flags in the given accumulator variable.
◆ StealFileMapping()
◆ StoreCompressedOnDisk()
| void FBulkData::StoreCompressedOnDisk |
( |
FName |
CompressionFormat | ) |
|
Sets whether we should store the data compressed on disk.
- Parameters
-
| CompressionFormat | The format to use for compression e.g. NAME_None or NAME_Oodle. |
This should likely not be used - bulk data that gets deployed should be compressed via UnrealPak so that it can leverage hardware compression as available, and editor bulk data is compressed by default and should use FEditorBulkData::SetCompressionOptions to control that if necessary.
◆ UnloadBulkData()
| bool FBulkData::UnloadBulkData |
( |
| ) |
|
Deallocates bulk data without detaching the archive, so that further bulk data accesses require a reload. Only supported in editor builds.
- Returns
- Whether the operation succeeded.
Deallocates bulk data without detaching the archive.
◆ Unlock()
| void FBulkData::Unlock |
( |
| ) |
const |
Unlocks bulk data after which point the pointer returned by Lock no longer is valid.
◆ FBulkDataBatchRequest
◆ FExportArchive
◆ FLinkerLoad
◆ FLinkerSave
◆ UE::Serialization::FEditorBulkData
◆ MaxBulkDataSize
The documentation for this class was generated from the following files:
- Engine/Source/Runtime/CoreUObject/Public/Serialization/BulkData.h
- Engine/Source/Runtime/CoreUObject/Private/Serialization/BulkData.cpp