class IDeltaHandler

Represents an interface RTTI objects need to implement if they want to provide custom delta generation and applying.

Public

Methods

~IDeltaHandler

virtual ~IDeltaHandler() noexcept = default

GenerateDelta

SPtr<SerializedObject> GenerateDelta(const SPtr<IReflectable> &original, const SPtr<IReflectable> &modified, RTTIOperationContext &context, bool replicableOnly = false)

Generates differences between the provided original and new object.

Each field is compared with a matching field on the other object. If the field references a container (e.g. an array or a map), then delta is recorded only for entries that don't match (and not the entire container).

Both provided objects must of the same type.

If true then only fields with replication enabled will be evaluated and all others will be ignored.

Will return null if there is no difference.

ApplyDelta

void ApplyDelta(const SPtr<IReflectable> &object, const SPtr<SerializedObject> &delta, RTTIOperationContext &context)

Applies a previously generated delta to the provided object.

This will essentially transform the original object the differences were generated for into the modified version.

Internal

Methods

GenerateDeltaRecursive

virtual SPtr<SerializedObject> GenerateDeltaRecursive(IReflectable *original, IReflectable *modified, ObjectMap &objectMap, RTTIOperationContext &context, bool replicableOnly) = 0

Recursive version of GenerateDelta(const SPtr <IReflectable > & , const SPtr <IReflectable > & , bool).

Protected

Methods

GenerateDeltaApplyCommands

virtual void GenerateDeltaApplyCommands(const SPtr<IReflectable> &object, const SPtr<SerializedObject> &delta, FrameAllocator &allocator, DeltaObjectMap &objectMap, FrameVector<DeltaCommand> &inOutDeltaCommands, RTTIOperationContext &context) = 0

Generates a set of commands that determine operations that need to be performed on in order to apply all the changes from .

Commands are output in .

GenerateDeltaApplyCommands

void GenerateDeltaApplyCommands(RTTIType *rtti, const SPtr<IReflectable> &object, const SPtr<SerializedObject> &delta, FrameAllocator &allocator, DeltaObjectMap &objectMap, FrameVector<DeltaCommand> &inOutDeltaCommands, RTTIOperationContext &context)

Retrieves the appropriate IDeltaHandler from the provided object and calls the other GenerateDeltaApplyCommands overload.