Class Serializer
- Namespace
- MarymoorStudios.Core.Serialization.System
- Assembly
- MarymoorStudios.Core.Serialization.dll
public abstract class Serializer
- Inheritance
-
Serializer
- Derived
-
Serializer<T>
- 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
segmentEndintThe buffer offset where the segment ends.
contextSerializationContextThe serialization context.
bufferReadOnlyRowBufferThe buffer.
Returns
- bool
True if successful, false if an error occurred.
GetTypeId()
public abstract TypeId GetTypeId()
Returns
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
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
declaredTypeIdTypeIdThe type id of the calling serializer.
typeIdTypeIdOn input the type of the current segment, on return the type of the found segment.
contextSerializationContextThe serialization context.
bufferReadOnlyRowBufferThe 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
typeIdTypeIdcontextSerializationContextbufferReadOnlyRowBuffervalueTSuper
Returns
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
contextSerializationContextvalueTSupersizeint
Returns
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
contextSerializationContextbufferRowBuffervalueTSuper
Returns
Type Parameters
TSuper