NullableSerializer<T> Class
Namespace: Stride.Core.Serialization.SerializersAssembly: Stride.Core.dll
Data serializer for Nullable{T}.
Derived from NullableSerializer<T>:
[DataSerializerGlobal(typeof(NullableSerializer<>), typeof(T? ), DataSerializerGenericMode.GenericArguments, false, false)]
public class NullableSerializer<T> : DataSerializer<T?> where T : struct
Type Parameters
Name | Description |
---|---|
T | The generic type in Nullable{T}. |
Name | Description | |
---|---|---|
Methods | ||
Initialize(SerializerSelector) | Initializes the specified serializer. |
|
Serialize(ref Nullable<T>, ArchiveMode, SerializationStream) | Serializes or deserializes the given object |
Methods
Initialize(SerializerSelector)
Initializes the specified serializer.
public override void Initialize(SerializerSelector serializerSelector)
Parameters
Type | Name | Description |
---|---|---|
SerializerSelector | serializerSelector | The serializer. |
Overrides
Remarks
This method should be thread-safe and OK to call multiple times.
Serialize(ref Nullable<T>, ArchiveMode, SerializationStream)
Serializes or deserializes the given object obj
.
public override void Serialize(ref T? obj, ArchiveMode mode, SerializationStream stream)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<T> | obj | |
ArchiveMode | mode | The serialization mode. |
SerializationStream | stream | The stream to serialize or deserialize to. |
Overrides
Stride.Core.Serialization.DataSerializer<System.Nullable<T>>.Serialize(System.Nullable<T>, Stride.Core.Serialization.ArchiveMode, Stride.Core.Serialization.SerializationStream)