Version 3.3.1.2

MinimalBaseFormatter<T> class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public abstract class MinimalBaseFormatter<T> : IFormatter<T>, IFormatter
Minimal baseline formatter. Doesn't come with all the bells and whistles of any of the other BaseFormatter classes. Common serialization conventions aren't automatically supported, and common deserialization callbacks are not automatically invoked.
Inheritance
  • System.Object
  • MinimalBaseFormatter<T>

Type Parameters

T

The type which can be serialized and deserialized by the formatter.

Constructors

MinimalBaseFormatter()
protected MinimalBaseFormatter()

Fields

IsValueType
Whether the serialized value is a value type.
protected static readonly bool IsValueType

Properties

SerializedType
Gets the type that the formatter can serialize.
public Type SerializedType { get; }

Methods

Deserialize(IDataReader)
Deserializes a value of type using a specified OdinSerializer.IDataReader.
public T Deserialize(IDataReader reader)
Parameters
Sirenix.Serialization.IDataReader reader

The reader to use.

Returns
T

The deserialized value.

GetUninitializedObject()
Get an uninitialized object of type . WARNING: If you override this and return null, the object's ID will not be automatically registered. You will have to call immediately after creating the object yourself during deserialization.
protected virtual T GetUninitializedObject()
Returns
T

An uninitialized object of type .

Read(ref T, IDataReader)
Reads into the specified value using the specified reader.
protected abstract void Read(ref T value, IDataReader reader)
Parameters
T value

The value to read into.

Sirenix.Serialization.IDataReader reader

The reader to use.

RegisterReferenceID(T, IDataReader)
Registers the given object reference in the deserialization context.

NOTE that this method only does anything if is not a value type.

protected void RegisterReferenceID(T value, IDataReader reader)
Parameters
T value

The value to register.

Sirenix.Serialization.IDataReader reader

The reader which is currently being used.

Serialize(T, IDataWriter)
Serializes a value of type using a specified OdinSerializer.IDataWriter.
public void Serialize(T value, IDataWriter writer)
Parameters
T value

The value to serialize.

Sirenix.Serialization.IDataWriter writer

The writer to use.

Write(ref T, IDataWriter)
Writes from the specified value using the specified writer.
protected abstract void Write(ref T value, IDataWriter writer)
Parameters
T value

The value to write from.

Sirenix.Serialization.IDataWriter writer

The writer to use.