Class ISerializable
Interface for objects that can be serialized/deserialized to/from JSON format.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Core/ISerializable.h
Syntax
public class ISerializable
Constructors
~ISerializable()
Finalizes an instance of the ISerializable class.
Declaration
public virtual ~ISerializable() = default
Methods
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) = 0
Parameters
|
DeserializeStream
stream
The input stream. |
|
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
Deserializes object from the input stream child member. Won't deserialize it if member is missing.
Declaration
public void DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
Parameters
|
DeserializeStream
stream
The input stream. |
|
char
memberName
The input stream member to lookup. |
|
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) = 0
Parameters
|
SerializeStream
stream
The output stream. |
|
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
ShouldSerialize(const void* otherObj)
Compares with other instance to decide whether serialize this instance (eg. any field orp property is modified). Used to skip object serialization if not needed.
Declaration
public virtual bool ShouldSerialize(const void* otherObj) const
Parameters
|
void
otherObj
The instance of the object (always valid) to compare with to decide whether serialize this instance. |
Returns
|
bool
True if any field or property is modified compared to the other object instance, otherwise false. |