Table of Contents

Class RecordVisitor

Namespace
MarymoorStudios.Core.Serialization
Assembly
MarymoorStudios.Core.Serialization.dll

Visitor that can walk the structure of any serialized record.

public abstract class RecordVisitor
Inheritance
RecordVisitor
Inherited Members

Constructors

RecordVisitor()

protected RecordVisitor()

Methods

ReportError(string)

Called when an error occurs during the walk.

protected virtual bool ReportError(string error)

Parameters

error string

Detailed error message.

Returns

bool

returns false

TryReadRecord(ref ReadOnlyRowBuffer)

public bool TryReadRecord(ref ReadOnlyRowBuffer b)

Parameters

b ReadOnlyRowBuffer

Returns

bool

TryReadUnknown(ref ReadOnlyRowBuffer, TypeMarker)

Called when an unknown code is read.

protected virtual bool TryReadUnknown(ref ReadOnlyRowBuffer b, TypeMarker code)

Parameters

b ReadOnlyRowBuffer

The buffer.

code TypeMarker

The unknown code.

Returns

bool

True if the code was processed, false otherwise.

Visit()

Called when a is visited.

protected abstract bool Visit()

Returns

bool

True to continue, false otherwise.

Visit(TypeId)

Called when a TypeId value is visited.

protected abstract bool Visit(TypeId value)

Parameters

value TypeId

Returns

bool

True to continue, false otherwise.

Visit(string)

Called when a string value is visited.

protected abstract bool Visit(string value)

Parameters

value string

Returns

bool

True to continue, false otherwise.

VisitArrayEnd()

Called when an array scoped is exited.

protected abstract bool VisitArrayEnd()

Returns

bool

True to continue, false otherwise.

VisitArrayStart(int)

Called when an array scoped is entered.

protected abstract bool VisitArrayStart(int length)

Parameters

length int

Returns

bool

True to continue, false otherwise.

VisitByteArray(ReadOnlyMemory<byte>)

Called when an array of bytes is read.

protected abstract bool VisitByteArray(ReadOnlyMemory<byte> bytes)

Parameters

bytes ReadOnlyMemory<byte>

Returns

bool

True to continue, false otherwise.

VisitObjectEnd()

Called when an object scoped is exited.

protected abstract bool VisitObjectEnd()

Returns

bool

True to continue, false otherwise.

VisitObjectStart()

Called when an object scoped is entered.

protected abstract bool VisitObjectStart()

Returns

bool

True to continue, false otherwise.

VisitSegmentEnd()

Called when an object segment scoped is exited.

protected abstract bool VisitSegmentEnd()

Returns

bool

True to continue, false otherwise.

VisitSegmentStart(TypeId, int)

Called when an object segment scoped is entered.

protected abstract bool VisitSegmentStart(TypeId typeId, int segmentLength)

Parameters

typeId TypeId
segmentLength int

Returns

bool

True to continue, false otherwise.

VisitTupleEnd()

Called when a tuple scoped is exited.

protected abstract bool VisitTupleEnd()

Returns

bool

True to continue, false otherwise.

VisitTupleStart(TypeId)

Called when a tuple scoped is entered.

protected abstract bool VisitTupleStart(TypeId typeId)

Parameters

typeId TypeId

Returns

bool

True to continue, false otherwise.

Visit<T>(T)

Called when a primitive value is visited.

protected abstract bool Visit<T>(T value) where T : unmanaged

Parameters

value T

Returns

bool

True to continue, false otherwise.

Type Parameters

T