UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TBulkData< ElementType > Class Template Reference

#include <BulkData.h>

+ Inheritance diagram for TBulkData< ElementType >:

Public Member Functions

int32 GetElementSize () const
 
int64 GetElementCount () const
 
ElementType * Realloc (int64 ElementCount)
 
FBulkDataBuffer< ElementType > GetCopyAsBuffer (int64 RequestedElementCount, bool bDiscardInternalCopy)
 
void Serialize (FArchive &Ar, UObject *Owner, int32 Idx=INDEX_NONE, bool bAttemptFileMapping=false, EFileRegionType FileRegionType=EFileRegionType::None)
 
void SerializeWithFlags (FArchive &Ar, UObject *Owner, uint32 SaveOverrideFlags, bool bAttemptFileMapping=false, EFileRegionType FileRegionType=EFileRegionType::None)
 
- Public Member Functions inherited from FBulkData
 FBulkData ()=default
 
COREUOBJECT_API FBulkData (const FBulkData &Other)
 
COREUOBJECT_API ~FBulkData ()
 
COREUOBJECT_API FBulkDataoperator= (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 voidLock (uint32 LockFlags)
 
COREUOBJECT_API const voidLockReadOnly () const
 
COREUOBJECT_API voidRealloc (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)
 
FOwnedBulkDataPtrStealFileMapping ()
 
COREUOBJECT_API void GetBulkDataVersions (FArchive &InlineArchive, FPackageFileVersion &OutUEVersion, int32 &OutLicenseeUEVersion, FCustomVersionContainer &OutCustomVersions) const
 
COREUOBJECT_API IAsyncReadFileHandleOpenAsyncReadHandle () const
 
COREUOBJECT_API IBulkDataIORequestCreateStreamingRequest (EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const
 
COREUOBJECT_API IBulkDataIORequestCreateStreamingRequest (int64 OffsetInBulkData, int64 BytesToRead, EAsyncIOPriorityAndFlags Priority, FBulkDataIORequestCallBack *CompleteCallback, uint8 *UserSuppliedMemory) const
 

Additional Inherited Members

- Public Types inherited from FBulkData
using BulkDataRangeArray = TArray< FBulkData *, TInlineAllocator< 8 > >
 
using FSerializeBulkDataElements = TFunction< void(FArchive &, void *, int64, EBulkDataFlags)>
 
- Static Public Member Functions inherited from FBulkData
static COREUOBJECT_API void DumpBulkDataUsage (FOutputDevice &Log)
 
static COREUOBJECT_API void SetBulkDataFlagsOn (EBulkDataFlags &InOutAccumulator, EBulkDataFlags FlagsToSet)
 
static COREUOBJECT_API void ClearBulkDataFlagsOn (EBulkDataFlags &InOutAccumulator, EBulkDataFlags FlagsToClear)
 
static COREUOBJECT_API bool HasFlags (EBulkDataFlags Flags, EBulkDataFlags Contains)
 
static COREUOBJECT_API FName GetDecompressionFormat (EBulkDataFlags InFlags)
 
- Static Public Attributes inherited from FBulkData
static constexpr SIZE_T MaxBulkDataSize = (1ull << 40) - 1
 
- Protected Member Functions inherited from FBulkData
COREUOBJECT_API void SerializeBulkData (FArchive &Ar, void *Data, int64 DataSize, EBulkDataFlags InBulkDataFlags)
 

Detailed Description

template<typename ElementType>
class TBulkData< ElementType >

Templated bulk data.

A bulk data array of typed elements.

Member Function Documentation

◆ GetCopyAsBuffer()

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

Returns a copy encapsulated by a FBulkDataBuffer.

Parameters
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.
Returns
A FBulkDataBuffer that owns a copy of the BulkData, this might be a subset of the data depending on the value of RequestedSize.

◆ GetElementCount()

template<typename ElementType >
int64 TBulkData< ElementType >::GetElementCount ( ) const
inline

Returns the number of elements in this bulk data array.

Returns
Number of elements in this bulk data array

◆ GetElementSize()

template<typename ElementType >
int32 TBulkData< ElementType >::GetElementSize ( ) const
inline

Element size in bytes.

Returns
Returns the element size in bytes.

◆ Realloc()

template<typename ElementType >
ElementType * TBulkData< ElementType >::Realloc ( int64  ElementCount)
inline

Change size of locked bulk data. Only valid if locked via read-write lock.

Parameters
ElementCountNumber of elements array should be resized to

◆ Serialize()

template<typename ElementType >
void TBulkData< ElementType >::Serialize ( FArchive Ar,
UObject Owner,
int32  Idx = INDEX_NONE,
bool  bAttemptFileMapping = false,
EFileRegionType  FileRegionType = EFileRegionType::None 
)
inline

Serialize function used to serialize this bulk data structure.

Parameters
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

◆ SerializeWithFlags()

template<typename ElementType >
void TBulkData< ElementType >::SerializeWithFlags ( FArchive Ar,
UObject Owner,
uint32  SaveOverrideFlags,
bool  bAttemptFileMapping = false,
EFileRegionType  FileRegionType = EFileRegionType::None 
)
inline

Serialize function used to serialize this bulk data structure, applying an override of the Bulk Data Flags when saving.

Parameters
ArArchive to serialize with
OwnerObject owning the bulk data
SaveOverrideFlagsEBulkDataFlags to use when saving (restores original flags after serialization)
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

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