Class SimpleTypeSerializer<T>
Base class for serialization of types that don't contain type specific information only {type_code}, {value_flag} and {value}.
Inheritance
System.Object
SimpleTypeSerializer<T>
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Gremlin.Net.Structure.IO.GraphBinary.Types
Assembly: cs.temp.dll.dll
Syntax
public abstract class SimpleTypeSerializer<T> : ITypeSerializer
Type Parameters
Name | Description |
---|---|
T | The supported type. |
Constructors
SimpleTypeSerializer(DataType)
Initializes a new instance of the SimpleTypeSerializer<T> class.
Declaration
protected SimpleTypeSerializer(DataType dataType)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType |
Properties
DataType
Declaration
public DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
Methods
ReadAsync(Stream, GraphBinaryReader, CancellationToken)
Declaration
public async Task<object> ReadAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | |
GraphBinaryReader | reader | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
ReadValueAsync(Stream, GraphBinaryReader, CancellationToken)
Reads a non-nullable value according to the type format.
Declaration
protected abstract Task<T> ReadValueAsync(Stream stream, GraphBinaryReader reader, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The GraphBinary data to parse. |
GraphBinaryReader | reader | |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | The read value. |
ReadValueAsync(Stream, GraphBinaryReader, Boolean, CancellationToken)
Declaration
public async Task<object> ReadValueAsync(Stream stream, GraphBinaryReader reader, bool nullable, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | |
GraphBinaryReader | reader | |
System.Boolean | nullable | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
WriteAsync(Object, Stream, GraphBinaryWriter, CancellationToken)
Declaration
public async Task WriteAsync(object value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | |
Stream | stream | |
GraphBinaryWriter | writer | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
WriteValueAsync(T, Stream, GraphBinaryWriter, CancellationToken)
Writes a non-nullable value into a stream.
Declaration
protected abstract Task WriteValueAsync(T value, Stream stream, GraphBinaryWriter writer, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to write. |
Stream | stream | The stream to write to. |
GraphBinaryWriter | writer | |
CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |
WriteValueAsync(Object, Stream, GraphBinaryWriter, Boolean, CancellationToken)
Declaration
public async Task WriteValueAsync(object value, Stream stream, GraphBinaryWriter writer, bool nullable, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | |
Stream | stream | |
GraphBinaryWriter | writer | |
System.Boolean | nullable | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |