@@ -13,72 +13,38 @@ namespace MsgPack.Serialization.GeneratedSerializers.ArrayBased {
1313
1414 [ System . CodeDom . Compiler . GeneratedCodeAttribute ( "MsgPack.Serialization.CodeDomSerializers.CodeDomSerializerBuilder" , "0.6.0.0" ) ]
1515 [ System . Diagnostics . DebuggerNonUserCodeAttribute ( ) ]
16- public class MsgPack_Serialization_AddOnlyCollection_1_MsgPack_MessagePackObjectArray_Serializer : MsgPack . Serialization . MessagePackSerializer < MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > > {
17-
18- private MsgPack . Serialization . MessagePackSerializer < MsgPack . MessagePackObject [ ] [ ] > _serializer0 ;
19-
20- private MsgPack . Serialization . MessagePackSerializer < MsgPack . MessagePackObject [ ] > _serializer1 ;
16+ public class MsgPack_Serialization_AddOnlyCollection_1_MsgPack_MessagePackObjectArray_Serializer : MsgPack . Serialization . CollectionSerializers . EnumerableMessagePackSerializer < MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > , MsgPack . MessagePackObject [ ] > {
2117
2218 public MsgPack_Serialization_AddOnlyCollection_1_MsgPack_MessagePackObjectArray_Serializer ( MsgPack . Serialization . SerializationContext context ) :
23- base ( context ) {
24- MsgPack . Serialization . PolymorphismSchema schema0 = default ( MsgPack . Serialization . PolymorphismSchema ) ;
25- schema0 = null ;
26- this . _serializer0 = context . GetSerializer < MsgPack . MessagePackObject [ ] [ ] > ( schema0 ) ;
27- MsgPack . Serialization . PolymorphismSchema schema1 = default ( MsgPack . Serialization . PolymorphismSchema ) ;
28- schema1 = null ;
29- this . _serializer1 = context . GetSerializer < MsgPack . MessagePackObject [ ] > ( schema1 ) ;
19+ base ( context , MsgPack_Serialization_AddOnlyCollection_1_MsgPack_MessagePackObjectArray_Serializer . RestoreSchema ( ) ) {
3020 }
3121
32- protected internal override void PackToCore ( MsgPack . Packer packer , MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > objectTree ) {
33- this . _serializer0 . PackTo ( packer , System . Linq . Enumerable . ToArray ( objectTree ) ) ;
22+ protected override void AddItem ( MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > collection , MsgPack . MessagePackObject [ ] item ) {
23+ collection . Add ( item ) ;
3424 }
3525
3626 protected internal override MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > UnpackFromCore ( MsgPack . Unpacker unpacker ) {
3727 if ( ( unpacker . IsArrayHeader == false ) ) {
3828 throw MsgPack . Serialization . SerializationExceptions . NewIsNotArrayHeader ( ) ;
3929 }
30+ int itemsCount = default ( int ) ;
31+ itemsCount = MsgPack . Serialization . UnpackHelpers . GetItemsCount ( unpacker ) ;
4032 MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > collection = default ( MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > ) ;
4133 collection = new MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > ( ) ;
4234 this . UnpackToCore ( unpacker , collection ) ;
4335 return collection ;
4436 }
4537
46- protected internal override void UnpackToCore ( MsgPack . Unpacker unpacker , MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > collection ) {
47- if ( ( unpacker . IsArrayHeader == false ) ) {
48- throw MsgPack . Serialization . SerializationExceptions . NewIsNotArrayHeader ( ) ;
49- }
50- int count = default ( int ) ;
51- count = MsgPack . Serialization . UnpackHelpers . GetItemsCount ( unpacker ) ;
52- for ( int i = 0 ; ( i < count ) ; i = ( i + 1 ) ) {
53- MsgPack . MessagePackObject [ ] nullable = default ( MsgPack . MessagePackObject [ ] ) ;
54- if ( ( unpacker . Read ( ) == false ) ) {
55- throw MsgPack . Serialization . SerializationExceptions . NewMissingItem ( i ) ;
56- }
57- if ( ( ( unpacker . IsArrayHeader == false )
58- && ( unpacker . IsMapHeader == false ) ) ) {
59- nullable = this . _serializer1 . UnpackFrom ( unpacker ) ;
60- }
61- else {
62- MsgPack . Unpacker disposable = default ( MsgPack . Unpacker ) ;
63- disposable = unpacker . ReadSubtree ( ) ;
64- try {
65- nullable = this . _serializer1 . UnpackFrom ( disposable ) ;
66- }
67- finally {
68- if ( ( ( disposable == null )
69- == false ) ) {
70- disposable . Dispose ( ) ;
71- }
72- }
73- }
74- if ( ( ( nullable == null )
75- == false ) ) {
76- collection . Add ( nullable ) ;
77- }
78- else {
79- collection . Add ( nullable ) ;
80- }
81- }
38+ protected override MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > CreateInstance ( int initialCapacity ) {
39+ MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > collection = default ( MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > ) ;
40+ collection = new MsgPack . Serialization . AddOnlyCollection < MsgPack . MessagePackObject [ ] > ( ) ;
41+ return collection ;
42+ }
43+
44+ private static MsgPack . Serialization . PolymorphismSchema RestoreSchema ( ) {
45+ MsgPack . Serialization . PolymorphismSchema schema = default ( MsgPack . Serialization . PolymorphismSchema ) ;
46+ schema = null ;
47+ return schema ;
8248 }
8349
8450 private static T @__Conditional < T > ( bool condition , T whenTrue , T whenFalse )
0 commit comments