Table of Contents

Class Serializer

Namespace
MarymoorStudios.Core.Serialization.System
Assembly
MarymoorStudios.Core.Serialization.dll
public abstract class Serializer
Inheritance
Serializer
Derived
Inherited Members

Constructors

Serializer()

protected Serializer()

Methods

Dice(int, SerializationContext, ref ReadOnlyRowBuffer)

Skips over up-level properties that are not known.

public static bool Dice(int segmentEnd, SerializationContext context, ref ReadOnlyRowBuffer buffer)

Parameters

segmentEnd int

The buffer offset where the segment ends.

context SerializationContext

The serialization context.

buffer ReadOnlyRowBuffer

The buffer.

Returns

bool

True if successful, false if an error occurred.

GetTypeId()

public abstract TypeId GetTypeId()

Returns

TypeId

Get<T>()

protected static Serializer<T> Get<T>() where T : allows ref struct

Returns

Serializer<T>

Type Parameters

T

Register(Type, Type)

public static void Register(Type genericType, Type templateType)

Parameters

genericType Type
templateType Type

Slice(TypeId, ref TypeId, SerializationContext, ref ReadOnlyRowBuffer)

Skips over type segments until it encounters a typeId that is known.

public static bool Slice(TypeId declaredTypeId, ref TypeId typeId, SerializationContext context, ref ReadOnlyRowBuffer buffer)

Parameters

declaredTypeId TypeId

The type id of the calling serializer.

typeId TypeId

On input the type of the current segment, on return the type of the found segment.

context SerializationContext

The serialization context.

buffer ReadOnlyRowBuffer

The buffer to read from.

Returns

bool

True if successful, false if parsing fails.

TryReadDerived<TSuper>(TypeId, SerializationContext, ref ReadOnlyRowBuffer, out TSuper)

public static bool TryReadDerived<TSuper>(TypeId typeId, SerializationContext context, ref ReadOnlyRowBuffer buffer, out TSuper value) where TSuper : class?

Parameters

typeId TypeId
context SerializationContext
buffer ReadOnlyRowBuffer
value TSuper

Returns

bool

Type Parameters

TSuper

TrySizeOfDerived<TSuper>(SerializationContext, in TSuper, out int)

public static bool TrySizeOfDerived<TSuper>(SerializationContext context, in TSuper value, out int size) where TSuper : class?

Parameters

context SerializationContext
value TSuper
size int

Returns

bool

Type Parameters

TSuper

TryWriteDerived<TSuper>(SerializationContext, ref RowBuffer, in TSuper)

public static bool TryWriteDerived<TSuper>(SerializationContext context, ref RowBuffer buffer, in TSuper value) where TSuper : class?

Parameters

context SerializationContext
buffer RowBuffer
value TSuper

Returns

bool

Type Parameters

TSuper