struct SerializedObject

Inherits: ISerialized

Represents a serialized version of an IReflectable object.

Data for all leaf fields will be serialized into raw memory but complex objects, their references and fields are available as their own serialized objects and can be iterated over, viewed, compared or modified. Serialized object can later be decoded back into a IReflectable object.

Public

Methods

GetRootTypeId

u32 GetRootTypeId() const

Returns the RTTI type ID for the most-derived class of this object.

Clone

SPtr<ISerialized> Clone(bool cloneData = true) override

Performs a deep clone of this object any any potential child objects.

cloneData
If true the data contained by the objects will be cloned as well, instead of just meta-data. If false then both the original and the cloned instances will point to the same instances of data. The original will retain data ownership and it will go out of scope when the original does.

CalculateHash

u64 CalculateHash() const override

Calculates the hash value of the contained data.

Equals

bool Equals(const SPtr<ISerialized> &other) const override

Checks if this value matches the other provided value.

Decode

SPtr<IReflectable> Decode(RTTIOperationContext &context) const

Decodes the serialized object back into its original IReflectable object form.

context
Object that will be passed along to all RTTI type objects through their notify callbacks. Can be used for controlling serialization, maintaining state or sharing information between objects during serialization.

staticCreate

static SPtr<SerializedObject> Create(IReflectable &object, SerializedObjectEncodeFlags flags = SerializedObjectEncodeFlags())

Serializes the provided object and returns its SerializedObject representation.

object
Object to serialize.
flags
Flags used for controlling the serialization process.

Returns: Serialized version of .

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

~ISerialized

virtual ~ISerialized() noexcept = default

Fields

SubObjects

Vector<SerializedSubObject> SubObjects