FVirtualizedUntypedBulkData

The goal of this class is to provide an editor time version of BulkData that will work with the content virtualization system.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FVirtualizedUntypedBulkData

TVirtualizedBulkData

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/Serialization/VirtualizedBulkData.h

Include

#include "Serialization/VirtualizedBulkData.h"

Syntax

class FVirtualizedUntypedBulkData

Remarks

The goal of this class is to provide an editor time version of BulkData that will work with the content virtualization system.

Assuming that the DDC is hot, the virtualized payloads are accessed relatively infrequently, usually when the package is being edited in the editor in some manner. So the payload access is designed around this. If the data is frequently accessed when running the editor then the user would not gain from having it virtualized as they would end up pulling it immediately anyway.

The biggest difference with normal bulkdata is that the access times might be significantly longer if the payload is not readily available which is why the only way to access the payload is by a TFuture or a callback so that the caller is forced to consider how to handle the potential stall and hopefully organize their code in such a way that the time lag is not noticeable to the user.

The second biggest difference is that the caller will own the payload memory once it is returned to them, unlike the old bulkdata class which would retain ownership. Which forces the calling code to be in control of when the memory is actually allocated and for how long. With the old bulkdata class a single access would leave that memory allocated in a non-obvious way and would lead to memory bloats within the editor.

The method ::GetGuid can be used to access a unique identifier for the payload, currently it is based on the payload itself, so that two objects with the same payload would both have the same Guid. The intent is that we would be able to share local copies of the payload between branches to reduce the cost of having multiple branches with similar data on the same machine.The base class with no type

Constructors

Destructors

Functions

Name Description

Public function Const

bool

 

CanSaveForRegistry()

Return true if the bulkdata has a source location that persists between editor processes (package file or virtualization).

Public function Const

FVirtualized...

 

CopyTornOff()

Make a torn-off copy of this bulk data.

Public function

void

 

CreateFromBulkData

(
    FUntypedBulkData& BulkData,
    const FGuid& Guid,
    UObject* Owner
)

Convenience method to make it easier to convert from BulkData to FVirtualizedBulkData and sets the Guid

Public function

void

 

CreateLegacyUniqueIdentifier

(
    UObject* Owner
)

Fix legacy content that created the Id from non-unique Guids.

Public function

void

 

DetachFromDisk

(
    FArchive* Ar,
    bool bEnsurePayloadIsLoaded
)

Removes the ability for the bulkdata object to load it's payload from disk (if it was doing so)

Public function Const

bool

 

DoesPayloadNeedLoading()

Returns if the payload would require loading in order to be accessed.

Public function Const

TFuture< FCo...

 

GetCompressedPayload()

Returns an immutable FCompressedBuffer reference to the payload data.

Public function

FCustomVersi...

 

GetCustomVersions

(
    FArchive& InlineArchive
)

Get the CustomVersions used in the file containing the payload.

Public function Const

FGuid

 

GetIdentifier()

Returns a unique identifier for the object itself.

Public function Const

TFuture< FSh...

 

GetPayload()

Returns an immutable FCompressedBuffer reference to the payload data.

Public function Const

const FPaylo...

 

GetPayloadId()

Returns an unique identifier for the content of the payload.

Public function Const

int64

 

GetPayloadSize()

Returns the size of the payload in bytes.

Public function Const

bool

 

HasPayloadData()

Returns true if the bulkdata object contains a valid payload greater than zero bytes in size.

Public function Const

bool

 

HasPlaceholderPayloadId()

Return whether the BulkData has legacy payload id that needs to be updated from loaded payload before it can be used in DDC.

Public function Const

bool

 

IsMemoryOnlyPayload()

Return whether the BulkData is an in-memory payload without a persistent source location.

Public function

void

 

Register

(
    UObject* Owner
)

Register this BulkData with the BulkData registry, if it is valid for registration.

Public function

void

 

Reset()

Reset to a truly empty state

Public function

void

 

Serialize

(
    FArchive& Ar,
    UObject* Owner,
    bool bAllowRegister
)

Used to serialize the bulkdata to/from a FArchive

Public function

void

 

SerializeForRegistry

(
    FArchive& Ar
)

Used to serialize the bulkdata to/from a limited cache system used by the BulkDataRegistry.

Public function

void

 

SetCompressionOptions

(
    ECompressionOptions Option
)

Sets the compression options to be applied to the payload during serialization.

Public function

void

 

SetCompressionOptions

Sets the compression options to be applied to the payload during serialization.

Public function

void

 

TearOff()

Set this BulkData into Torn-Off mode.

Public function

void

 

UnloadData()

TODO: Probably can just remove this as there probably isn't a good use case for unloading updated payloads as there is no way for us to restore it.

Public function

void

 

UpdatePayload

(
    FSharedBuffer InPayload
)

Replaces the existing payload (if any) with a new one.

Public function

void

 

UpdatePayload

(
    FSharedBufferWithID InPayload
)

Allows the existing payload to be replaced with a new one.

Public function

void

 

UpdatePayloadId()

Load the payload and set the correct payload id, if the bulkdata has a PlaceholderPayloadId.

Operators

Name Description

Public function

FVirtualized...

 

operator=

(
    const FVirtualizedUntypedBulkData&...
)

Public function

FVirtualized...

 

operator=

(
    FVirtualizedUntypedBulkData&& Othe...
)

Classes

Name

Description

Public struct

FSharedBufferWithID

Utility struct used to compute the Payload ID before calling UpdatePayload

Enums

Name

Description

Private enum

EFlags

Flags used to store additional meta information about the bulk data

Private enum

ErrorVerbosity

Used to control what level of error reporting we return from some methods

Protected enum

ETornOff

Deprecated Functions

Name Description

Public function

void

 

SetVirtualizationOptOut

(
    bool bOptOut
)

SetVirtualizationOptOut is an internal feature for development and will be removed without warning!