Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj8
-rw-r--r--sandbox/DynamicCodeDumper/Program.cs1
-rw-r--r--sandbox/MessagePack.Internal/MessagePack.Internal.csproj2
-rw-r--r--sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs8
-rw-r--r--sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs17
-rw-r--r--sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj4
-rw-r--r--sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs8
-rw-r--r--sandbox/PerfNetFramework/PerfNetFramework.csproj4
-rw-r--r--sandbox/Sandbox/Generated.cs1984
-rw-r--r--sandbox/Sandbox/Sandbox.csproj4
-rw-r--r--sandbox/Sandbox/codegen.ps12
-rw-r--r--sandbox/TestData2/A.cs15
-rw-r--r--sandbox/TestData2/B.cs17
-rw-r--r--sandbox/TestData2/C.cs16
-rw-r--r--sandbox/TestData2/Generated.cs270
-rw-r--r--sandbox/TestData2/Record.cs10
-rw-r--r--sandbox/TestData2/TestData2.csproj6
-rw-r--r--sandbox/TestData2/codegen.ps12
18 files changed, 1260 insertions, 1118 deletions
diff --git a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
index 4ef220a0..0daf9da4 100644
--- a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
+++ b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj
@@ -132,6 +132,9 @@
<Compile Include="..\..\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\Resolvers\DynamicUnionResolver.cs">
<Link>Code\DynamicUnionResolver.cs</Link>
</Compile>
+ <Compile Include="..\..\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\Resolvers\ResolverUtilities.cs">
+ <Link>Code\ResolverUtilities.cs</Link>
+ </Compile>
<Compile Include="..\..\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\StringEncoding.cs">
<Link>Code\StringEncoding.cs</Link>
</Compile>
@@ -140,8 +143,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
- <PackageReference Include="Nerdbank.Streams" Version="2.4.48" />
- <PackageReference Include="System.Memory" Version="4.5.3" />
- <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.2" />
+ <PackageReference Include="Nerdbank.Streams" Version="2.8.57" />
+ <PackageReference Include="Microsoft.NET.StringTools" Version="1.0.0" />
</ItemGroup>
</Project>
diff --git a/sandbox/DynamicCodeDumper/Program.cs b/sandbox/DynamicCodeDumper/Program.cs
index 14f6199e..0d74db48 100644
--- a/sandbox/DynamicCodeDumper/Program.cs
+++ b/sandbox/DynamicCodeDumper/Program.cs
@@ -44,6 +44,7 @@ namespace DynamicCodeDumper
////DynamicObjectResolver.Instance.GetFormatter<StringKeySerializerTarget>();
////DynamicObjectResolver.Instance.GetFormatter<LongestString>();
IMessagePackFormatter<MyClass> f = DynamicObjectResolverAllowPrivate.Instance.GetFormatter<MyClass>();
+ ////IMessagePackFormatter<MessagePackFormatterFieldUser> f = DynamicObjectResolver.Instance.GetFormatter<MessagePackFormatterFieldUser>();
////DynamicObjectResolver.Instance.GetFormatter<StringKeySerializerTargetBinary>();
////DynamicObjectResolver.Instance.GetFormatter<Callback1>();
////DynamicObjectResolver.Instance.GetFormatter<Callback1_2>();
diff --git a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
index d7e5caaa..28352480 100644
--- a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
+++ b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>netcoreapp2.2</TargetFrameworks>
+ <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);SPAN_BUILTIN;MESSAGEPACK_INTERNAL</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
diff --git a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
index 3c0ef2f2..68af163a 100644
--- a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs
@@ -1,4 +1,4 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias newmsgpack;
@@ -61,6 +61,12 @@ namespace PerfBenchmarkDotNet
}
[Benchmark]
+ public IntKeySerializerTarget IntKey_NonGeneric()
+ {
+ return (IntKeySerializerTarget)newmsgpack.MessagePack.MessagePackSerializer.Deserialize(typeof(IntKeySerializerTarget), intObj);
+ }
+
+ [Benchmark]
public StringKeySerializerTarget StringKey()
{
return newmsgpack.MessagePack.MessagePackSerializer.Deserialize<StringKeySerializerTarget>(stringKeyObj);
diff --git a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
index 0cff6334..64e7c89a 100644
--- a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs
@@ -4,6 +4,7 @@
extern alias newmsgpack;
extern alias oldmsgpack;
+using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using Nerdbank.Streams;
@@ -12,7 +13,7 @@ namespace PerfBenchmarkDotNet
{
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
[CategoriesColumn]
- public class MessagePackWriterBenchmark
+ public class MessagePackWriterBenchmark : IDisposable
{
private const int RepsOverArray = 300 * 1024;
private readonly Sequence<byte> sequence = new Sequence<byte>();
@@ -148,5 +149,19 @@ namespace PerfBenchmarkDotNet
offset = 0;
}
}
+
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ this.sequence.Dispose();
+ }
+ }
}
}
diff --git a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
index 53bb5949..6804253d 100644
--- a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
+++ b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFrameworks>net472;netcoreapp2.2</TargetFrameworks>
+ <TargetFrameworks>net472;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
@@ -19,7 +19,7 @@
<PackageReference Include="Jil" version="2.15.4" />
<PackageReference Include="MessagePack" version="1.4.3" />
<PackageReference Include="MsgPack.Cli" version="0.9.0-rc1" />
- <PackageReference Include="Nerdbank.Streams" Version="2.4.48" />
+ <PackageReference Include="Nerdbank.Streams" Version="2.8.57" />
<PackageReference Include="Newtonsoft.Json" version="10.0.3" />
<PackageReference Include="protobuf-net" version="2.3.2" />
<PackageReference Include="RandomFixtureKit" Version="1.0.0" />
diff --git a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
index 0ed114b0..fc9a3a06 100644
--- a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
+++ b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs
@@ -1,4 +1,4 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias newmsgpack;
@@ -36,6 +36,12 @@ namespace PerfBenchmarkDotNet
}
[Benchmark]
+ public byte[] IntKey_NonGeneric()
+ {
+ return newmsgpack.MessagePack.MessagePackSerializer.Serialize(typeof(IntKeySerializerTarget), intData);
+ }
+
+ [Benchmark]
public byte[] StringKey()
{
return newmsgpack.MessagePack.MessagePackSerializer.Serialize<StringKeySerializerTarget>(stringData);
diff --git a/sandbox/PerfNetFramework/PerfNetFramework.csproj b/sandbox/PerfNetFramework/PerfNetFramework.csproj
index a0416f99..57cbfd36 100644
--- a/sandbox/PerfNetFramework/PerfNetFramework.csproj
+++ b/sandbox/PerfNetFramework/PerfNetFramework.csproj
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFrameworks>net472;netcoreapp2.2</TargetFrameworks>
+ <TargetFrameworks>net472;net6.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MsgPack.Cli" version="0.9.0-beta2" />
- <PackageReference Include="Nerdbank.Streams" Version="2.4.48" />
+ <PackageReference Include="Nerdbank.Streams" Version="2.8.57" />
<PackageReference Include="Newtonsoft.Json" version="10.0.3" />
<PackageReference Include="protobuf-net" version="2.1.0" />
<PackageReference Include="ZeroFormatter" version="1.6.4" />
diff --git a/sandbox/Sandbox/Generated.cs b/sandbox/Sandbox/Generated.cs
index 51a08d60..bc3bcd7a 100644
--- a/sandbox/Sandbox/Generated.cs
+++ b/sandbox/Sandbox/Generated.cs
@@ -6,15 +6,13 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Resolvers
{
- using System;
-
public class GeneratedResolver : global::MessagePack.IFormatterResolver
{
public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver();
@@ -45,11 +43,11 @@ namespace MessagePack.Resolvers
internal static class GeneratedResolverGetFormatterHelper
{
- private static readonly global::System.Collections.Generic.Dictionary<Type, int> lookup;
+ private static readonly global::System.Collections.Generic.Dictionary<global::System.Type, int> lookup;
static GeneratedResolverGetFormatterHelper()
{
- lookup = new global::System.Collections.Generic.Dictionary<Type, int>(65)
+ lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(72)
{
{ typeof(global::GlobalMyEnum[,]), 0 },
{ typeof(global::GlobalMyEnum[]), 1 },
@@ -72,54 +70,61 @@ namespace MessagePack.Resolvers
{ typeof(global::ComplexModel), 18 },
{ typeof(global::GlobalMan), 19 },
{ typeof(global::Message), 20 },
- { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 21 },
- { typeof(global::QuestMessageBody), 22 },
- { typeof(global::SharedData.ArrayOptimizeClass), 23 },
- { typeof(global::SharedData.BarClass), 24 },
- { typeof(global::SharedData.Callback1), 25 },
- { typeof(global::SharedData.Callback1_2), 26 },
- { typeof(global::SharedData.Callback2), 27 },
- { typeof(global::SharedData.Callback2_2), 28 },
- { typeof(global::SharedData.Empty1), 29 },
- { typeof(global::SharedData.Empty2), 30 },
- { typeof(global::SharedData.EmptyClass), 31 },
- { typeof(global::SharedData.EmptyStruct), 32 },
- { typeof(global::SharedData.FirstSimpleData), 33 },
- { typeof(global::SharedData.FooClass), 34 },
- { typeof(global::SharedData.HolderV0), 35 },
- { typeof(global::SharedData.HolderV1), 36 },
- { typeof(global::SharedData.HolderV2), 37 },
- { typeof(global::SharedData.MyClass), 38 },
- { typeof(global::SharedData.MySubUnion1), 39 },
- { typeof(global::SharedData.MySubUnion2), 40 },
- { typeof(global::SharedData.MySubUnion3), 41 },
- { typeof(global::SharedData.MySubUnion4), 42 },
- { typeof(global::SharedData.NestParent.NestContract), 43 },
- { typeof(global::SharedData.NonEmpty1), 44 },
- { typeof(global::SharedData.NonEmpty2), 45 },
- { typeof(global::SharedData.SimpleIntKeyData), 46 },
- { typeof(global::SharedData.SimpleStringKeyData), 47 },
- { typeof(global::SharedData.SimpleStructIntKeyData), 48 },
- { typeof(global::SharedData.SimpleStructStringKeyData), 49 },
- { typeof(global::SharedData.SubUnionType1), 50 },
- { typeof(global::SharedData.SubUnionType2), 51 },
- { typeof(global::SharedData.UnVersionBlockTest), 52 },
- { typeof(global::SharedData.Vector2), 53 },
- { typeof(global::SharedData.Vector3Like), 54 },
- { typeof(global::SharedData.VectorLike2), 55 },
- { typeof(global::SharedData.Version0), 56 },
- { typeof(global::SharedData.Version1), 57 },
- { typeof(global::SharedData.Version2), 58 },
- { typeof(global::SharedData.VersionBlockTest), 59 },
- { typeof(global::SharedData.VersioningUnion), 60 },
- { typeof(global::SharedData.WithIndexer), 61 },
- { typeof(global::SimpleModel), 62 },
- { typeof(global::StampMessageBody), 63 },
- { typeof(global::TextMessageBody), 64 },
+ { typeof(global::MessagePackFormatterFieldUser), 21 },
+ { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 22 },
+ { typeof(global::QuestMessageBody), 23 },
+ { typeof(global::SharedData.ArrayOptimizeClass), 24 },
+ { typeof(global::SharedData.BarClass), 25 },
+ { typeof(global::SharedData.Callback1), 26 },
+ { typeof(global::SharedData.Callback1_2), 27 },
+ { typeof(global::SharedData.Callback2), 28 },
+ { typeof(global::SharedData.Callback2_2), 29 },
+ { typeof(global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor), 30 },
+ { typeof(global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor), 31 },
+ { typeof(global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor), 32 },
+ { typeof(global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor), 33 },
+ { typeof(global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor), 34 },
+ { typeof(global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor), 35 },
+ { typeof(global::SharedData.Empty1), 36 },
+ { typeof(global::SharedData.Empty2), 37 },
+ { typeof(global::SharedData.EmptyClass), 38 },
+ { typeof(global::SharedData.EmptyStruct), 39 },
+ { typeof(global::SharedData.FirstSimpleData), 40 },
+ { typeof(global::SharedData.FooClass), 41 },
+ { typeof(global::SharedData.HolderV0), 42 },
+ { typeof(global::SharedData.HolderV1), 43 },
+ { typeof(global::SharedData.HolderV2), 44 },
+ { typeof(global::SharedData.MyClass), 45 },
+ { typeof(global::SharedData.MySubUnion1), 46 },
+ { typeof(global::SharedData.MySubUnion2), 47 },
+ { typeof(global::SharedData.MySubUnion3), 48 },
+ { typeof(global::SharedData.MySubUnion4), 49 },
+ { typeof(global::SharedData.NestParent.NestContract), 50 },
+ { typeof(global::SharedData.NonEmpty1), 51 },
+ { typeof(global::SharedData.NonEmpty2), 52 },
+ { typeof(global::SharedData.SimpleIntKeyData), 53 },
+ { typeof(global::SharedData.SimpleStringKeyData), 54 },
+ { typeof(global::SharedData.SimpleStructIntKeyData), 55 },
+ { typeof(global::SharedData.SimpleStructStringKeyData), 56 },
+ { typeof(global::SharedData.SubUnionType1), 57 },
+ { typeof(global::SharedData.SubUnionType2), 58 },
+ { typeof(global::SharedData.UnVersionBlockTest), 59 },
+ { typeof(global::SharedData.Vector2), 60 },
+ { typeof(global::SharedData.Vector3Like), 61 },
+ { typeof(global::SharedData.VectorLike2), 62 },
+ { typeof(global::SharedData.Version0), 63 },
+ { typeof(global::SharedData.Version1), 64 },
+ { typeof(global::SharedData.Version2), 65 },
+ { typeof(global::SharedData.VersionBlockTest), 66 },
+ { typeof(global::SharedData.VersioningUnion), 67 },
+ { typeof(global::SharedData.WithIndexer), 68 },
+ { typeof(global::SimpleModel), 69 },
+ { typeof(global::StampMessageBody), 70 },
+ { typeof(global::TextMessageBody), 71 },
};
}
- internal static object GetFormatter(Type t)
+ internal static object GetFormatter(global::System.Type t)
{
int key;
if (!lookup.TryGetValue(t, out key))
@@ -150,50 +155,57 @@ namespace MessagePack.Resolvers
case 18: return new MessagePack.Formatters.ComplexModelFormatter();
case 19: return new MessagePack.Formatters.GlobalManFormatter();
case 20: return new MessagePack.Formatters.MessageFormatter();
- case 21: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter();
- case 22: return new MessagePack.Formatters.QuestMessageBodyFormatter();
- case 23: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter();
- case 24: return new MessagePack.Formatters.SharedData.BarClassFormatter();
- case 25: return new MessagePack.Formatters.SharedData.Callback1Formatter();
- case 26: return new MessagePack.Formatters.SharedData.Callback1_2Formatter();
- case 27: return new MessagePack.Formatters.SharedData.Callback2Formatter();
- case 28: return new MessagePack.Formatters.SharedData.Callback2_2Formatter();
- case 29: return new MessagePack.Formatters.SharedData.Empty1Formatter();
- case 30: return new MessagePack.Formatters.SharedData.Empty2Formatter();
- case 31: return new MessagePack.Formatters.SharedData.EmptyClassFormatter();
- case 32: return new MessagePack.Formatters.SharedData.EmptyStructFormatter();
- case 33: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter();
- case 34: return new MessagePack.Formatters.SharedData.FooClassFormatter();
- case 35: return new MessagePack.Formatters.SharedData.HolderV0Formatter();
- case 36: return new MessagePack.Formatters.SharedData.HolderV1Formatter();
- case 37: return new MessagePack.Formatters.SharedData.HolderV2Formatter();
- case 38: return new MessagePack.Formatters.SharedData.MyClassFormatter();
- case 39: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter();
- case 40: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter();
- case 41: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter();
- case 42: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter();
- case 43: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter();
- case 44: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter();
- case 45: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter();
- case 46: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter();
- case 47: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter();
- case 48: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter();
- case 49: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter();
- case 50: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter();
- case 51: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter();
- case 52: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter();
- case 53: return new MessagePack.Formatters.SharedData.Vector2Formatter();
- case 54: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter();
- case 55: return new MessagePack.Formatters.SharedData.VectorLike2Formatter();
- case 56: return new MessagePack.Formatters.SharedData.Version0Formatter();
- case 57: return new MessagePack.Formatters.SharedData.Version1Formatter();
- case 58: return new MessagePack.Formatters.SharedData.Version2Formatter();
- case 59: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter();
- case 60: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter();
- case 61: return new MessagePack.Formatters.SharedData.WithIndexerFormatter();
- case 62: return new MessagePack.Formatters.SimpleModelFormatter();
- case 63: return new MessagePack.Formatters.StampMessageBodyFormatter();
- case 64: return new MessagePack.Formatters.TextMessageBodyFormatter();
+ case 21: return new MessagePack.Formatters.MessagePackFormatterFieldUserFormatter();
+ case 22: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter();
+ case 23: return new MessagePack.Formatters.QuestMessageBodyFormatter();
+ case 24: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter();
+ case 25: return new MessagePack.Formatters.SharedData.BarClassFormatter();
+ case 26: return new MessagePack.Formatters.SharedData.Callback1Formatter();
+ case 27: return new MessagePack.Formatters.SharedData.Callback1_2Formatter();
+ case 28: return new MessagePack.Formatters.SharedData.Callback2Formatter();
+ case 29: return new MessagePack.Formatters.SharedData.Callback2_2Formatter();
+ case 30: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithExplicitConstructorFormatter();
+ case 31: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithoutExplicitConstructorFormatter();
+ case 32: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyStructWithExplicitConstructorFormatter();
+ case 33: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithExplicitConstructorFormatter();
+ case 34: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithoutExplicitConstructorFormatter();
+ case 35: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyStructWithExplicitConstructorFormatter();
+ case 36: return new MessagePack.Formatters.SharedData.Empty1Formatter();
+ case 37: return new MessagePack.Formatters.SharedData.Empty2Formatter();
+ case 38: return new MessagePack.Formatters.SharedData.EmptyClassFormatter();
+ case 39: return new MessagePack.Formatters.SharedData.EmptyStructFormatter();
+ case 40: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter();
+ case 41: return new MessagePack.Formatters.SharedData.FooClassFormatter();
+ case 42: return new MessagePack.Formatters.SharedData.HolderV0Formatter();
+ case 43: return new MessagePack.Formatters.SharedData.HolderV1Formatter();
+ case 44: return new MessagePack.Formatters.SharedData.HolderV2Formatter();
+ case 45: return new MessagePack.Formatters.SharedData.MyClassFormatter();
+ case 46: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter();
+ case 47: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter();
+ case 48: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter();
+ case 49: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter();
+ case 50: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter();
+ case 51: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter();
+ case 52: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter();
+ case 53: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter();
+ case 54: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter();
+ case 55: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter();
+ case 56: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter();
+ case 57: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter();
+ case 58: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter();
+ case 59: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter();
+ case 60: return new MessagePack.Formatters.SharedData.Vector2Formatter();
+ case 61: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter();
+ case 62: return new MessagePack.Formatters.SharedData.VectorLike2Formatter();
+ case 63: return new MessagePack.Formatters.SharedData.Version0Formatter();
+ case 64: return new MessagePack.Formatters.SharedData.Version1Formatter();
+ case 65: return new MessagePack.Formatters.SharedData.Version2Formatter();
+ case 66: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter();
+ case 67: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter();
+ case 68: return new MessagePack.Formatters.SharedData.WithIndexerFormatter();
+ case 69: return new MessagePack.Formatters.SimpleModelFormatter();
+ case 70: return new MessagePack.Formatters.StampMessageBodyFormatter();
+ case 71: return new MessagePack.Formatters.TextMessageBodyFormatter();
default: return null;
}
}
@@ -206,7 +218,6 @@ namespace MessagePack.Resolvers
#pragma warning restore 612
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1649 // File name should match first type name
@@ -218,25 +229,22 @@ namespace MessagePack.Resolvers
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using MessagePack;
public sealed class GlobalMyEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::GlobalMyEnum>
{
- public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Int32)value);
+ writer.Write((global::System.Int32)value);
}
- public global::GlobalMyEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::GlobalMyEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::GlobalMyEnum)reader.ReadInt32();
}
@@ -248,7 +256,6 @@ namespace MessagePack.Formatters
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -260,25 +267,22 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using MessagePack;
public sealed class ByteEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.ByteEnum>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Byte)value);
+ writer.Write((global::System.Byte)value);
}
- public global::SharedData.ByteEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.ByteEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::SharedData.ByteEnum)reader.ReadByte();
}
@@ -290,7 +294,6 @@ namespace MessagePack.Formatters.SharedData
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -303,32 +306,27 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using System.Collections.Generic;
- using MessagePack;
-
public sealed class IMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::IMessageBody>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public IMessageBodyFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::TextMessageBody).TypeHandle, new KeyValuePair<int, int>(10, 0) },
- { typeof(global::StampMessageBody).TypeHandle, new KeyValuePair<int, int>(14, 1) },
- { typeof(global::QuestMessageBody).TypeHandle, new KeyValuePair<int, int>(25, 2) },
+ { typeof(global::TextMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(10, 0) },
+ { typeof(global::StampMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(14, 1) },
+ { typeof(global::QuestMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(25, 2) },
};
- this.keyToJumpMap = new Dictionary<int, int>(3)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(3)
{
{ 10, 0 },
{ 14, 1 },
@@ -336,9 +334,9 @@ namespace MessagePack.Formatters
};
}
- public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -364,7 +362,7 @@ namespace MessagePack.Formatters
writer.WriteNil();
}
- public global::IMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::IMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -373,7 +371,7 @@ namespace MessagePack.Formatters
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody");
}
options.Security.DepthStep(ref reader);
@@ -414,7 +412,6 @@ namespace MessagePack.Formatters
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -426,38 +423,33 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using System.Collections.Generic;
- using MessagePack;
-
public sealed class IIVersioningUnionFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.IIVersioningUnion>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public IIVersioningUnionFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair<int, int>(0, 0) },
+ { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(0, 0) },
};
- this.keyToJumpMap = new Dictionary<int, int>(1)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(1)
{
{ 0, 0 },
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -477,7 +469,7 @@ namespace MessagePack.Formatters.SharedData
writer.WriteNil();
}
- public global::SharedData.IIVersioningUnion Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.IIVersioningUnion Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -486,7 +478,7 @@ namespace MessagePack.Formatters.SharedData
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion");
}
options.Security.DepthStep(ref reader);
@@ -515,19 +507,19 @@ namespace MessagePack.Formatters.SharedData
public sealed class IUnionCheckerFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.IUnionChecker>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public IUnionCheckerFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair<int, int>(0, 0) },
- { typeof(global::SharedData.MySubUnion2).TypeHandle, new KeyValuePair<int, int>(1, 1) },
- { typeof(global::SharedData.MySubUnion3).TypeHandle, new KeyValuePair<int, int>(2, 2) },
- { typeof(global::SharedData.MySubUnion4).TypeHandle, new KeyValuePair<int, int>(3, 3) },
+ { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(0, 0) },
+ { typeof(global::SharedData.MySubUnion2).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(1, 1) },
+ { typeof(global::SharedData.MySubUnion3).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(2, 2) },
+ { typeof(global::SharedData.MySubUnion4).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(3, 3) },
};
- this.keyToJumpMap = new Dictionary<int, int>(4)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(4)
{
{ 0, 0 },
{ 1, 1 },
@@ -536,9 +528,9 @@ namespace MessagePack.Formatters.SharedData
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -567,7 +559,7 @@ namespace MessagePack.Formatters.SharedData
writer.WriteNil();
}
- public global::SharedData.IUnionChecker Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.IUnionChecker Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -576,7 +568,7 @@ namespace MessagePack.Formatters.SharedData
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker");
}
options.Security.DepthStep(ref reader);
@@ -614,19 +606,19 @@ namespace MessagePack.Formatters.SharedData
public sealed class IUnionChecker2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.IUnionChecker2>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public IUnionChecker2Formatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.MySubUnion2).TypeHandle, new KeyValuePair<int, int>(31, 0) },
- { typeof(global::SharedData.MySubUnion3).TypeHandle, new KeyValuePair<int, int>(42, 1) },
- { typeof(global::SharedData.MySubUnion4).TypeHandle, new KeyValuePair<int, int>(63, 2) },
- { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair<int, int>(120, 3) },
+ { typeof(global::SharedData.MySubUnion2).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(31, 0) },
+ { typeof(global::SharedData.MySubUnion3).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(42, 1) },
+ { typeof(global::SharedData.MySubUnion4).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(63, 2) },
+ { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(120, 3) },
};
- this.keyToJumpMap = new Dictionary<int, int>(4)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(4)
{
{ 31, 0 },
{ 42, 1 },
@@ -635,9 +627,9 @@ namespace MessagePack.Formatters.SharedData
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChecker2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionChecker2 value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -666,7 +658,7 @@ namespace MessagePack.Formatters.SharedData
writer.WriteNil();
}
- public global::SharedData.IUnionChecker2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.IUnionChecker2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -675,7 +667,7 @@ namespace MessagePack.Formatters.SharedData
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker2");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker2");
}
options.Security.DepthStep(ref reader);
@@ -713,26 +705,26 @@ namespace MessagePack.Formatters.SharedData
public sealed class IUnionSampleFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.IUnionSample>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public IUnionSampleFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.FooClass).TypeHandle, new KeyValuePair<int, int>(0, 0) },
- { typeof(global::SharedData.BarClass).TypeHandle, new KeyValuePair<int, int>(100, 1) },
+ { typeof(global::SharedData.FooClass).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(0, 0) },
+ { typeof(global::SharedData.BarClass).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(100, 1) },
};
- this.keyToJumpMap = new Dictionary<int, int>(2)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(2)
{
{ 0, 0 },
{ 100, 1 },
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionSample value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionSample value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -755,7 +747,7 @@ namespace MessagePack.Formatters.SharedData
writer.WriteNil();
}
- public global::SharedData.IUnionSample Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.IUnionSample Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -764,7 +756,7 @@ namespace MessagePack.Formatters.SharedData
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionSample");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionSample");
}
options.Security.DepthStep(ref reader);
@@ -796,26 +788,26 @@ namespace MessagePack.Formatters.SharedData
public sealed class RootUnionTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.RootUnionType>
{
- private readonly Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>> typeToKeyAndJumpMap;
- private readonly Dictionary<int, int> keyToJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>> typeToKeyAndJumpMap;
+ private readonly global::System.Collections.Generic.Dictionary<int, int> keyToJumpMap;
public RootUnionTypeFormatter()
{
- this.typeToKeyAndJumpMap = new Dictionary<RuntimeTypeHandle, KeyValuePair<int, int>>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
+ this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary<global::System.RuntimeTypeHandle, global::System.Collections.Generic.KeyValuePair<int, int>>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)
{
- { typeof(global::SharedData.SubUnionType1).TypeHandle, new KeyValuePair<int, int>(0, 0) },
- { typeof(global::SharedData.SubUnionType2).TypeHandle, new KeyValuePair<int, int>(1, 1) },
+ { typeof(global::SharedData.SubUnionType1).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(0, 0) },
+ { typeof(global::SharedData.SubUnionType2).TypeHandle, new global::System.Collections.Generic.KeyValuePair<int, int>(1, 1) },
};
- this.keyToJumpMap = new Dictionary<int, int>(2)
+ this.keyToJumpMap = new global::System.Collections.Generic.Dictionary<int, int>(2)
{
{ 0, 0 },
{ 1, 1 },
};
}
- public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnionType value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.RootUnionType value, global::MessagePack.MessagePackSerializerOptions options)
{
- KeyValuePair<int, int> keyValuePair;
+ global::System.Collections.Generic.KeyValuePair<int, int> keyValuePair;
if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair))
{
writer.WriteArrayHeader(2);
@@ -838,7 +830,7 @@ namespace MessagePack.Formatters.SharedData
writer.WriteNil();
}
- public global::SharedData.RootUnionType Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.RootUnionType Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -847,7 +839,7 @@ namespace MessagePack.Formatters.SharedData
if (reader.ReadArrayHeader() != 2)
{
- throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.RootUnionType");
+ throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.RootUnionType");
}
options.Security.DepthStep(ref reader);
@@ -885,7 +877,6 @@ namespace MessagePack.Formatters.SharedData
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -898,9 +889,9 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -908,14 +899,10 @@ namespace MessagePack.Formatters.SharedData
namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
{
- using System;
- using System.Buffers;
- using MessagePack;
-
public sealed class TnonodsfarnoiuAtatqagaFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga>
{
- public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -927,7 +914,7 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
writer.Write(value.MyProperty);
}
- public global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -936,14 +923,14 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
+ var ____result = new global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -951,12 +938,11 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
}
}
- var ____result = new global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga();
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
}
+
}
#pragma warning restore 168
@@ -965,7 +951,6 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
#pragma warning restore 612
#pragma warning restore SA1129 // Do not use default value type constructor
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1309 // Field names should not begin with underscore
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
#pragma warning restore SA1403 // File may only contain a single namespace
@@ -979,9 +964,9 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -989,14 +974,10 @@ namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using MessagePack;
-
public sealed class ArrayTestTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::ArrayTestTest>
{
- public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ArrayTestTest value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1004,18 +985,18 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(7);
- formatterResolver.GetFormatterWithVerify<int[]>().Serialize(ref writer, value.MyProperty0, options);
- formatterResolver.GetFormatterWithVerify<int[,]>().Serialize(ref writer, value.MyProperty1, options);
- formatterResolver.GetFormatterWithVerify<global::GlobalMyEnum[,]>().Serialize(ref writer, value.MyProperty2, options);
- formatterResolver.GetFormatterWithVerify<int[,,]>().Serialize(ref writer, value.MyProperty3, options);
- formatterResolver.GetFormatterWithVerify<int[,,,]>().Serialize(ref writer, value.MyProperty4, options);
- formatterResolver.GetFormatterWithVerify<global::GlobalMyEnum[]>().Serialize(ref writer, value.MyProperty5, options);
- formatterResolver.GetFormatterWithVerify<global::QuestMessageBody[]>().Serialize(ref writer, value.MyProperty6, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[]>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,]>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::GlobalMyEnum[,]>(formatterResolver).Serialize(ref writer, value.MyProperty2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,,]>(formatterResolver).Serialize(ref writer, value.MyProperty3, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,,,]>(formatterResolver).Serialize(ref writer, value.MyProperty4, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::GlobalMyEnum[]>(formatterResolver).Serialize(ref writer, value.MyProperty5, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::QuestMessageBody[]>(formatterResolver).Serialize(ref writer, value.MyProperty6, options);
}
- public global::ArrayTestTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::ArrayTestTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1023,40 +1004,34 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(int[]);
- var __MyProperty1__ = default(int[,]);
- var __MyProperty2__ = default(global::GlobalMyEnum[,]);
- var __MyProperty3__ = default(int[,,]);
- var __MyProperty4__ = default(int[,,,]);
- var __MyProperty5__ = default(global::GlobalMyEnum[]);
- var __MyProperty6__ = default(global::QuestMessageBody[]);
+ var ____result = new global::ArrayTestTest();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<int[]>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[]>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<int[,]>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,]>(formatterResolver).Deserialize(ref reader, options);
break;
case 2:
- __MyProperty2__ = formatterResolver.GetFormatterWithVerify<global::GlobalMyEnum[,]>().Deserialize(ref reader, options);
+ ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::GlobalMyEnum[,]>(formatterResolver).Deserialize(ref reader, options);
break;
case 3:
- __MyProperty3__ = formatterResolver.GetFormatterWithVerify<int[,,]>().Deserialize(ref reader, options);
+ ____result.MyProperty3 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,,]>(formatterResolver).Deserialize(ref reader, options);
break;
case 4:
- __MyProperty4__ = formatterResolver.GetFormatterWithVerify<int[,,,]>().Deserialize(ref reader, options);
+ ____result.MyProperty4 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[,,,]>(formatterResolver).Deserialize(ref reader, options);
break;
case 5:
- __MyProperty5__ = formatterResolver.GetFormatterWithVerify<global::GlobalMyEnum[]>().Deserialize(ref reader, options);
+ ____result.MyProperty5 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::GlobalMyEnum[]>(formatterResolver).Deserialize(ref reader, options);
break;
case 6:
- __MyProperty6__ = formatterResolver.GetFormatterWithVerify<global::QuestMessageBody[]>().Deserialize(ref reader, options);
+ ____result.MyProperty6 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::QuestMessageBody[]>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -1064,14 +1039,6 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::ArrayTestTest();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty3 = __MyProperty3__;
- ____result.MyProperty4 = __MyProperty4__;
- ____result.MyProperty5 = __MyProperty5__;
- ____result.MyProperty6 = __MyProperty6__;
reader.Depth--;
return ____result;
}
@@ -1080,7 +1047,7 @@ namespace MessagePack.Formatters
public sealed class GlobalManFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::GlobalMan>
{
- public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::GlobalMan value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1092,7 +1059,7 @@ namespace MessagePack.Formatters
writer.Write(value.MyProperty);
}
- public global::GlobalMan Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::GlobalMan Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1101,14 +1068,14 @@ namespace MessagePack.Formatters
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
+ var ____result = new global::GlobalMan();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -1116,8 +1083,6 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::GlobalMan();
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
@@ -1126,7 +1091,7 @@ namespace MessagePack.Formatters
public sealed class MessageFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::Message>
{
- public void Serialize(ref MessagePackWriter writer, global::Message value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::Message value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1134,15 +1099,15 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(4);
writer.Write(value.UserId);
writer.Write(value.RoomId);
- formatterResolver.GetFormatterWithVerify<global::System.DateTime>().Serialize(ref writer, value.PostTime, options);
- formatterResolver.GetFormatterWithVerify<global::IMessageBody>().Serialize(ref writer, value.Body, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTime>(formatterResolver).Serialize(ref writer, value.PostTime, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::IMessageBody>(formatterResolver).Serialize(ref writer, value.Body, options);
}
- public global::Message Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::Message Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1150,28 +1115,70 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __UserId__ = default(int);
- var __RoomId__ = default(int);
- var __PostTime__ = default(global::System.DateTime);
- var __Body__ = default(global::IMessageBody);
+ var ____result = new global::Message();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __UserId__ = reader.ReadInt32();
+ ____result.UserId = reader.ReadInt32();
break;
case 1:
- __RoomId__ = reader.ReadInt32();
+ ____result.RoomId = reader.ReadInt32();
break;
case 2:
- __PostTime__ = formatterResolver.GetFormatterWithVerify<global::System.DateTime>().Deserialize(ref reader, options);
+ ____result.PostTime = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTime>(formatterResolver).Deserialize(ref reader, options);
break;
case 3:
- __Body__ = formatterResolver.GetFormatterWithVerify<global::IMessageBody>().Deserialize(ref reader, options);
+ ____result.Body = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::IMessageBody>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ default:
+ reader.Skip();
+ break;
+ }
+ }
+
+ reader.Depth--;
+ return ____result;
+ }
+ }
+
+ public sealed class MessagePackFormatterFieldUserFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::MessagePackFormatterFieldUser>
+ {
+ private readonly global::MessagePack.Formatters.NativeDateTimeFormatter __TimestampCustomFormatter__ = new global::MessagePack.Formatters.NativeDateTimeFormatter();
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::MessagePackFormatterFieldUser value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value == null)
+ {
+ writer.WriteNil();
+ return;
+ }
+
+ writer.WriteArrayHeader(1);
+ this.__TimestampCustomFormatter__.Serialize(ref writer, value.Timestamp, options);
+ }
+
+ public global::MessagePackFormatterFieldUser Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ options.Security.DepthStep(ref reader);
+ var length = reader.ReadArrayHeader();
+ var ____result = new global::MessagePackFormatterFieldUser();
+
+ for (int i = 0; i < length; i++)
+ {
+ switch (i)
+ {
+ case 0:
+ ____result.Timestamp = this.__TimestampCustomFormatter__.Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -1179,11 +1186,6 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::Message();
- ____result.UserId = __UserId__;
- ____result.RoomId = __RoomId__;
- ____result.PostTime = __PostTime__;
- ____result.Body = __Body__;
reader.Depth--;
return ____result;
}
@@ -1192,7 +1194,7 @@ namespace MessagePack.Formatters
public sealed class QuestMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::QuestMessageBody>
{
- public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::QuestMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1200,13 +1202,13 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
writer.Write(value.QuestId);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Text, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Text, options);
}
- public global::QuestMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::QuestMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1214,20 +1216,19 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __QuestId__ = default(int);
- var __Text__ = default(string);
+ var ____result = new global::QuestMessageBody();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __QuestId__ = reader.ReadInt32();
+ ____result.QuestId = reader.ReadInt32();
break;
case 1:
- __Text__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Text = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -1235,9 +1236,6 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::QuestMessageBody();
- ____result.QuestId = __QuestId__;
- ____result.Text = __Text__;
reader.Depth--;
return ____result;
}
@@ -1246,7 +1244,7 @@ namespace MessagePack.Formatters
public sealed class StampMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::StampMessageBody>
{
- public void Serialize(ref MessagePackWriter writer, global::StampMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::StampMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1258,7 +1256,7 @@ namespace MessagePack.Formatters
writer.Write(value.StampId);
}
- public global::StampMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::StampMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1267,14 +1265,14 @@ namespace MessagePack.Formatters
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __StampId__ = default(int);
+ var ____result = new global::StampMessageBody();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __StampId__ = reader.ReadInt32();
+ ____result.StampId = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -1282,8 +1280,6 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::StampMessageBody();
- ____result.StampId = __StampId__;
reader.Depth--;
return ____result;
}
@@ -1292,7 +1288,7 @@ namespace MessagePack.Formatters
public sealed class TextMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TextMessageBody>
{
- public void Serialize(ref MessagePackWriter writer, global::TextMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TextMessageBody value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1300,12 +1296,12 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(1);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Text, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Text, options);
}
- public global::TextMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::TextMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1313,16 +1309,16 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __Text__ = default(string);
+ var ____result = new global::TextMessageBody();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __Text__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Text = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -1330,12 +1326,11 @@ namespace MessagePack.Formatters
}
}
- var ____result = new global::TextMessageBody();
- ____result.Text = __Text__;
reader.Depth--;
return ____result;
}
}
+
}
#pragma warning restore 168
@@ -1344,7 +1339,6 @@ namespace MessagePack.Formatters
#pragma warning restore 612
#pragma warning restore SA1129 // Do not use default value type constructor
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1309 // Field names should not begin with underscore
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
#pragma warning restore SA1403 // File may only contain a single namespace
@@ -1358,9 +1352,9 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -1368,11 +1362,6 @@ namespace MessagePack.Formatters
namespace MessagePack.Formatters
{
- using System;
- using System.Buffers;
- using System.Runtime.InteropServices;
- using MessagePack;
-
public sealed class ComplexModelFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::ComplexModel>
{
// AdditionalProperty
@@ -1396,20 +1385,20 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(6);
writer.WriteRaw(GetSpan_AdditionalProperty());
- formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.IDictionary<string, string>>().Serialize(ref writer, value.AdditionalProperty, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.IDictionary<string, string>>(formatterResolver).Serialize(ref writer, value.AdditionalProperty, options);
writer.WriteRaw(GetSpan_CreatedOn());
- formatterResolver.GetFormatterWithVerify<global::System.DateTimeOffset>().Serialize(ref writer, value.CreatedOn, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTimeOffset>(formatterResolver).Serialize(ref writer, value.CreatedOn, options);
writer.WriteRaw(GetSpan_Id());
- formatterResolver.GetFormatterWithVerify<global::System.Guid>().Serialize(ref writer, value.Id, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Guid>(formatterResolver).Serialize(ref writer, value.Id, options);
writer.WriteRaw(GetSpan_Name());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Name, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Name, options);
writer.WriteRaw(GetSpan_UpdatedOn());
- formatterResolver.GetFormatterWithVerify<global::System.DateTimeOffset>().Serialize(ref writer, value.UpdatedOn, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTimeOffset>(formatterResolver).Serialize(ref writer, value.UpdatedOn, options);
writer.WriteRaw(GetSpan_SimpleModels());
- formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.IList<global::SimpleModel>>().Serialize(ref writer, value.SimpleModels, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.IList<global::SimpleModel>>(formatterResolver).Serialize(ref writer, value.SimpleModels, options);
}
public global::ComplexModel Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -1420,18 +1409,13 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __AdditionalProperty__ = default(global::System.Collections.Generic.IDictionary<string, string>);
- var __CreatedOn__ = default(global::System.DateTimeOffset);
- var __Id__ = default(global::System.Guid);
- var __Name__ = default(string);
- var __UpdatedOn__ = default(global::System.DateTimeOffset);
- var __SimpleModels__ = default(global::System.Collections.Generic.IList<global::SimpleModel>);
+ var ____result = new global::ComplexModel();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -1441,7 +1425,7 @@ namespace MessagePack.Formatters
case 18:
if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_AdditionalProperty().Slice(1))) { goto FAIL; }
- __AdditionalProperty__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.IDictionary<string, string>>().Deserialize(ref reader, options);
+ reader.Skip();
continue;
case 9:
switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
@@ -1450,43 +1434,35 @@ namespace MessagePack.Formatters
case 5720808977192022595UL:
if (stringKey[0] != 110) { goto FAIL; }
- __CreatedOn__ = formatterResolver.GetFormatterWithVerify<global::System.DateTimeOffset>().Deserialize(ref reader, options);
+ ____result.CreatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTimeOffset>(formatterResolver).Deserialize(ref reader, options);
continue;
case 5720808977191956565UL:
if (stringKey[0] != 110) { goto FAIL; }
- __UpdatedOn__ = formatterResolver.GetFormatterWithVerify<global::System.DateTimeOffset>().Deserialize(ref reader, options);
+ ____result.UpdatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTimeOffset>(formatterResolver).Deserialize(ref reader, options);
continue;
}
case 2:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 25673UL) { goto FAIL; }
- __Id__ = formatterResolver.GetFormatterWithVerify<global::System.Guid>().Deserialize(ref reader, options);
+ ____result.Id = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Guid>(formatterResolver).Deserialize(ref reader, options);
continue;
case 4:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 1701667150UL) { goto FAIL; }
- __Name__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Name = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
case 12:
if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_SimpleModels().Slice(1))) { goto FAIL; }
- __SimpleModels__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.IList<global::SimpleModel>>().Deserialize(ref reader, options);
+ reader.Skip();
continue;
}
}
- var ____result = new global::ComplexModel()
- {
- CreatedOn = __CreatedOn__,
- Id = __Id__,
- Name = __Name__,
- UpdatedOn = __UpdatedOn__,
- };
-
reader.Depth--;
return ____result;
}
@@ -1515,18 +1491,18 @@ namespace MessagePack.Formatters
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(6);
writer.WriteRaw(GetSpan_Id());
writer.Write(value.Id);
writer.WriteRaw(GetSpan_Name());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Name, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Name, options);
writer.WriteRaw(GetSpan_CreatedOn());
- formatterResolver.GetFormatterWithVerify<global::System.DateTime>().Serialize(ref writer, value.CreatedOn, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTime>(formatterResolver).Serialize(ref writer, value.CreatedOn, options);
writer.WriteRaw(GetSpan_Precision());
writer.Write(value.Precision);
writer.WriteRaw(GetSpan_Money());
- formatterResolver.GetFormatterWithVerify<decimal>().Serialize(ref writer, value.Money, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<decimal>(formatterResolver).Serialize(ref writer, value.Money, options);
writer.WriteRaw(GetSpan_Amount());
writer.Write(value.Amount);
}
@@ -1539,18 +1515,13 @@ namespace MessagePack.Formatters
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __Id__ = default(int);
- var __Name__ = default(string);
- var __CreatedOn__ = default(global::System.DateTime);
- var __Precision__ = default(int);
- var __Money__ = default(decimal);
- var __Amount__ = default(long);
+ var ____result = new global::SimpleModel();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -1560,12 +1531,12 @@ namespace MessagePack.Formatters
case 2:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 25673UL) { goto FAIL; }
- __Id__ = reader.ReadInt32();
+ ____result.Id = reader.ReadInt32();
continue;
case 4:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 1701667150UL) { goto FAIL; }
- __Name__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Name = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
case 9:
switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
@@ -1574,45 +1545,48 @@ namespace MessagePack.Formatters
case 5720808977192022595UL:
if (stringKey[0] != 110) { goto FAIL; }
- __CreatedOn__ = formatterResolver.GetFormatterWithVerify<global::System.DateTime>().Deserialize(ref reader, options);
+ ____result.CreatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.DateTime>(formatterResolver).Deserialize(ref reader, options);
continue;
case 8028074707240972880UL:
if (stringKey[0] != 110) { goto FAIL; }
- __Precision__ = reader.ReadInt32();
+ ____result.Precision = reader.ReadInt32();
continue;
}
case 5:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 521392779085UL) { goto FAIL; }
- __Money__ = formatterResolver.GetFormatterWithVerify<decimal>().Deserialize(ref reader, options);
+ ____result.Money = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<decimal>(formatterResolver).Deserialize(ref reader, options);
continue;
case 6:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 128017765461313UL) { goto FAIL; }
- __Amount__ = reader.ReadInt64();
+ reader.Skip();
continue;
}
}
- var ____result = new global::SimpleModel()
- {
- Id = __Id__,
- Name = __Name__,
- CreatedOn = __CreatedOn__,
- Precision = __Precision__,
- Money = __Money__,
- };
-
reader.Depth--;
return ____result;
}
}
+
}
+#pragma warning restore 168
+#pragma warning restore 414
+#pragma warning restore 618
+#pragma warning restore 612
+
+#pragma warning restore SA1129 // Do not use default value type constructor
+#pragma warning restore SA1309 // Field names should not begin with underscore
+#pragma warning restore SA1312 // Variable names should begin with lower-case letter
+#pragma warning restore SA1403 // File may only contain a single namespace
+#pragma warning restore SA1649 // File name should match first type name
+
// <auto-generated>
// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT.
// </auto-generated>
@@ -1621,9 +1595,9 @@ namespace MessagePack.Formatters
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -1631,11 +1605,6 @@ namespace MessagePack.Formatters
namespace MessagePack.Formatters.PerfBenchmarkDotNet
{
- using System;
- using System.Buffers;
- using System.Runtime.InteropServices;
- using MessagePack;
-
public sealed class StringKeySerializerTargetFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::PerfBenchmarkDotNet.StringKeySerializerTarget>
{
// MyProperty1
@@ -1695,19 +1664,11 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
options.Security.DepthStep(ref reader);
var length = reader.ReadMapHeader();
- var __MyProperty1__ = default(int);
- var __MyProperty2__ = default(int);
- var __MyProperty3__ = default(int);
- var __MyProperty4__ = default(int);
- var __MyProperty5__ = default(int);
- var __MyProperty6__ = default(int);
- var __MyProperty7__ = default(int);
- var __MyProperty8__ = default(int);
- var __MyProperty9__ = default(int);
+ var ____result = new global::PerfBenchmarkDotNet.StringKeySerializerTarget();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -1723,31 +1684,31 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
{
default: goto FAIL;
case 3242356UL:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
continue;
case 3307892UL:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
continue;
case 3373428UL:
- __MyProperty3__ = reader.ReadInt32();
+ ____result.MyProperty3 = reader.ReadInt32();
continue;
case 3438964UL:
- __MyProperty4__ = reader.ReadInt32();
+ ____result.MyProperty4 = reader.ReadInt32();
continue;
case 3504500UL:
- __MyProperty5__ = reader.ReadInt32();
+ ____result.MyProperty5 = reader.ReadInt32();
continue;
case 3570036UL:
- __MyProperty6__ = reader.ReadInt32();
+ ____result.MyProperty6 = reader.ReadInt32();
continue;
case 3635572UL:
- __MyProperty7__ = reader.ReadInt32();
+ ____result.MyProperty7 = reader.ReadInt32();
continue;
case 3701108UL:
- __MyProperty8__ = reader.ReadInt32();
+ ____result.MyProperty8 = reader.ReadInt32();
continue;
case 3766644UL:
- __MyProperty9__ = reader.ReadInt32();
+ ____result.MyProperty9 = reader.ReadInt32();
continue;
}
@@ -1756,25 +1717,24 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
}
}
- var ____result = new global::PerfBenchmarkDotNet.StringKeySerializerTarget()
- {
- MyProperty1 = __MyProperty1__,
- MyProperty2 = __MyProperty2__,
- MyProperty3 = __MyProperty3__,
- MyProperty4 = __MyProperty4__,
- MyProperty5 = __MyProperty5__,
- MyProperty6 = __MyProperty6__,
- MyProperty7 = __MyProperty7__,
- MyProperty8 = __MyProperty8__,
- MyProperty9 = __MyProperty9__,
- };
-
reader.Depth--;
return ____result;
}
}
+
}
+#pragma warning restore 168
+#pragma warning restore 414
+#pragma warning restore 618
+#pragma warning restore 612
+
+#pragma warning restore SA1129 // Do not use default value type constructor
+#pragma warning restore SA1309 // Field names should not begin with underscore
+#pragma warning restore SA1312 // Variable names should begin with lower-case letter
+#pragma warning restore SA1403 // File may only contain a single namespace
+#pragma warning restore SA1649 // File name should match first type name
+
// <auto-generated>
// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT.
// </auto-generated>
@@ -1783,9 +1743,9 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -1793,14 +1753,10 @@ namespace MessagePack.Formatters.PerfBenchmarkDotNet
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using MessagePack;
-
public sealed class ArrayOptimizeClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.ArrayOptimizeClass>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOptimizeClass value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.ArrayOptimizeClass value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1827,7 +1783,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty15);
}
- public global::SharedData.ArrayOptimizeClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.ArrayOptimizeClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1836,74 +1792,59 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(int);
- var __MyProperty1__ = default(int);
- var __MyProperty2__ = default(int);
- var __MyProperty3__ = default(int);
- var __MyProperty4__ = default(int);
- var __MyProperty5__ = default(int);
- var __MyProperty6__ = default(int);
- var __MyProperty7__ = default(int);
- var __MyProperty8__ = default(int);
- var __MyProvperty9__ = default(int);
- var __MyProperty10__ = default(int);
- var __MyProperty11__ = default(int);
- var __MyPropverty12__ = default(int);
- var __MyPropevrty13__ = default(int);
- var __MyProperty14__ = default(int);
- var __MyProperty15__ = default(int);
+ var ____result = new global::SharedData.ArrayOptimizeClass();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = reader.ReadInt32();
+ ____result.MyProperty0 = reader.ReadInt32();
break;
case 1:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
break;
case 2:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
case 3:
- __MyProperty3__ = reader.ReadInt32();
+ ____result.MyProperty3 = reader.ReadInt32();
break;
case 4:
- __MyProperty4__ = reader.ReadInt32();
+ ____result.MyProperty4 = reader.ReadInt32();
break;
case 5:
- __MyProperty5__ = reader.ReadInt32();
+ ____result.MyProperty5 = reader.ReadInt32();
break;
case 6:
- __MyProperty6__ = reader.ReadInt32();
+ ____result.MyProperty6 = reader.ReadInt32();
break;
case 7:
- __MyProperty7__ = reader.ReadInt32();
+ ____result.MyProperty7 = reader.ReadInt32();
break;
case 8:
- __MyProperty8__ = reader.ReadInt32();
+ ____result.MyProperty8 = reader.ReadInt32();
break;
case 9:
- __MyProvperty9__ = reader.ReadInt32();
+ ____result.MyProvperty9 = reader.ReadInt32();
break;
case 10:
- __MyProperty10__ = reader.ReadInt32();
+ ____result.MyProperty10 = reader.ReadInt32();
break;
case 11:
- __MyProperty11__ = reader.ReadInt32();
+ ____result.MyProperty11 = reader.ReadInt32();
break;
case 12:
- __MyPropverty12__ = reader.ReadInt32();
+ ____result.MyPropverty12 = reader.ReadInt32();
break;
case 13:
- __MyPropevrty13__ = reader.ReadInt32();
+ ____result.MyPropevrty13 = reader.ReadInt32();
break;
case 14:
- __MyProperty14__ = reader.ReadInt32();
+ ____result.MyProperty14 = reader.ReadInt32();
break;
case 15:
- __MyProperty15__ = reader.ReadInt32();
+ ____result.MyProperty15 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -1911,23 +1852,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.ArrayOptimizeClass();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty3 = __MyProperty3__;
- ____result.MyProperty4 = __MyProperty4__;
- ____result.MyProperty5 = __MyProperty5__;
- ____result.MyProperty6 = __MyProperty6__;
- ____result.MyProperty7 = __MyProperty7__;
- ____result.MyProperty8 = __MyProperty8__;
- ____result.MyProvperty9 = __MyProvperty9__;
- ____result.MyProperty10 = __MyProperty10__;
- ____result.MyProperty11 = __MyProperty11__;
- ____result.MyPropverty12 = __MyPropverty12__;
- ____result.MyPropevrty13 = __MyPropevrty13__;
- ____result.MyProperty14 = __MyProperty14__;
- ____result.MyProperty15 = __MyProperty15__;
reader.Depth--;
return ____result;
}
@@ -1936,7 +1860,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class BarClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.BarClass>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.BarClass value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1944,12 +1868,12 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(1);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.OPQ, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.OPQ, options);
}
- public global::SharedData.BarClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.BarClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -1957,16 +1881,16 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __OPQ__ = default(string);
+ var ____result = new global::SharedData.BarClass();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __OPQ__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.OPQ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -1974,8 +1898,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.BarClass();
- ____result.OPQ = __OPQ__;
reader.Depth--;
return ____result;
}
@@ -1984,7 +1906,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Callback1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Callback1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Callback1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -1997,7 +1919,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.X);
}
- public global::SharedData.Callback1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Callback1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2022,7 +1944,6 @@ namespace MessagePack.Formatters.SharedData
}
var ____result = new global::SharedData.Callback1(__X__);
- ____result.X = __X__;
____result.OnAfterDeserialize();
reader.Depth--;
return ____result;
@@ -2032,7 +1953,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Callback1_2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Callback1_2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1_2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Callback1_2 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2040,12 +1961,12 @@ namespace MessagePack.Formatters.SharedData
return;
}
- ((IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize();
+ ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize();
writer.WriteArrayHeader(1);
writer.Write(value.X);
}
- public global::SharedData.Callback1_2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Callback1_2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2070,81 +1991,61 @@ namespace MessagePack.Formatters.SharedData
}
var ____result = new global::SharedData.Callback1_2(__X__);
- ____result.X = __X__;
- ((IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize();
+ ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize();
reader.Depth--;
return ____result;
}
}
- public sealed class DynamicArgumentTupleFormatter<T1,T2,T3,T4,T5,T6,T7,T8,T9> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>>
+ public sealed class DefaultValueIntKeyClassWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
{
- IFormatterResolver formatterResolver = options.Resolver;
- writer.WriteArrayHeader(9);
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.Item1, options);
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.Item2, options);
- formatterResolver.GetFormatterWithVerify<T3>().Serialize(ref writer, value.Item3, options);
- formatterResolver.GetFormatterWithVerify<T4>().Serialize(ref writer, value.Item4, options);
- formatterResolver.GetFormatterWithVerify<T5>().Serialize(ref writer, value.Item5, options);
- formatterResolver.GetFormatterWithVerify<T6>().Serialize(ref writer, value.Item6, options);
- formatterResolver.GetFormatterWithVerify<T7>().Serialize(ref writer, value.Item7, options);
- formatterResolver.GetFormatterWithVerify<T8>().Serialize(ref writer, value.Item8, options);
- formatterResolver.GetFormatterWithVerify<T9>().Serialize(ref writer, value.Item9, options);
+ if (value == null)
+ {
+ writer.WriteNil();
+ return;
+ }
+
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
+ writer.WriteArrayHeader(4);
+ writer.Write(value.Prop1);
+ writer.Write(value.Prop2);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Prop3, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Prop4, options);
}
- public global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ return null;
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __Item1__ = default(T1);
- var __Item2__ = default(T2);
- var __Item3__ = default(T3);
- var __Item4__ = default(T4);
- var __Item5__ = default(T5);
- var __Item6__ = default(T6);
- var __Item7__ = default(T7);
- var __Item8__ = default(T8);
- var __Item9__ = default(T9);
+ var __Prop1__ = default(int);
+ var __Prop2__ = default(int);
+ var __Prop3__ = default(string);
+ var __Prop4__ = default(string);
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __Item1__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ __Prop1__ = reader.ReadInt32();
break;
case 1:
- __Item2__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ __Prop2__ = reader.ReadInt32();
break;
case 2:
- __Item3__ = formatterResolver.GetFormatterWithVerify<T3>().Deserialize(ref reader, options);
+ __Prop3__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
case 3:
- __Item4__ = formatterResolver.GetFormatterWithVerify<T4>().Deserialize(ref reader, options);
- break;
- case 4:
- __Item5__ = formatterResolver.GetFormatterWithVerify<T5>().Deserialize(ref reader, options);
- break;
- case 5:
- __Item6__ = formatterResolver.GetFormatterWithVerify<T6>().Deserialize(ref reader, options);
- break;
- case 6:
- __Item7__ = formatterResolver.GetFormatterWithVerify<T7>().Deserialize(ref reader, options);
- break;
- case 7:
- __Item8__ = formatterResolver.GetFormatterWithVerify<T8>().Deserialize(ref reader, options);
- break;
- case 8:
- __Item9__ = formatterResolver.GetFormatterWithVerify<T9>().Deserialize(ref reader, options);
+ __Prop4__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -2152,16 +2053,36 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(__Item1__, __Item2__, __Item3__, __Item4__, __Item5__, __Item6__, __Item7__, __Item8__, __Item9__);
+ var ____result = new global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor(__Prop1__);
+ if (length <= 1)
+ {
+ goto MEMBER_ASSIGNMENT_END;
+ }
+
+ ____result.Prop2 = __Prop2__;
+ if (length <= 2)
+ {
+ goto MEMBER_ASSIGNMENT_END;
+ }
+
+ ____result.Prop3 = __Prop3__;
+ if (length <= 3)
+ {
+ goto MEMBER_ASSIGNMENT_END;
+ }
+
+ ____result.Prop4 = __Prop4__;
+
+ MEMBER_ASSIGNMENT_END:
reader.Depth--;
return ____result;
}
}
- public sealed class Empty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Empty1>
+ public sealed class DefaultValueIntKeyClassWithoutExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Empty1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2169,10 +2090,12 @@ namespace MessagePack.Formatters.SharedData
return;
}
- writer.WriteArrayHeader(0);
+ writer.WriteArrayHeader(2);
+ writer.Write(value.Prop1);
+ writer.Write(value.Prop2);
}
- public global::SharedData.Empty1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2181,101 +2104,238 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
+ var ____result = new global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor();
for (int i = 0; i < length; i++)
{
switch (i)
{
+ case 0:
+ ____result.Prop1 = reader.ReadInt32();
+ break;
+ case 1:
+ ____result.Prop2 = reader.ReadInt32();
+ break;
default:
reader.Skip();
break;
}
}
- var ____result = new global::SharedData.Empty1();
reader.Depth--;
return ____result;
}
}
- public sealed class EmptyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.EmptyClass>
+ public sealed class DefaultValueIntKeyStructWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.EmptyClass value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
{
- if (value == null)
- {
- writer.WriteNil();
- return;
- }
-
- writer.WriteArrayHeader(0);
+ writer.WriteArrayHeader(2);
+ writer.Write(value.Prop1);
+ writer.Write(value.Prop2);
}
- public global::SharedData.EmptyClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- return null;
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
+ var __Prop1__ = default(int);
+ var __Prop2__ = default(int);
for (int i = 0; i < length; i++)
{
switch (i)
{
+ case 0:
+ __Prop1__ = reader.ReadInt32();
+ break;
+ case 1:
+ __Prop2__ = reader.ReadInt32();
+ break;
default:
reader.Skip();
break;
}
}
- var ____result = new global::SharedData.EmptyClass();
+ var ____result = new global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor(__Prop1__);
+ if (length <= 1)
+ {
+ goto MEMBER_ASSIGNMENT_END;
+ }
+
+ ____result.Prop2 = __Prop2__;
+
+ MEMBER_ASSIGNMENT_END:
reader.Depth--;
return ____result;
}
}
- public sealed class EmptyStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.EmptyStruct>
+ public sealed class DynamicArgumentTupleFormatter<T1, T2, T3, T4, T5, T6, T7, T8, T9> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.EmptyStruct value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.WriteArrayHeader(0);
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
+ writer.WriteArrayHeader(9);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.Item1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.Item2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T3>(formatterResolver).Serialize(ref writer, value.Item3, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T4>(formatterResolver).Serialize(ref writer, value.Item4, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T5>(formatterResolver).Serialize(ref writer, value.Item5, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T6>(formatterResolver).Serialize(ref writer, value.Item6, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T7>(formatterResolver).Serialize(ref writer, value.Item7, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T8>(formatterResolver).Serialize(ref writer, value.Item8, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T9>(formatterResolver).Serialize(ref writer, value.Item9, options);
}
- public global::SharedData.EmptyStruct Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
+ var __Item1__ = default(T1);
+ var __Item2__ = default(T2);
+ var __Item3__ = default(T3);
+ var __Item4__ = default(T4);
+ var __Item5__ = default(T5);
+ var __Item6__ = default(T6);
+ var __Item7__ = default(T7);
+ var __Item8__ = default(T8);
+ var __Item9__ = default(T9);
for (int i = 0; i < length; i++)
{
switch (i)
{
+ case 0:
+ __Item1__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 1:
+ __Item2__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 2:
+ __Item3__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T3>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 3:
+ __Item4__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T4>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 4:
+ __Item5__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T5>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 5:
+ __Item6__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T6>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 6:
+ __Item7__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T7>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 7:
+ __Item8__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T8>(formatterResolver).Deserialize(ref reader, options);
+ break;
+ case 8:
+ __Item9__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T9>(formatterResolver).Deserialize(ref reader, options);
+ break;
default:
reader.Skip();
break;
}
}
- var ____result = new global::SharedData.EmptyStruct();
+ var ____result = new global::SharedData.DynamicArgumentTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(__Item1__, __Item2__, __Item3__, __Item4__, __Item5__, __Item6__, __Item7__, __Item8__, __Item9__);
reader.Depth--;
return ____result;
}
}
+ public sealed class Empty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Empty1>
+ {
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Empty1 value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value == null)
+ {
+ writer.WriteNil();
+ return;
+ }
+
+ writer.WriteArrayHeader(0);
+ }
+
+ public global::SharedData.Empty1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ reader.Skip();
+ return new global::SharedData.Empty1();
+ }
+ }
+
+ public sealed class EmptyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.EmptyClass>
+ {
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.EmptyClass value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value == null)
+ {
+ writer.WriteNil();
+ return;
+ }
+
+ writer.WriteArrayHeader(0);
+ }
+
+ public global::SharedData.EmptyClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ reader.Skip();
+ return new global::SharedData.EmptyClass();
+ }
+ }
+
+ public sealed class EmptyStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.EmptyStruct>
+ {
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.EmptyStruct value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ writer.WriteArrayHeader(0);
+ }
+
+ public global::SharedData.EmptyStruct Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
+ }
+
+ reader.Skip();
+ return new global::SharedData.EmptyStruct();
+ }
+ }
+
public sealed class FirstSimpleDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.FirstSimpleData>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.FirstSimpleData value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.FirstSimpleData value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2283,14 +2343,14 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(3);
writer.Write(value.Prop1);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Prop2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Prop2, options);
writer.Write(value.Prop3);
}
- public global::SharedData.FirstSimpleData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.FirstSimpleData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2298,24 +2358,22 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __Prop1__ = default(int);
- var __Prop2__ = default(string);
- var __Prop3__ = default(int);
+ var ____result = new global::SharedData.FirstSimpleData();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __Prop1__ = reader.ReadInt32();
+ ____result.Prop1 = reader.ReadInt32();
break;
case 1:
- __Prop2__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
case 2:
- __Prop3__ = reader.ReadInt32();
+ ____result.Prop3 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2323,10 +2381,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.FirstSimpleData();
- ____result.Prop1 = __Prop1__;
- ____result.Prop2 = __Prop2__;
- ____result.Prop3 = __Prop3__;
reader.Depth--;
return ____result;
}
@@ -2335,7 +2389,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class FooClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.FooClass>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.FooClass value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.FooClass value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2347,7 +2401,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.XYZ);
}
- public global::SharedData.FooClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.FooClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2356,14 +2410,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __XYZ__ = default(int);
+ var ____result = new global::SharedData.FooClass();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __XYZ__ = reader.ReadInt32();
+ ____result.XYZ = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2371,17 +2425,15 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.FooClass();
- ____result.XYZ = __XYZ__;
reader.Depth--;
return ____result;
}
}
- public sealed class GenericClassFormatter<T1,T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericClass<T1, T2>>
+ public sealed class GenericClassFormatter<T1, T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericClass<T1, T2>>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericClass<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericClass<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2389,13 +2441,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
}
- public global::SharedData.GenericClass<T1, T2> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.GenericClass<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2403,20 +2455,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(T1);
- var __MyProperty1__ = default(T2);
+ var ____result = new global::SharedData.GenericClass<T1, T2>();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -2424,20 +2475,17 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.GenericClass<T1, T2>();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.MyProperty1 = __MyProperty1__;
reader.Depth--;
return ____result;
}
}
- public sealed class GenericConstrainedClassIntKeyFormatter<T1,T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericConstrainedClassIntKey<T1, T2>>
+ public sealed class GenericConstrainedClassIntKeyFormatter<T1, T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericConstrainedClassIntKey<T1, T2>>
where T1 : class
where T2 : class, global::System.Collections.Generic.IEqualityComparer<T1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericConstrainedClassIntKey<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedClassIntKey<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2445,13 +2493,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.Comparer, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.Comparer, options);
}
- public global::SharedData.GenericConstrainedClassIntKey<T1, T2> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.GenericConstrainedClassIntKey<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2459,20 +2507,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(T1);
- var __Comparer__ = default(T2);
+ var ____result = new global::SharedData.GenericConstrainedClassIntKey<T1, T2>();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __Comparer__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -2480,49 +2527,45 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.GenericConstrainedClassIntKey<T1, T2>();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.Comparer = __Comparer__;
reader.Depth--;
return ____result;
}
}
- public sealed class GenericConstrainedStructIntKeyFormatter<T1,T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericConstrainedStructIntKey<T1, T2>>
+ public sealed class GenericConstrainedStructIntKeyFormatter<T1, T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericConstrainedStructIntKey<T1, T2>>
where T1 : unmanaged
where T2 : unmanaged, global::System.Collections.Generic.IEqualityComparer<T1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericConstrainedStructIntKey<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedStructIntKey<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
{
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.Comparer, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.Comparer, options);
}
- public global::SharedData.GenericConstrainedStructIntKey<T1, T2> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.GenericConstrainedStructIntKey<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(T1);
- var __Comparer__ = default(T2);
+ var ____result = new global::SharedData.GenericConstrainedStructIntKey<T1, T2>();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __Comparer__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -2530,47 +2573,43 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.GenericConstrainedStructIntKey<T1, T2>();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.Comparer = __Comparer__;
reader.Depth--;
return ____result;
}
}
- public sealed class GenericStructFormatter<T1,T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericStruct<T1, T2>>
+ public sealed class GenericStructFormatter<T1, T2> : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.GenericStruct<T1, T2>>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericStruct<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericStruct<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
{
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
}
- public global::SharedData.GenericStruct<T1, T2> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.GenericStruct<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty0__ = default(T1);
- var __MyProperty1__ = default(T2);
+ var ____result = new global::SharedData.GenericStruct<T1, T2>();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -2578,9 +2617,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.GenericStruct<T1, T2>();
- ____result.MyProperty0 = __MyProperty0__;
- ____result.MyProperty1 = __MyProperty1__;
reader.Depth--;
return ____result;
}
@@ -2589,7 +2625,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class HolderV0Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.HolderV0>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV0 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2597,13 +2633,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<global::SharedData.Version0>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version0>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
writer.Write(value.After);
}
- public global::SharedData.HolderV0 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.HolderV0 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2611,20 +2647,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(global::SharedData.Version0);
- var __After__ = default(int);
+ var ____result = new global::SharedData.HolderV0();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<global::SharedData.Version0>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version0>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __After__ = reader.ReadInt32();
+ ____result.After = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2632,9 +2667,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.HolderV0();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.After = __After__;
reader.Depth--;
return ____result;
}
@@ -2643,7 +2675,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class HolderV1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.HolderV1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2651,13 +2683,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<global::SharedData.Version1>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version1>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
writer.Write(value.After);
}
- public global::SharedData.HolderV1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.HolderV1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2665,20 +2697,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(global::SharedData.Version1);
- var __After__ = default(int);
+ var ____result = new global::SharedData.HolderV1();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<global::SharedData.Version1>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version1>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __After__ = reader.ReadInt32();
+ ____result.After = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2686,9 +2717,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.HolderV1();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.After = __After__;
reader.Depth--;
return ____result;
}
@@ -2697,7 +2725,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class HolderV2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.HolderV2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV2 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2705,13 +2733,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
- formatterResolver.GetFormatterWithVerify<global::SharedData.Version2>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version2>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
writer.Write(value.After);
}
- public global::SharedData.HolderV2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.HolderV2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2719,20 +2747,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(global::SharedData.Version2);
- var __After__ = default(int);
+ var ____result = new global::SharedData.HolderV2();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<global::SharedData.Version2>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.Version2>(formatterResolver).Deserialize(ref reader, options);
break;
case 1:
- __After__ = reader.ReadInt32();
+ ____result.After = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2740,9 +2767,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.HolderV2();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.After = __After__;
reader.Depth--;
return ____result;
}
@@ -2751,7 +2775,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class MyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.MyClass>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MyClass value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2765,7 +2789,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty3);
}
- public global::SharedData.MyClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.MyClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2774,22 +2798,20 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(int);
- var __MyProperty2__ = default(int);
- var __MyProperty3__ = default(int);
+ var ____result = new global::SharedData.MyClass();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
break;
case 1:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
case 2:
- __MyProperty3__ = reader.ReadInt32();
+ ____result.MyProperty3 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2797,10 +2819,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.MyClass();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty3 = __MyProperty3__;
reader.Depth--;
return ____result;
}
@@ -2809,7 +2827,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class MySubUnion1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.MySubUnion1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2824,7 +2842,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.One);
}
- public global::SharedData.MySubUnion1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.MySubUnion1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2833,14 +2851,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __One__ = default(int);
+ var ____result = new global::SharedData.MySubUnion1();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 3:
- __One__ = reader.ReadInt32();
+ ____result.One = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2848,8 +2866,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.MySubUnion1();
- ____result.One = __One__;
reader.Depth--;
return ____result;
}
@@ -2858,7 +2874,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class MySubUnion2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.MySubUnion2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion2 value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(6);
writer.WriteNil();
@@ -2869,23 +2885,23 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.Two);
}
- public global::SharedData.MySubUnion2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.MySubUnion2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __Two__ = default(int);
+ var ____result = new global::SharedData.MySubUnion2();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 5:
- __Two__ = reader.ReadInt32();
+ ____result.Two = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2893,8 +2909,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.MySubUnion2();
- ____result.Two = __Two__;
reader.Depth--;
return ____result;
}
@@ -2903,7 +2917,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class MySubUnion3Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.MySubUnion3>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion3 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion3 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -2917,7 +2931,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.Three);
}
- public global::SharedData.MySubUnion3 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.MySubUnion3 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -2926,14 +2940,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __Three__ = default(int);
+ var ____result = new global::SharedData.MySubUnion3();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 2:
- __Three__ = reader.ReadInt32();
+ ____result.Three = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2941,8 +2955,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.MySubUnion3();
- ____result.Three = __Three__;
reader.Depth--;
return ____result;
}
@@ -2951,7 +2963,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class MySubUnion4Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.MySubUnion4>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion4 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion4 value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(8);
writer.WriteNil();
@@ -2964,23 +2976,23 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.Four);
}
- public global::SharedData.MySubUnion4 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.MySubUnion4 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __Four__ = default(int);
+ var ____result = new global::SharedData.MySubUnion4();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 7:
- __Four__ = reader.ReadInt32();
+ ____result.Four = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -2988,8 +3000,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.MySubUnion4();
- ____result.Four = __Four__;
reader.Depth--;
return ____result;
}
@@ -2998,7 +3008,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class NestParent_NestContractFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.NestParent.NestContract>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParent.NestContract value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.NestParent.NestContract value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3010,7 +3020,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty);
}
- public global::SharedData.NestParent.NestContract Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.NestParent.NestContract Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3019,14 +3029,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
+ var ____result = new global::SharedData.NestParent.NestContract();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3034,8 +3044,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.NestParent.NestContract();
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
@@ -3044,7 +3052,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class NonEmpty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.NonEmpty1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.NonEmpty1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3056,7 +3064,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty);
}
- public global::SharedData.NonEmpty1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.NonEmpty1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3065,14 +3073,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
+ var ____result = new global::SharedData.NonEmpty1();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3080,8 +3088,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.NonEmpty1();
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
@@ -3090,7 +3096,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class SimpleIntKeyDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.SimpleIntKeyData>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleIntKeyData value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleIntKeyData value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3098,18 +3104,18 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(7);
writer.Write(value.Prop1);
- formatterResolver.GetFormatterWithVerify<global::SharedData.ByteEnum>().Serialize(ref writer, value.Prop2, options);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Prop3, options);
- formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStringKeyData>().Serialize(ref writer, value.Prop4, options);
- formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStructIntKeyData>().Serialize(ref writer, value.Prop5, options);
- formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStructStringKeyData>().Serialize(ref writer, value.Prop6, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.ByteEnum>(formatterResolver).Serialize(ref writer, value.Prop2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Prop3, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStringKeyData>(formatterResolver).Serialize(ref writer, value.Prop4, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStructIntKeyData>(formatterResolver).Serialize(ref writer, value.Prop5, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStructStringKeyData>(formatterResolver).Serialize(ref writer, value.Prop6, options);
writer.Write(value.BytesSpecial);
}
- public global::SharedData.SimpleIntKeyData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.SimpleIntKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3117,40 +3123,34 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __Prop1__ = default(int);
- var __Prop2__ = default(global::SharedData.ByteEnum);
- var __Prop3__ = default(string);
- var __Prop4__ = default(global::SharedData.SimpleStringKeyData);
- var __Prop5__ = default(global::SharedData.SimpleStructIntKeyData);
- var __Prop6__ = default(global::SharedData.SimpleStructStringKeyData);
- var __BytesSpecial__ = default(byte[]);
+ var ____result = new global::SharedData.SimpleIntKeyData();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __Prop1__ = reader.ReadInt32();
+ ____result.Prop1 = reader.ReadInt32();
break;
case 1:
- __Prop2__ = formatterResolver.GetFormatterWithVerify<global::SharedData.ByteEnum>().Deserialize(ref reader, options);
+ ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.ByteEnum>(formatterResolver).Deserialize(ref reader, options);
break;
case 2:
- __Prop3__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Prop3 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
case 3:
- __Prop4__ = formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStringKeyData>().Deserialize(ref reader, options);
+ ____result.Prop4 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStringKeyData>(formatterResolver).Deserialize(ref reader, options);
break;
case 4:
- __Prop5__ = formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStructIntKeyData>().Deserialize(ref reader, options);
+ ____result.Prop5 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStructIntKeyData>(formatterResolver).Deserialize(ref reader, options);
break;
case 5:
- __Prop6__ = formatterResolver.GetFormatterWithVerify<global::SharedData.SimpleStructStringKeyData>().Deserialize(ref reader, options);
+ ____result.Prop6 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.SimpleStructStringKeyData>(formatterResolver).Deserialize(ref reader, options);
break;
case 6:
- __BytesSpecial__ = reader.ReadBytes()?.ToArray();
+ ____result.BytesSpecial = global::MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(reader.ReadBytes());
break;
default:
reader.Skip();
@@ -3158,14 +3158,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.SimpleIntKeyData();
- ____result.Prop1 = __Prop1__;
- ____result.Prop2 = __Prop2__;
- ____result.Prop3 = __Prop3__;
- ____result.Prop4 = __Prop4__;
- ____result.Prop5 = __Prop5__;
- ____result.Prop6 = __Prop6__;
- ____result.BytesSpecial = __BytesSpecial__;
reader.Depth--;
return ____result;
}
@@ -3174,7 +3166,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class SimpleStructIntKeyDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.SimpleStructIntKeyData>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleStructIntKeyData value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleStructIntKeyData value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(3);
writer.Write(value.X);
@@ -3182,31 +3174,29 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.BytesSpecial);
}
- public global::SharedData.SimpleStructIntKeyData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.SimpleStructIntKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __X__ = default(int);
- var __Y__ = default(int);
- var __BytesSpecial__ = default(byte[]);
+ var ____result = new global::SharedData.SimpleStructIntKeyData();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __X__ = reader.ReadInt32();
+ ____result.X = reader.ReadInt32();
break;
case 1:
- __Y__ = reader.ReadInt32();
+ ____result.Y = reader.ReadInt32();
break;
case 2:
- __BytesSpecial__ = reader.ReadBytes()?.ToArray();
+ ____result.BytesSpecial = global::MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(reader.ReadBytes());
break;
default:
reader.Skip();
@@ -3214,10 +3204,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.SimpleStructIntKeyData();
- ____result.X = __X__;
- ____result.Y = __Y__;
- ____result.BytesSpecial = __BytesSpecial__;
reader.Depth--;
return ____result;
}
@@ -3226,7 +3212,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class SubUnionType1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.SubUnionType1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionType1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SubUnionType1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3239,7 +3225,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty1);
}
- public global::SharedData.SubUnionType1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.SubUnionType1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3248,18 +3234,17 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(int);
- var __MyProperty__ = default(int);
+ var ____result = new global::SharedData.SubUnionType1();
for (int i = 0; i < length; i++)
{
switch (i)
{
- case 1:
- __MyProperty1__ = reader.ReadInt32();
- break;
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
+ break;
+ case 1:
+ ____result.MyProperty1 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3267,9 +3252,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.SubUnionType1();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
@@ -3278,7 +3260,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class SubUnionType2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.SubUnionType2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionType2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SubUnionType2 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3291,7 +3273,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty2);
}
- public global::SharedData.SubUnionType2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.SubUnionType2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3300,18 +3282,17 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty2__ = default(int);
- var __MyProperty__ = default(int);
+ var ____result = new global::SharedData.SubUnionType2();
for (int i = 0; i < length; i++)
{
switch (i)
{
- case 1:
- __MyProperty2__ = reader.ReadInt32();
- break;
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
+ break;
+ case 1:
+ ____result.MyProperty2 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3319,9 +3300,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.SubUnionType2();
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty = __MyProperty__;
reader.Depth--;
return ____result;
}
@@ -3330,7 +3308,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class UnVersionBlockTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.UnVersionBlockTest>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.UnVersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3344,7 +3322,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty2);
}
- public global::SharedData.UnVersionBlockTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.UnVersionBlockTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3353,18 +3331,17 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
- var __MyProperty2__ = default(int);
+ var ____result = new global::SharedData.UnVersionBlockTest();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
case 2:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3372,9 +3349,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.UnVersionBlockTest();
- ____result.MyProperty = __MyProperty__;
- ____result.MyProperty2 = __MyProperty2__;
reader.Depth--;
return ____result;
}
@@ -3383,18 +3357,18 @@ namespace MessagePack.Formatters.SharedData
public sealed class Vector2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Vector2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Vector2 value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(2);
writer.Write(value.X);
writer.Write(value.Y);
}
- public global::SharedData.Vector2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Vector2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
@@ -3427,7 +3401,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Vector3LikeFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Vector3Like>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector3Like value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Vector3Like value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(3);
writer.Write(value.x);
@@ -3435,11 +3409,11 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.z);
}
- public global::SharedData.Vector3Like Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Vector3Like Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
@@ -3468,9 +3442,6 @@ namespace MessagePack.Formatters.SharedData
}
var ____result = new global::SharedData.Vector3Like(__x__, __y__, __z__);
- ____result.x = __x__;
- ____result.y = __y__;
- ____result.z = __z__;
reader.Depth--;
return ____result;
}
@@ -3479,18 +3450,18 @@ namespace MessagePack.Formatters.SharedData
public sealed class VectorLike2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.VectorLike2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.VectorLike2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VectorLike2 value, global::MessagePack.MessagePackSerializerOptions options)
{
writer.WriteArrayHeader(2);
writer.Write(value.x);
writer.Write(value.y);
}
- public global::SharedData.VectorLike2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.VectorLike2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
- throw new InvalidOperationException("typecode is null, struct not supported");
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
}
options.Security.DepthStep(ref reader);
@@ -3515,8 +3486,6 @@ namespace MessagePack.Formatters.SharedData
}
var ____result = new global::SharedData.VectorLike2(__x__, __y__);
- ____result.x = __x__;
- ____result.y = __y__;
reader.Depth--;
return ____result;
}
@@ -3525,7 +3494,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Version0Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Version0>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version0 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3540,7 +3509,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty1);
}
- public global::SharedData.Version0 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Version0 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3549,14 +3518,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(int);
+ var ____result = new global::SharedData.Version0();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 3:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3564,8 +3533,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.Version0();
- ____result.MyProperty1 = __MyProperty1__;
reader.Depth--;
return ____result;
}
@@ -3574,7 +3541,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Version1Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Version1>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version1 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3591,7 +3558,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty3);
}
- public global::SharedData.Version1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Version1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3600,22 +3567,20 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(int);
- var __MyProperty2__ = default(int);
- var __MyProperty3__ = default(int);
+ var ____result = new global::SharedData.Version1();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 3:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
break;
case 4:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
case 5:
- __MyProperty3__ = reader.ReadInt32();
+ ____result.MyProperty3 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3623,10 +3588,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.Version1();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty3 = __MyProperty3__;
reader.Depth--;
return ____result;
}
@@ -3635,7 +3596,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class Version2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Version2>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version2 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3654,7 +3615,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.MyProperty5);
}
- public global::SharedData.Version2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.Version2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3663,26 +3624,23 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __MyProperty1__ = default(int);
- var __MyProperty2__ = default(int);
- var __MyProperty3__ = default(int);
- var __MyProperty5__ = default(int);
+ var ____result = new global::SharedData.Version2();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 3:
- __MyProperty1__ = reader.ReadInt32();
+ ____result.MyProperty1 = reader.ReadInt32();
break;
case 4:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
case 5:
- __MyProperty3__ = reader.ReadInt32();
+ ____result.MyProperty3 = reader.ReadInt32();
break;
case 7:
- __MyProperty5__ = reader.ReadInt32();
+ ____result.MyProperty5 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3690,11 +3648,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.Version2();
- ____result.MyProperty1 = __MyProperty1__;
- ____result.MyProperty2 = __MyProperty2__;
- ____result.MyProperty3 = __MyProperty3__;
- ____result.MyProperty5 = __MyProperty5__;
reader.Depth--;
return ____result;
}
@@ -3703,7 +3656,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class VersionBlockTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.VersionBlockTest>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3711,14 +3664,14 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(3);
writer.Write(value.MyProperty);
- formatterResolver.GetFormatterWithVerify<global::SharedData.MyClass>().Serialize(ref writer, value.UnknownBlock, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.MyClass>(formatterResolver).Serialize(ref writer, value.UnknownBlock, options);
writer.Write(value.MyProperty2);
}
- public global::SharedData.VersionBlockTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.VersionBlockTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3726,24 +3679,22 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __MyProperty__ = default(int);
- var __UnknownBlock__ = default(global::SharedData.MyClass);
- var __MyProperty2__ = default(int);
+ var ____result = new global::SharedData.VersionBlockTest();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
break;
case 1:
- __UnknownBlock__ = formatterResolver.GetFormatterWithVerify<global::SharedData.MyClass>().Deserialize(ref reader, options);
+ ____result.UnknownBlock = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.MyClass>(formatterResolver).Deserialize(ref reader, options);
break;
case 2:
- __MyProperty2__ = reader.ReadInt32();
+ ____result.MyProperty2 = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3751,10 +3702,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.VersionBlockTest();
- ____result.MyProperty = __MyProperty__;
- ____result.UnknownBlock = __UnknownBlock__;
- ____result.MyProperty2 = __MyProperty2__;
reader.Depth--;
return ____result;
}
@@ -3763,7 +3710,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class VersioningUnionFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.VersioningUnion>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.VersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VersioningUnion value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3782,7 +3729,7 @@ namespace MessagePack.Formatters.SharedData
writer.Write(value.FV);
}
- public global::SharedData.VersioningUnion Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.VersioningUnion Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3791,14 +3738,14 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadArrayHeader();
- var __FV__ = default(int);
+ var ____result = new global::SharedData.VersioningUnion();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 7:
- __FV__ = reader.ReadInt32();
+ ____result.FV = reader.ReadInt32();
break;
default:
reader.Skip();
@@ -3806,8 +3753,6 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.VersioningUnion();
- ____result.FV = __FV__;
reader.Depth--;
return ____result;
}
@@ -3816,7 +3761,7 @@ namespace MessagePack.Formatters.SharedData
public sealed class WithIndexerFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.WithIndexer>
{
- public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndexer value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.WithIndexer value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value == null)
{
@@ -3824,13 +3769,13 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
writer.WriteArrayHeader(2);
writer.Write(value.Data1);
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.Data2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.Data2, options);
}
- public global::SharedData.WithIndexer Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::SharedData.WithIndexer Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
if (reader.TryReadNil())
{
@@ -3838,20 +3783,19 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ global::MessagePack.IFormatterResolver formatterResolver = options.Resolver;
var length = reader.ReadArrayHeader();
- var __Data1__ = default(int);
- var __Data2__ = default(string);
+ var ____result = new global::SharedData.WithIndexer();
for (int i = 0; i < length; i++)
{
switch (i)
{
case 0:
- __Data1__ = reader.ReadInt32();
+ ____result.Data1 = reader.ReadInt32();
break;
case 1:
- __Data2__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.Data2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
break;
default:
reader.Skip();
@@ -3859,13 +3803,11 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.WithIndexer();
- ____result.Data1 = __Data1__;
- ____result.Data2 = __Data2__;
reader.Depth--;
return ____result;
}
}
+
}
#pragma warning restore 168
@@ -3874,7 +3816,6 @@ namespace MessagePack.Formatters.SharedData
#pragma warning restore 612
#pragma warning restore SA1129 // Do not use default value type constructor
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1309 // Field names should not begin with underscore
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
#pragma warning restore SA1403 // File may only contain a single namespace
@@ -3888,9 +3829,9 @@ namespace MessagePack.Formatters.SharedData
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -3898,11 +3839,6 @@ namespace MessagePack.Formatters.SharedData
namespace MessagePack.Formatters.SharedData
{
- using System;
- using System.Buffers;
- using System.Runtime.InteropServices;
- using MessagePack;
-
public sealed class Callback2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Callback2>
{
// X
@@ -3929,7 +3865,7 @@ namespace MessagePack.Formatters.SharedData
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -3945,11 +3881,7 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.Callback2(__X__)
- {
- X = __X__,
- };
-
+ var ____result = new global::SharedData.Callback2(__X__);
____result.OnAfterDeserialize();
reader.Depth--;
return ____result;
@@ -3982,7 +3914,7 @@ namespace MessagePack.Formatters.SharedData
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -3998,20 +3930,213 @@ namespace MessagePack.Formatters.SharedData
}
}
- var ____result = new global::SharedData.Callback2_2(__X__)
+ var ____result = new global::SharedData.Callback2_2(__X__);
+ ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize();
+ reader.Depth--;
+ return ____result;
+ }
+ }
+
+ public sealed class DefaultValueStringKeyClassWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor>
+ {
+ // Prop1
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 };
+ // Prop2
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 };
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value is null)
{
- X = __X__,
- };
+ writer.WriteNil();
+ return;
+ }
+
+ writer.WriteMapHeader(2);
+ writer.WriteRaw(GetSpan_Prop1());
+ writer.Write(value.Prop1);
+ writer.WriteRaw(GetSpan_Prop2());
+ writer.Write(value.Prop2);
+ }
+
+ public global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ options.Security.DepthStep(ref reader);
+ var length = reader.ReadMapHeader();
+ var __Prop1__ = default(int);
+ var __Prop2__IsInitialized = false;
+ var __Prop2__ = default(int);
+
+ for (int i = 0; i < length; i++)
+ {
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ switch (stringKey.Length)
+ {
+ default:
+ FAIL:
+ reader.Skip();
+ continue;
+ case 5:
+ switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
+ {
+ default: goto FAIL;
+ case 212339749456UL:
+ __Prop1__ = reader.ReadInt32();
+ continue;
+ case 216634716752UL:
+ __Prop2__IsInitialized = true;
+ __Prop2__ = reader.ReadInt32();
+ continue;
+ }
+
+ }
+ }
+
+ var ____result = new global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor(__Prop1__);
+ if (__Prop2__IsInitialized)
+ {
+ ____result.Prop2 = __Prop2__;
+ }
- ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize();
reader.Depth--;
return ____result;
}
}
- public sealed class Empty2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Empty2>
+ public sealed class DefaultValueStringKeyClassWithoutExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor>
+ {
+ // Prop1
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 };
+ // Prop2
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 };
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value is null)
+ {
+ writer.WriteNil();
+ return;
+ }
+
+ writer.WriteMapHeader(2);
+ writer.WriteRaw(GetSpan_Prop1());
+ writer.Write(value.Prop1);
+ writer.WriteRaw(GetSpan_Prop2());
+ writer.Write(value.Prop2);
+ }
+
+ public global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ options.Security.DepthStep(ref reader);
+ var length = reader.ReadMapHeader();
+ var ____result = new global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor();
+
+ for (int i = 0; i < length; i++)
+ {
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ switch (stringKey.Length)
+ {
+ default:
+ FAIL:
+ reader.Skip();
+ continue;
+ case 5:
+ switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
+ {
+ default: goto FAIL;
+ case 212339749456UL:
+ ____result.Prop1 = reader.ReadInt32();
+ continue;
+ case 216634716752UL:
+ ____result.Prop2 = reader.ReadInt32();
+ continue;
+ }
+
+ }
+ }
+
+ reader.Depth--;
+ return ____result;
+ }
+ }
+
+ public sealed class DefaultValueStringKeyStructWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor>
{
+ // Prop1
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 };
+ // Prop2
+ private static global::System.ReadOnlySpan<byte> GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 };
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ writer.WriteMapHeader(2);
+ writer.WriteRaw(GetSpan_Prop1());
+ writer.Write(value.Prop1);
+ writer.WriteRaw(GetSpan_Prop2());
+ writer.Write(value.Prop2);
+ }
+
+ public global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ throw new global::System.InvalidOperationException("typecode is null, struct not supported");
+ }
+
+ options.Security.DepthStep(ref reader);
+ var length = reader.ReadMapHeader();
+ var __Prop1__ = default(int);
+ var __Prop2__IsInitialized = false;
+ var __Prop2__ = default(int);
+
+ for (int i = 0; i < length; i++)
+ {
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ switch (stringKey.Length)
+ {
+ default:
+ FAIL:
+ reader.Skip();
+ continue;
+ case 5:
+ switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
+ {
+ default: goto FAIL;
+ case 212339749456UL:
+ __Prop1__ = reader.ReadInt32();
+ continue;
+ case 216634716752UL:
+ __Prop2__IsInitialized = true;
+ __Prop2__ = reader.ReadInt32();
+ continue;
+ }
+
+ }
+ }
+
+ var ____result = new global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor(__Prop1__);
+ if (__Prop2__IsInitialized)
+ {
+ ____result.Prop2 = __Prop2__;
+ }
+
+ reader.Depth--;
+ return ____result;
+ }
+ }
+ public sealed class Empty2Formatter : global::MessagePack.Formatters.IMessagePackFormatter<global::SharedData.Empty2>
+ {
public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Empty2 value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value is null)
@@ -4053,12 +4178,12 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_MyProperty0());
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
writer.WriteRaw(GetSpan_Comparer());
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.Comparer, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.Comparer, options);
}
public global::SharedData.GenericConstrainedClassStringKey<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -4069,14 +4194,13 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __MyProperty0__ = default(T1);
- var __Comparer__ = default(T2);
+ var ____result = new global::SharedData.GenericConstrainedClassStringKey<T1, T2>();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -4086,23 +4210,17 @@ namespace MessagePack.Formatters.SharedData
case 11:
if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty0().Slice(1))) { goto FAIL; }
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
continue;
case 8:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 8243120455795175235UL) { goto FAIL; }
- __Comparer__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
- var ____result = new global::SharedData.GenericConstrainedClassStringKey<T1, T2>()
- {
- MyProperty0 = __MyProperty0__,
- Comparer = __Comparer__,
- };
-
reader.Depth--;
return ____result;
}
@@ -4119,12 +4237,12 @@ namespace MessagePack.Formatters.SharedData
public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedStructStringKey<T1, T2> value, global::MessagePack.MessagePackSerializerOptions options)
{
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_MyProperty0());
- formatterResolver.GetFormatterWithVerify<T1>().Serialize(ref writer, value.MyProperty0, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Serialize(ref writer, value.MyProperty0, options);
writer.WriteRaw(GetSpan_Comparer());
- formatterResolver.GetFormatterWithVerify<T2>().Serialize(ref writer, value.Comparer, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Serialize(ref writer, value.Comparer, options);
}
public global::SharedData.GenericConstrainedStructStringKey<T1, T2> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -4135,14 +4253,13 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __MyProperty0__ = default(T1);
- var __Comparer__ = default(T2);
+ var ____result = new global::SharedData.GenericConstrainedStructStringKey<T1, T2>();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -4152,23 +4269,17 @@ namespace MessagePack.Formatters.SharedData
case 11:
if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty0().Slice(1))) { goto FAIL; }
- __MyProperty0__ = formatterResolver.GetFormatterWithVerify<T1>().Deserialize(ref reader, options);
+ ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T1>(formatterResolver).Deserialize(ref reader, options);
continue;
case 8:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 8243120455795175235UL) { goto FAIL; }
- __Comparer__ = formatterResolver.GetFormatterWithVerify<T2>().Deserialize(ref reader, options);
+ ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<T2>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
- var ____result = new global::SharedData.GenericConstrainedStructStringKey<T1, T2>()
- {
- MyProperty0 = __MyProperty0__,
- Comparer = __Comparer__,
- };
-
reader.Depth--;
return ____result;
}
@@ -4201,11 +4312,11 @@ namespace MessagePack.Formatters.SharedData
options.Security.DepthStep(ref reader);
var length = reader.ReadMapHeader();
- var __MyProperty__ = default(int);
+ var ____result = new global::SharedData.NonEmpty2();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -4215,17 +4326,12 @@ namespace MessagePack.Formatters.SharedData
case 10:
if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty().Slice(1))) { goto FAIL; }
- __MyProperty__ = reader.ReadInt32();
+ ____result.MyProperty = reader.ReadInt32();
continue;
}
}
- var ____result = new global::SharedData.NonEmpty2()
- {
- MyProperty = __MyProperty__,
- };
-
reader.Depth--;
return ____result;
}
@@ -4248,12 +4354,12 @@ namespace MessagePack.Formatters.SharedData
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(3);
writer.WriteRaw(GetSpan_Prop1());
writer.Write(value.Prop1);
writer.WriteRaw(GetSpan_Prop2());
- formatterResolver.GetFormatterWithVerify<global::SharedData.ByteEnum>().Serialize(ref writer, value.Prop2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.ByteEnum>(formatterResolver).Serialize(ref writer, value.Prop2, options);
writer.WriteRaw(GetSpan_Prop3());
writer.Write(value.Prop3);
}
@@ -4266,15 +4372,13 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __Prop1__ = default(int);
- var __Prop2__ = default(global::SharedData.ByteEnum);
- var __Prop3__ = default(int);
+ var ____result = new global::SharedData.SimpleStringKeyData();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -4286,26 +4390,19 @@ namespace MessagePack.Formatters.SharedData
{
default: goto FAIL;
case 212339749456UL:
- __Prop1__ = reader.ReadInt32();
+ ____result.Prop1 = reader.ReadInt32();
continue;
case 216634716752UL:
- __Prop2__ = formatterResolver.GetFormatterWithVerify<global::SharedData.ByteEnum>().Deserialize(ref reader, options);
+ ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::SharedData.ByteEnum>(formatterResolver).Deserialize(ref reader, options);
continue;
case 220929684048UL:
- __Prop3__ = reader.ReadInt32();
+ ____result.Prop3 = reader.ReadInt32();
continue;
}
}
}
- var ____result = new global::SharedData.SimpleStringKeyData()
- {
- Prop1 = __Prop1__,
- Prop2 = __Prop2__,
- Prop3 = __Prop3__,
- };
-
reader.Depth--;
return ____result;
}
@@ -4320,12 +4417,12 @@ namespace MessagePack.Formatters.SharedData
public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleStructStringKeyData value, global::MessagePack.MessagePackSerializerOptions options)
{
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_X());
writer.Write(value.X);
writer.WriteRaw(GetSpan_Y());
- formatterResolver.GetFormatterWithVerify<int[]>().Serialize(ref writer, value.Y, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[]>(formatterResolver).Serialize(ref writer, value.Y, options);
}
public global::SharedData.SimpleStructStringKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -4336,14 +4433,13 @@ namespace MessagePack.Formatters.SharedData
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __X__ = default(int);
- var __Y__ = default(int[]);
+ var ____result = new global::SharedData.SimpleStructStringKeyData();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -4355,25 +4451,31 @@ namespace MessagePack.Formatters.SharedData
{
default: goto FAIL;
case 378720052587UL:
- __X__ = reader.ReadInt32();
+ ____result.X = reader.ReadInt32();
continue;
case 383015019883UL:
- __Y__ = formatterResolver.GetFormatterWithVerify<int[]>().Deserialize(ref reader, options);
+ ____result.Y = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<int[]>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
}
- var ____result = new global::SharedData.SimpleStructStringKeyData()
- {
- X = __X__,
- Y = __Y__,
- };
-
reader.Depth--;
return ____result;
}
}
+
}
+#pragma warning restore 168
+#pragma warning restore 414
+#pragma warning restore 618
+#pragma warning restore 612
+
+#pragma warning restore SA1129 // Do not use default value type constructor
+#pragma warning restore SA1309 // Field names should not begin with underscore
+#pragma warning restore SA1312 // Variable names should begin with lower-case letter
+#pragma warning restore SA1403 // File may only contain a single namespace
+#pragma warning restore SA1649 // File name should match first type name
+
diff --git a/sandbox/Sandbox/Sandbox.csproj b/sandbox/Sandbox/Sandbox.csproj
index 489425ec..17da2db3 100644
--- a/sandbox/Sandbox/Sandbox.csproj
+++ b/sandbox/Sandbox/Sandbox.csproj
@@ -2,14 +2,14 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>netcoreapp2.1</TargetFramework>
+ <TargetFramework>netcoreapp3.1</TargetFramework>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="MsgPack.Cli" Version="0.7.1" />
- <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="protobuf-net" Version="2.1.0" />
<PackageReference Include="ZeroFormatter" Version="1.6.4" />
</ItemGroup>
diff --git a/sandbox/Sandbox/codegen.ps1 b/sandbox/Sandbox/codegen.ps1
index 6dd4f233..279718f6 100644
--- a/sandbox/Sandbox/codegen.ps1
+++ b/sandbox/Sandbox/codegen.ps1
@@ -1 +1 @@
-dotnet run -p "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/../SharedData/SharedData.csproj" -o "$PSScriptRoot/Generated.cs"
+dotnet run -f "net6.0" --project "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/../SharedData/SharedData.csproj" -o "$PSScriptRoot/Generated.cs"
diff --git a/sandbox/TestData2/A.cs b/sandbox/TestData2/A.cs
index 44b0a47f..a7eeef9d 100644
--- a/sandbox/TestData2/A.cs
+++ b/sandbox/TestData2/A.cs
@@ -1,17 +1,14 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using System.Collections.Generic;
-using MessagePack;
-
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
#pragma warning disable SA1401 // Fields should be private
+#nullable enable
+
+namespace TestData2;
-namespace TestData2
+[MessagePackObject(true)]
+public class A
{
- [MessagePackObject(true)]
- public class A
- {
- public int a; public List<B> bs; public C c;
- }
+ public int a; public List<B?>? bs; public C? c;
}
diff --git a/sandbox/TestData2/B.cs b/sandbox/TestData2/B.cs
index 769c0e1c..d9c4029e 100644
--- a/sandbox/TestData2/B.cs
+++ b/sandbox/TestData2/B.cs
@@ -1,17 +1,14 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using System.Collections.Generic;
-using MessagePack;
-
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
#pragma warning disable SA1401 // Fields should be private
+#nullable enable
+
+namespace TestData2;
-namespace TestData2
+[MessagePackObject(true)]
+public class B
{
- [MessagePackObject(true)]
- public class B
- {
- public List<A> ass; public C c; public int a;
- }
+ public List<A?>? ass; public C? c; public int a;
}
diff --git a/sandbox/TestData2/C.cs b/sandbox/TestData2/C.cs
index 079c171e..741517ff 100644
--- a/sandbox/TestData2/C.cs
+++ b/sandbox/TestData2/C.cs
@@ -1,16 +1,14 @@
-// Copyright (c) All contributors. All rights reserved.
+// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-using MessagePack;
-
#pragma warning disable SA1307 // Accessible fields should begin with upper-case letter
#pragma warning disable SA1401 // Fields should be private
+#nullable enable
+
+namespace TestData2;
-namespace TestData2
+[MessagePackObject(true)]
+public class C
{
- [MessagePackObject(true)]
- public class C
- {
- public B b; public int a;
- }
+ public B? b; public int a;
}
diff --git a/sandbox/TestData2/Generated.cs b/sandbox/TestData2/Generated.cs
index 0d6025a9..1e65486d 100644
--- a/sandbox/TestData2/Generated.cs
+++ b/sandbox/TestData2/Generated.cs
@@ -6,15 +6,13 @@
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Resolvers
{
- using System;
-
public class GeneratedResolver : global::MessagePack.IFormatterResolver
{
public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver();
@@ -45,11 +43,11 @@ namespace MessagePack.Resolvers
internal static class GeneratedResolverGetFormatterHelper
{
- private static readonly global::System.Collections.Generic.Dictionary<Type, int> lookup;
+ private static readonly global::System.Collections.Generic.Dictionary<global::System.Type, int> lookup;
static GeneratedResolverGetFormatterHelper()
{
- lookup = new global::System.Collections.Generic.Dictionary<Type, int>(13)
+ lookup = new global::System.Collections.Generic.Dictionary<global::System.Type, int>(14)
{
{ typeof(global::System.Collections.Generic.List<global::TestData2.A>), 0 },
{ typeof(global::System.Collections.Generic.List<global::TestData2.B>), 1 },
@@ -64,10 +62,11 @@ namespace MessagePack.Resolvers
{ typeof(global::TestData2.Nest2.IdType), 10 },
{ typeof(global::TestData2.PropNameCheck1), 11 },
{ typeof(global::TestData2.PropNameCheck2), 12 },
+ { typeof(global::TestData2.Record), 13 },
};
}
- internal static object GetFormatter(Type t)
+ internal static object GetFormatter(global::System.Type t)
{
int key;
if (!lookup.TryGetValue(t, out key))
@@ -90,6 +89,7 @@ namespace MessagePack.Resolvers
case 10: return new MessagePack.Formatters.TestData2.Nest2_IdTypeFormatter();
case 11: return new MessagePack.Formatters.TestData2.PropNameCheck1Formatter();
case 12: return new MessagePack.Formatters.TestData2.PropNameCheck2Formatter();
+ case 13: return new MessagePack.Formatters.TestData2.RecordFormatter();
default: return null;
}
}
@@ -102,7 +102,6 @@ namespace MessagePack.Resolvers
#pragma warning restore 612
#pragma warning restore SA1312 // Variable names should begin with lower-case letter
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1649 // File name should match first type name
@@ -114,25 +113,22 @@ namespace MessagePack.Resolvers
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1403 // File may only contain a single namespace
#pragma warning disable SA1649 // File name should match first type name
namespace MessagePack.Formatters.TestData2
{
- using System;
- using System.Buffers;
- using MessagePack;
public sealed class Nest1_IdFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.Nest1.Id>
{
- public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest1.Id value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest1.Id value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Int32)value);
+ writer.Write((global::System.Int32)value);
}
- public global::TestData2.Nest1.Id Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::TestData2.Nest1.Id Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::TestData2.Nest1.Id)reader.ReadInt32();
}
@@ -140,12 +136,12 @@ namespace MessagePack.Formatters.TestData2
public sealed class Nest2_IdFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.Nest2.Id>
{
- public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest2.Id value, global::MessagePack.MessagePackSerializerOptions options)
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest2.Id value, global::MessagePack.MessagePackSerializerOptions options)
{
- writer.Write((Int32)value);
+ writer.Write((global::System.Int32)value);
}
- public global::TestData2.Nest2.Id Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ public global::TestData2.Nest2.Id Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
{
return (global::TestData2.Nest2.Id)reader.ReadInt32();
}
@@ -157,7 +153,6 @@ namespace MessagePack.Formatters.TestData2
#pragma warning restore 618
#pragma warning restore 612
-#pragma warning restore SA1200 // Using directives should be placed correctly
#pragma warning restore SA1403 // File may only contain a single namespace
#pragma warning restore SA1649 // File name should match first type name
@@ -171,9 +166,9 @@ namespace MessagePack.Formatters.TestData2
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
+#pragma warning disable CS1591 // document public APIs
#pragma warning disable SA1129 // Do not use default value type constructor
-#pragma warning disable SA1200 // Using directives should be placed correctly
#pragma warning disable SA1309 // Field names should not begin with underscore
#pragma warning disable SA1312 // Variable names should begin with lower-case letter
#pragma warning disable SA1403 // File may only contain a single namespace
@@ -181,11 +176,6 @@ namespace MessagePack.Formatters.TestData2
namespace MessagePack.Formatters.TestData2
{
- using System;
- using System.Buffers;
- using System.Runtime.InteropServices;
- using MessagePack;
-
public sealed class AFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.A>
{
// a
@@ -203,14 +193,14 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(3);
writer.WriteRaw(GetSpan_a());
writer.Write(value.a);
writer.WriteRaw(GetSpan_bs());
- formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.B>>().Serialize(ref writer, value.bs, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.B>>(formatterResolver).Serialize(ref writer, value.bs, options);
writer.WriteRaw(GetSpan_c());
- formatterResolver.GetFormatterWithVerify<global::TestData2.C>().Serialize(ref writer, value.c, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Serialize(ref writer, value.c, options);
}
public global::TestData2.A Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -221,15 +211,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __a__ = default(int);
- var __bs__ = default(global::System.Collections.Generic.List<global::TestData2.B>);
- var __c__ = default(global::TestData2.C);
+ var ____result = new global::TestData2.A();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -241,28 +229,21 @@ namespace MessagePack.Formatters.TestData2
{
default: goto FAIL;
case 97UL:
- __a__ = reader.ReadInt32();
+ ____result.a = reader.ReadInt32();
continue;
case 99UL:
- __c__ = formatterResolver.GetFormatterWithVerify<global::TestData2.C>().Deserialize(ref reader, options);
+ ____result.c = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Deserialize(ref reader, options);
continue;
}
case 2:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 29538UL) { goto FAIL; }
- __bs__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.B>>().Deserialize(ref reader, options);
+ ____result.bs = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.B>>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
- var ____result = new global::TestData2.A()
- {
- a = __a__,
- bs = __bs__,
- c = __c__,
- };
-
reader.Depth--;
return ____result;
}
@@ -285,12 +266,12 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(3);
writer.WriteRaw(GetSpan_ass());
- formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>().Serialize(ref writer, value.ass, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>(formatterResolver).Serialize(ref writer, value.ass, options);
writer.WriteRaw(GetSpan_c());
- formatterResolver.GetFormatterWithVerify<global::TestData2.C>().Serialize(ref writer, value.c, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Serialize(ref writer, value.c, options);
writer.WriteRaw(GetSpan_a());
writer.Write(value.a);
}
@@ -303,15 +284,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __ass__ = default(global::System.Collections.Generic.List<global::TestData2.A>);
- var __c__ = default(global::TestData2.C);
- var __a__ = default(int);
+ var ____result = new global::TestData2.B();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -321,30 +300,23 @@ namespace MessagePack.Formatters.TestData2
case 3:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 7566177UL) { goto FAIL; }
- __ass__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>().Deserialize(ref reader, options);
+ ____result.ass = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::System.Collections.Generic.List<global::TestData2.A>>(formatterResolver).Deserialize(ref reader, options);
continue;
case 1:
switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey))
{
default: goto FAIL;
case 99UL:
- __c__ = formatterResolver.GetFormatterWithVerify<global::TestData2.C>().Deserialize(ref reader, options);
+ ____result.c = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.C>(formatterResolver).Deserialize(ref reader, options);
continue;
case 97UL:
- __a__ = reader.ReadInt32();
+ ____result.a = reader.ReadInt32();
continue;
}
}
}
- var ____result = new global::TestData2.B()
- {
- ass = __ass__,
- c = __c__,
- a = __a__,
- };
-
reader.Depth--;
return ____result;
}
@@ -365,10 +337,10 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_b());
- formatterResolver.GetFormatterWithVerify<global::TestData2.B>().Serialize(ref writer, value.b, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.B>(formatterResolver).Serialize(ref writer, value.b, options);
writer.WriteRaw(GetSpan_a());
writer.Write(value.a);
}
@@ -381,14 +353,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __b__ = default(global::TestData2.B);
- var __a__ = default(int);
+ var ____result = new global::TestData2.C();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -400,22 +371,16 @@ namespace MessagePack.Formatters.TestData2
{
default: goto FAIL;
case 98UL:
- __b__ = formatterResolver.GetFormatterWithVerify<global::TestData2.B>().Deserialize(ref reader, options);
+ ____result.b = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.B>(formatterResolver).Deserialize(ref reader, options);
continue;
case 97UL:
- __a__ = reader.ReadInt32();
+ ____result.a = reader.ReadInt32();
continue;
}
}
}
- var ____result = new global::TestData2.C()
- {
- b = __b__,
- a = __a__,
- };
-
reader.Depth--;
return ____result;
}
@@ -436,12 +401,12 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_EnumId());
- formatterResolver.GetFormatterWithVerify<global::TestData2.Nest1.Id>().Serialize(ref writer, value.EnumId, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest1.Id>(formatterResolver).Serialize(ref writer, value.EnumId, options);
writer.WriteRaw(GetSpan_ClassId());
- formatterResolver.GetFormatterWithVerify<global::TestData2.Nest1.IdType>().Serialize(ref writer, value.ClassId, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest1.IdType>(formatterResolver).Serialize(ref writer, value.ClassId, options);
}
public global::TestData2.Nest1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -452,14 +417,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __EnumId__ = default(global::TestData2.Nest1.Id);
- var __ClassId__ = default(global::TestData2.Nest1.IdType);
+ var ____result = new global::TestData2.Nest1();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -469,23 +433,17 @@ namespace MessagePack.Formatters.TestData2
case 6:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 110266531802693UL) { goto FAIL; }
- __EnumId__ = formatterResolver.GetFormatterWithVerify<global::TestData2.Nest1.Id>().Deserialize(ref reader, options);
+ ____result.EnumId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest1.Id>(formatterResolver).Deserialize(ref reader, options);
continue;
case 7:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 28228257876896835UL) { goto FAIL; }
- __ClassId__ = formatterResolver.GetFormatterWithVerify<global::TestData2.Nest1.IdType>().Deserialize(ref reader, options);
+ ____result.ClassId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest1.IdType>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
- var ____result = new global::TestData2.Nest1()
- {
- EnumId = __EnumId__,
- ClassId = __ClassId__,
- };
-
reader.Depth--;
return ____result;
}
@@ -493,7 +451,6 @@ namespace MessagePack.Formatters.TestData2
public sealed class Nest1_IdTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.Nest1.IdType>
{
-
public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest1.IdType value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value is null)
@@ -533,12 +490,12 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_EnumId());
- formatterResolver.GetFormatterWithVerify<global::TestData2.Nest2.Id>().Serialize(ref writer, value.EnumId, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest2.Id>(formatterResolver).Serialize(ref writer, value.EnumId, options);
writer.WriteRaw(GetSpan_ClassId());
- formatterResolver.GetFormatterWithVerify<global::TestData2.Nest2.IdType>().Serialize(ref writer, value.ClassId, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest2.IdType>(formatterResolver).Serialize(ref writer, value.ClassId, options);
}
public global::TestData2.Nest2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -549,14 +506,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __EnumId__ = default(global::TestData2.Nest2.Id);
- var __ClassId__ = default(global::TestData2.Nest2.IdType);
+ var ____result = new global::TestData2.Nest2();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -566,23 +522,17 @@ namespace MessagePack.Formatters.TestData2
case 6:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 110266531802693UL) { goto FAIL; }
- __EnumId__ = formatterResolver.GetFormatterWithVerify<global::TestData2.Nest2.Id>().Deserialize(ref reader, options);
+ ____result.EnumId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest2.Id>(formatterResolver).Deserialize(ref reader, options);
continue;
case 7:
if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 28228257876896835UL) { goto FAIL; }
- __ClassId__ = formatterResolver.GetFormatterWithVerify<global::TestData2.Nest2.IdType>().Deserialize(ref reader, options);
+ ____result.ClassId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<global::TestData2.Nest2.IdType>(formatterResolver).Deserialize(ref reader, options);
continue;
}
}
- var ____result = new global::TestData2.Nest2()
- {
- EnumId = __EnumId__,
- ClassId = __ClassId__,
- };
-
reader.Depth--;
return ____result;
}
@@ -590,7 +540,6 @@ namespace MessagePack.Formatters.TestData2
public sealed class Nest2_IdTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.Nest2.IdType>
{
-
public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest2.IdType value, global::MessagePack.MessagePackSerializerOptions options)
{
if (value is null)
@@ -630,12 +579,12 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_MyProperty1());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
writer.WriteRaw(GetSpan_MyProperty2());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.MyProperty2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.MyProperty2, options);
}
public global::TestData2.PropNameCheck1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -646,14 +595,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __MyProperty1__ = default(string);
- var __MyProperty2__ = default(string);
+ var ____result = new global::TestData2.PropNameCheck1();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -669,10 +617,10 @@ namespace MessagePack.Formatters.TestData2
{
default: goto FAIL;
case 3242356UL:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
case 3307892UL:
- __MyProperty2__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
}
@@ -681,12 +629,6 @@ namespace MessagePack.Formatters.TestData2
}
}
- var ____result = new global::TestData2.PropNameCheck1()
- {
- MyProperty1 = __MyProperty1__,
- MyProperty2 = __MyProperty2__,
- };
-
reader.Depth--;
return ____result;
}
@@ -707,12 +649,12 @@ namespace MessagePack.Formatters.TestData2
return;
}
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
writer.WriteMapHeader(2);
writer.WriteRaw(GetSpan_MyProperty1());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.MyProperty1, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.MyProperty1, options);
writer.WriteRaw(GetSpan_MyProperty2());
- formatterResolver.GetFormatterWithVerify<string>().Serialize(ref writer, value.MyProperty2, options);
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.MyProperty2, options);
}
public global::TestData2.PropNameCheck2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
@@ -723,14 +665,13 @@ namespace MessagePack.Formatters.TestData2
}
options.Security.DepthStep(ref reader);
- IFormatterResolver formatterResolver = options.Resolver;
+ var formatterResolver = options.Resolver;
var length = reader.ReadMapHeader();
- var __MyProperty1__ = default(string);
- var __MyProperty2__ = default(string);
+ var ____result = new global::TestData2.PropNameCheck2();
for (int i = 0; i < length; i++)
{
- ReadOnlySpan<byte> stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
switch (stringKey.Length)
{
default:
@@ -746,10 +687,10 @@ namespace MessagePack.Formatters.TestData2
{
default: goto FAIL;
case 3242356UL:
- __MyProperty1__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
case 3307892UL:
- __MyProperty2__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(ref reader, options);
+ ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
continue;
}
@@ -758,15 +699,76 @@ namespace MessagePack.Formatters.TestData2
}
}
- var ____result = new global::TestData2.PropNameCheck2()
+ reader.Depth--;
+ return ____result;
+ }
+ }
+
+ public sealed class RecordFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::TestData2.Record>
+ {
+ // SomeProperty
+ private static global::System.ReadOnlySpan<byte> GetSpan_SomeProperty() => new byte[1 + 12] { 172, 83, 111, 109, 101, 80, 114, 111, 112, 101, 114, 116, 121 };
+
+ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Record value, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (value is null)
{
- MyProperty1 = __MyProperty1__,
- MyProperty2 = __MyProperty2__,
- };
+ writer.WriteNil();
+ return;
+ }
+ var formatterResolver = options.Resolver;
+ writer.WriteMapHeader(1);
+ writer.WriteRaw(GetSpan_SomeProperty());
+ global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Serialize(ref writer, value.SomeProperty, options);
+ }
+
+ public global::TestData2.Record Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options)
+ {
+ if (reader.TryReadNil())
+ {
+ return null;
+ }
+
+ options.Security.DepthStep(ref reader);
+ var formatterResolver = options.Resolver;
+ var length = reader.ReadMapHeader();
+ var __SomeProperty__ = default(string);
+
+ for (int i = 0; i < length; i++)
+ {
+ var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader);
+ switch (stringKey.Length)
+ {
+ default:
+ FAIL:
+ reader.Skip();
+ continue;
+ case 12:
+ if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_SomeProperty().Slice(1))) { goto FAIL; }
+
+ __SomeProperty__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<string>(formatterResolver).Deserialize(ref reader, options);
+ continue;
+
+ }
+ }
+
+ var ____result = new global::TestData2.Record(__SomeProperty__);
reader.Depth--;
return ____result;
}
}
+
}
+#pragma warning restore 168
+#pragma warning restore 414
+#pragma warning restore 618
+#pragma warning restore 612
+
+#pragma warning restore SA1129 // Do not use default value type constructor
+#pragma warning restore SA1309 // Field names should not begin with underscore
+#pragma warning restore SA1312 // Variable names should begin with lower-case letter
+#pragma warning restore SA1403 // File may only contain a single namespace
+#pragma warning restore SA1649 // File name should match first type name
+
diff --git a/sandbox/TestData2/Record.cs b/sandbox/TestData2/Record.cs
new file mode 100644
index 00000000..b48bf693
--- /dev/null
+++ b/sandbox/TestData2/Record.cs
@@ -0,0 +1,10 @@
+// Copyright (c) All contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using MessagePack;
+
+namespace TestData2
+{
+ [MessagePackObject]
+ public record Record([property: Key("SomeProperty")] string SomeProperty);
+}
diff --git a/sandbox/TestData2/TestData2.csproj b/sandbox/TestData2/TestData2.csproj
index 966e801d..a7313049 100644
--- a/sandbox/TestData2/TestData2.csproj
+++ b/sandbox/TestData2/TestData2.csproj
@@ -1,10 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
+ <LangVersion>10</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MessagePack" Version="2.1.90" />
+ <PackageReference Include="IsExternalInit" Version="1.0.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.3" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
+ <ItemGroup>
+ <Using Include="System.Collections.Generic" />
+ <Using Include="MessagePack" />
+ </ItemGroup>
</Project>
diff --git a/sandbox/TestData2/codegen.ps1 b/sandbox/TestData2/codegen.ps1
index 17ec27b2..6781688e 100644
--- a/sandbox/TestData2/codegen.ps1
+++ b/sandbox/TestData2/codegen.ps1
@@ -1 +1 @@
-dotnet run -p "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/TestData2.csproj" -o "$PSScriptRoot/Generated.cs"
+dotnet run -f "net6.0" --project "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/TestData2.csproj" -o "$PSScriptRoot/Generated.cs"