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
segmentEnd
intThe buffer offset where the segment ends.
context
SerializationContextThe serialization context.
buffer
ReadOnlyRowBufferThe 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
declaredTypeId
TypeIdThe type id of the calling serializer.
typeId
TypeIdOn input the type of the current segment, on return the type of the found segment.
context
SerializationContextThe serialization context.
buffer
ReadOnlyRowBufferThe 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
TypeIdcontext
SerializationContextbuffer
ReadOnlyRowBuffervalue
TSuper
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
context
SerializationContextvalue
TSupersize
int
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
context
SerializationContextbuffer
RowBuffervalue
TSuper
Returns
Type Parameters
TSuper