From 541b442b99e1e9a1c514e2aacfe1e83561a9ab68 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 15 Jul 2015 13:36:56 +0100 Subject: Don't create nested types (or field accessors) for map types. I'm sure I've implemented this before, but somehow it's been lost in a maze of twisty little branches, all alike. --- .../TestProtos/MapUnittestProto3.cs | 6852 ++------------------ .../src/ProtocolBuffers/WellKnownTypes/Struct.cs | 163 - .../protobuf/compiler/csharp/csharp_helpers.h | 6 + .../protobuf/compiler/csharp/csharp_message.cc | 27 +- .../protobuf/compiler/csharp/csharp_message.h | 2 + 5 files changed, 655 insertions(+), 6395 deletions(-) diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs index 843991f8..5f6eae0c 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs @@ -14,49 +14,12 @@ namespace Google.Protobuf.TestProtos { #region Static variables internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable; #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { @@ -198,135 +161,24 @@ namespace Google.Protobuf.TestProtos { internal__static_protobuf_unittest_TestMap__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap), descriptor.MessageTypes[0], new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapInt32Bytes", "MapInt32Enum", "MapInt32ForeignMessage", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32Int32Entry), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt64Int64Entry), descriptor.MessageTypes[0].NestedTypes[1], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapUint32Uint32Entry), descriptor.MessageTypes[0].NestedTypes[2], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapUint64Uint64Entry), descriptor.MessageTypes[0].NestedTypes[3], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSint32Sint32Entry), descriptor.MessageTypes[0].NestedTypes[4], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSint64Sint64Entry), descriptor.MessageTypes[0].NestedTypes[5], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapFixed32Fixed32Entry), descriptor.MessageTypes[0].NestedTypes[6], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapFixed64Fixed64Entry), descriptor.MessageTypes[0].NestedTypes[7], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSfixed32Sfixed32Entry), descriptor.MessageTypes[0].NestedTypes[8], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSfixed64Sfixed64Entry), descriptor.MessageTypes[0].NestedTypes[9], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32FloatEntry), descriptor.MessageTypes[0].NestedTypes[10], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32DoubleEntry), descriptor.MessageTypes[0].NestedTypes[11], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapBoolBoolEntry), descriptor.MessageTypes[0].NestedTypes[12], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapStringStringEntry), descriptor.MessageTypes[0].NestedTypes[13], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32BytesEntry), descriptor.MessageTypes[0].NestedTypes[14], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32EnumEntry), descriptor.MessageTypes[0].NestedTypes[15], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32ForeignMessageEntry), descriptor.MessageTypes[0].NestedTypes[16], - new string[] { "Key", "Value", }, new string[] { }); internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), descriptor.MessageTypes[1], new string[] { "TestMap", }, new string[] { }); internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMessageMap), descriptor.MessageTypes[2], new string[] { "MapInt32Message", }, new string[] { }); - internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMessageMap.Types.MapInt32MessageEntry), descriptor.MessageTypes[2].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), descriptor.MessageTypes[3], new string[] { "Map1", "Map2", }, new string[] { }); - internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap.Types.Map1Entry), descriptor.MessageTypes[3].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap.Types.Map2Entry), descriptor.MessageTypes[3].NestedTypes[1], - new string[] { "Key", "Value", }, new string[] { }); internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap), descriptor.MessageTypes[4], new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapInt32Enum", "MapInt32ForeignMessage", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32Int32Entry), descriptor.MessageTypes[4].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt64Int64Entry), descriptor.MessageTypes[4].NestedTypes[1], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapUint32Uint32Entry), descriptor.MessageTypes[4].NestedTypes[2], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapUint64Uint64Entry), descriptor.MessageTypes[4].NestedTypes[3], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSint32Sint32Entry), descriptor.MessageTypes[4].NestedTypes[4], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSint64Sint64Entry), descriptor.MessageTypes[4].NestedTypes[5], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapFixed32Fixed32Entry), descriptor.MessageTypes[4].NestedTypes[6], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapFixed64Fixed64Entry), descriptor.MessageTypes[4].NestedTypes[7], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSfixed32Sfixed32Entry), descriptor.MessageTypes[4].NestedTypes[8], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSfixed64Sfixed64Entry), descriptor.MessageTypes[4].NestedTypes[9], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32FloatEntry), descriptor.MessageTypes[4].NestedTypes[10], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32DoubleEntry), descriptor.MessageTypes[4].NestedTypes[11], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapBoolBoolEntry), descriptor.MessageTypes[4].NestedTypes[12], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32EnumEntry), descriptor.MessageTypes[4].NestedTypes[13], - new string[] { "Key", "Value", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32ForeignMessageEntry), descriptor.MessageTypes[4].NestedTypes[14], - new string[] { "Key", "Value", }, new string[] { }); internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), descriptor.MessageTypes[5], new string[] { "Type", }, new string[] { }); - internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.TypeEntry), descriptor.MessageTypes[5].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), descriptor.MessageTypes[6], new string[] { "Entry", }, new string[] { }); - internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry.Types.EntryEntry), descriptor.MessageTypes[6].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); } #endregion @@ -754,5904 +606,749 @@ namespace Google.Protobuf.TestProtos { } } - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32Int32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32Int32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[0]; } - } + } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable; } - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestMapSubmessage : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage()); + public static pb::MessageParser Parser { get { return _parser; } } - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } + private static readonly string[] _fieldNames = new string[] { "test_map" }; + private static readonly uint[] _fieldTags = new uint[] { 10 }; + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[1]; } + } - public MapInt32Int32Entry() { - OnConstruction(); - } + pbr::FieldAccessorTable pb::IReflectedMessage.Fields { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; } + } - partial void OnConstruction(); + private bool _frozen = false; + public bool IsFrozen { get { return _frozen; } } - public MapInt32Int32Entry(MapInt32Int32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } + public TestMapSubmessage() { + OnConstruction(); + } - public MapInt32Int32Entry Clone() { - return new MapInt32Int32Entry(this); - } + partial void OnConstruction(); - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } + public TestMapSubmessage(TestMapSubmessage other) : this() { + TestMap = other.testMap_ != null ? other.TestMap.Clone() : null; + } - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } + public TestMapSubmessage Clone() { + return new TestMapSubmessage(this); + } - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } + public void Freeze() { + if (IsFrozen) { + return; + } + _frozen = true; + if (testMap_ != null) TestMap.Freeze(); + } - public override bool Equals(object other) { - return Equals(other as MapInt32Int32Entry); - } + public const int TestMapFieldNumber = 1; + private global::Google.Protobuf.TestProtos.TestMap testMap_; + public global::Google.Protobuf.TestProtos.TestMap TestMap { + get { return testMap_; } + set { + pb::Freezable.CheckMutable(this); + testMap_ = value; + } + } - public bool Equals(MapInt32Int32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } + public override bool Equals(object other) { + return Equals(other as TestMapSubmessage); + } - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } + public bool Equals(TestMapSubmessage other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(TestMap, other.TestMap)) return false; + return true; + } - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } + public override int GetHashCode() { + int hash = 1; + if (testMap_ != null) hash ^= TestMap.GetHashCode(); + return hash; + } - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteInt32(Value); - } - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value); - } - return size; - } + public void WriteTo(pb::CodedOutputStream output) { + if (testMap_ != null) { + output.WriteRawTag(10); + output.WriteMessage(TestMap); + } + } - public void MergeFrom(MapInt32Int32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } + public int CalculateSize() { + int size = 0; + if (testMap_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(TestMap); + } + return size; + } + + public void MergeFrom(TestMapSubmessage other) { + if (other == null) { + return; + } + if (other.testMap_ != null) { + if (testMap_ == null) { + testMap_ = new global::Google.Protobuf.TestProtos.TestMap(); } + TestMap.MergeFrom(other.TestMap); + } + } - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - Value = input.ReadInt32(); - break; - } + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; + } + break; + case 10: { + if (testMap_ == null) { + testMap_ = new global::Google.Protobuf.TestProtos.TestMap(); } + input.ReadMessage(testMap_); + break; } } - } + } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt64Int64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt64Int64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } + } - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[1]; } - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestMessageMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap()); + public static pb::MessageParser Parser { get { return _parser; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable; } - } + private static readonly string[] _fieldNames = new string[] { "map_int32_message" }; + private static readonly uint[] _fieldTags = new uint[] { 10 }; + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[2]; } + } - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } + pbr::FieldAccessorTable pb::IReflectedMessage.Fields { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; } + } - public MapInt64Int64Entry() { - OnConstruction(); - } + private bool _frozen = false; + public bool IsFrozen { get { return _frozen; } } - partial void OnConstruction(); + public TestMessageMap() { + OnConstruction(); + } - public MapInt64Int64Entry(MapInt64Int64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } + partial void OnConstruction(); - public MapInt64Int64Entry Clone() { - return new MapInt64Int64Entry(this); - } + public TestMessageMap(TestMessageMap other) : this() { + mapInt32Message_ = other.mapInt32Message_.Clone(); + } - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } + public TestMessageMap Clone() { + return new TestMessageMap(this); + } - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } + public void Freeze() { + if (IsFrozen) { + return; + } + _frozen = true; + mapInt32Message_.Freeze(); + } - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } + public const int MapInt32MessageFieldNumber = 1; + private static readonly pbc::MapField.Codec _map_mapInt32Message_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); + private readonly pbc::MapField mapInt32Message_ = new pbc::MapField(); + public pbc::MapField MapInt32Message { + get { return mapInt32Message_; } + } - public override bool Equals(object other) { - return Equals(other as MapInt64Int64Entry); - } + public override bool Equals(object other) { + return Equals(other as TestMessageMap); + } - public bool Equals(MapInt64Int64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } + public bool Equals(TestMessageMap other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!MapInt32Message.Equals(other.MapInt32Message)) return false; + return true; + } - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } + public override int GetHashCode() { + int hash = 1; + hash ^= MapInt32Message.GetHashCode(); + return hash; + } - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Key); - } - if (Value != 0L) { - output.WriteRawTag(16); - output.WriteInt64(Value); - } - } + public void WriteTo(pb::CodedOutputStream output) { + mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec); + } - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Key); - } - if (Value != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Value); - } - return size; - } + public int CalculateSize() { + int size = 0; + size += mapInt32Message_.CalculateSize(_map_mapInt32Message_codec); + return size; + } - public void MergeFrom(MapInt64Int64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } + public void MergeFrom(TestMessageMap other) { + if (other == null) { + return; + } + mapInt32Message_.Add(other.mapInt32Message_); + } - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt64(); - break; - } - case 16: { - Value = input.ReadInt64(); - break; - } + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; } + break; + case 10: { + mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec); + break; } } - } + } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapUint32Uint32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapUint32Uint32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } + } - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[2]; } - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestSameTypeMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); + public static pb::MessageParser Parser { get { return _parser; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapUint32Uint32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapUint32Uint32Entry(MapUint32Uint32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapUint32Uint32Entry Clone() { - return new MapUint32Uint32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } + private static readonly string[] _fieldNames = new string[] { "map1", "map2" }; + private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[3]; } + } - public const int KeyFieldNumber = 1; - private uint key_; - public uint Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } + pbr::FieldAccessorTable pb::IReflectedMessage.Fields { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; } + } - public const int ValueFieldNumber = 2; - private uint value_; - public uint Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } + private bool _frozen = false; + public bool IsFrozen { get { return _frozen; } } - public override bool Equals(object other) { - return Equals(other as MapUint32Uint32Entry); - } + public TestSameTypeMap() { + OnConstruction(); + } - public bool Equals(MapUint32Uint32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } + partial void OnConstruction(); - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } + public TestSameTypeMap(TestSameTypeMap other) : this() { + map1_ = other.map1_.Clone(); + map2_ = other.map2_.Clone(); + } - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } + public TestSameTypeMap Clone() { + return new TestSameTypeMap(this); + } - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteUInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Value); - } - } + public void Freeze() { + if (IsFrozen) { + return; + } + _frozen = true; + map1_.Freeze(); + map2_.Freeze(); + } - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Value); - } - return size; - } + public const int Map1FieldNumber = 1; + private static readonly pbc::MapField.Codec _map_map1_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); + private readonly pbc::MapField map1_ = new pbc::MapField(); + public pbc::MapField Map1 { + get { return map1_; } + } - public void MergeFrom(MapUint32Uint32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } + public const int Map2FieldNumber = 2; + private static readonly pbc::MapField.Codec _map_map2_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 18); + private readonly pbc::MapField map2_ = new pbc::MapField(); + public pbc::MapField Map2 { + get { return map2_; } + } - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadUInt32(); - break; - } - case 16: { - Value = input.ReadUInt32(); - break; - } - } - } - } + public override bool Equals(object other) { + return Equals(other as TestSameTypeMap); + } + public bool Equals(TestSameTypeMap other) { + if (ReferenceEquals(other, null)) { + return false; } + if (ReferenceEquals(other, this)) { + return true; + } + if (!Map1.Equals(other.Map1)) return false; + if (!Map2.Equals(other.Map2)) return false; + return true; + } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapUint64Uint64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapUint64Uint64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[3]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } + public override int GetHashCode() { + int hash = 1; + hash ^= Map1.GetHashCode(); + hash ^= Map2.GetHashCode(); + return hash; + } - public MapUint64Uint64Entry() { - OnConstruction(); - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - partial void OnConstruction(); + public void WriteTo(pb::CodedOutputStream output) { + map1_.WriteTo(output, _map_map1_codec); + map2_.WriteTo(output, _map_map2_codec); + } - public MapUint64Uint64Entry(MapUint64Uint64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } + public int CalculateSize() { + int size = 0; + size += map1_.CalculateSize(_map_map1_codec); + size += map2_.CalculateSize(_map_map2_codec); + return size; + } - public MapUint64Uint64Entry Clone() { - return new MapUint64Uint64Entry(this); - } + public void MergeFrom(TestSameTypeMap other) { + if (other == null) { + return; + } + map1_.Add(other.map1_); + map2_.Add(other.map2_); + } - public void Freeze() { - if (IsFrozen) { - return; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; + } + break; + case 10: { + map1_.AddEntriesFrom(input, _map_map1_codec); + break; } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private ulong key_; - public ulong Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; + case 18: { + map2_.AddEntriesFrom(input, _map_map2_codec); + break; } } + } + } - public const int ValueFieldNumber = 2; - private ulong value_; - public ulong Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } + } - public override bool Equals(object other) { - return Equals(other as MapUint64Uint64Entry); - } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TestArenaMap : pb::IMessage { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap()); + public static pb::MessageParser Parser { get { return _parser; } } - public bool Equals(MapUint64Uint64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } + private static readonly string[] _fieldNames = new string[] { "map_bool_bool", "map_fixed32_fixed32", "map_fixed64_fixed64", "map_int32_double", "map_int32_enum", "map_int32_float", "map_int32_foreign_message", "map_int32_int32", "map_int64_int64", "map_sfixed32_sfixed32", "map_sfixed64_sfixed64", "map_sint32_sint32", "map_sint64_sint64", "map_uint32_uint32", "map_uint64_uint64" }; + private static readonly uint[] _fieldTags = new uint[] { 106, 58, 66, 98, 114, 90, 122, 10, 18, 74, 82, 42, 50, 26, 34 }; + public static pbr::MessageDescriptor Descriptor { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[4]; } + } - public override int GetHashCode() { - int hash = 1; - if (Key != 0UL) hash ^= Key.GetHashCode(); - if (Value != 0UL) hash ^= Value.GetHashCode(); - return hash; - } + pbr::FieldAccessorTable pb::IReflectedMessage.Fields { + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; } + } - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } + private bool _frozen = false; + public bool IsFrozen { get { return _frozen; } } - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0UL) { - output.WriteRawTag(8); - output.WriteUInt64(Key); - } - if (Value != 0UL) { - output.WriteRawTag(16); - output.WriteUInt64(Value); - } - } + public TestArenaMap() { + OnConstruction(); + } - public int CalculateSize() { - int size = 0; - if (Key != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Key); - } - if (Value != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Value); - } - return size; - } + partial void OnConstruction(); - public void MergeFrom(MapUint64Uint64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0UL) { - Key = other.Key; - } - if (other.Value != 0UL) { - Value = other.Value; - } - } + public TestArenaMap(TestArenaMap other) : this() { + mapInt32Int32_ = other.mapInt32Int32_.Clone(); + mapInt64Int64_ = other.mapInt64Int64_.Clone(); + mapUint32Uint32_ = other.mapUint32Uint32_.Clone(); + mapUint64Uint64_ = other.mapUint64Uint64_.Clone(); + mapSint32Sint32_ = other.mapSint32Sint32_.Clone(); + mapSint64Sint64_ = other.mapSint64Sint64_.Clone(); + mapFixed32Fixed32_ = other.mapFixed32Fixed32_.Clone(); + mapFixed64Fixed64_ = other.mapFixed64Fixed64_.Clone(); + mapSfixed32Sfixed32_ = other.mapSfixed32Sfixed32_.Clone(); + mapSfixed64Sfixed64_ = other.mapSfixed64Sfixed64_.Clone(); + mapInt32Float_ = other.mapInt32Float_.Clone(); + mapInt32Double_ = other.mapInt32Double_.Clone(); + mapBoolBool_ = other.mapBoolBool_.Clone(); + mapInt32Enum_ = other.mapInt32Enum_.Clone(); + mapInt32ForeignMessage_ = other.mapInt32ForeignMessage_.Clone(); + } - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadUInt64(); - break; - } - case 16: { - Value = input.ReadUInt64(); - break; - } - } - } - } + public TestArenaMap Clone() { + return new TestArenaMap(this); + } + public void Freeze() { + if (IsFrozen) { + return; } + _frozen = true; + mapInt32Int32_.Freeze(); + mapInt64Int64_.Freeze(); + mapUint32Uint32_.Freeze(); + mapUint64Uint64_.Freeze(); + mapSint32Sint32_.Freeze(); + mapSint64Sint64_.Freeze(); + mapFixed32Fixed32_.Freeze(); + mapFixed64Fixed64_.Freeze(); + mapSfixed32Sfixed32_.Freeze(); + mapSfixed64Sfixed64_.Freeze(); + mapInt32Float_.Freeze(); + mapInt32Double_.Freeze(); + mapBoolBool_.Freeze(); + mapInt32Enum_.Freeze(); + mapInt32ForeignMessage_.Freeze(); + } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSint32Sint32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSint32Sint32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } + public const int MapInt32Int32FieldNumber = 1; + private static readonly pbc::MapField.Codec _map_mapInt32Int32_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); + private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); + public pbc::MapField MapInt32Int32 { + get { return mapInt32Int32_; } + } - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[4]; } - } + public const int MapInt64Int64FieldNumber = 2; + private static readonly pbc::MapField.Codec _map_mapInt64Int64_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); + private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); + public pbc::MapField MapInt64Int64 { + get { return mapInt64Int64_; } + } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable; } - } + public const int MapUint32Uint32FieldNumber = 3; + private static readonly pbc::MapField.Codec _map_mapUint32Uint32_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); + private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); + public pbc::MapField MapUint32Uint32 { + get { return mapUint32Uint32_; } + } - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } + public const int MapUint64Uint64FieldNumber = 4; + private static readonly pbc::MapField.Codec _map_mapUint64Uint64_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); + private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); + public pbc::MapField MapUint64Uint64 { + get { return mapUint64Uint64_; } + } - public MapSint32Sint32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSint32Sint32Entry(MapSint32Sint32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSint32Sint32Entry Clone() { - return new MapSint32Sint32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSint32Sint32Entry); - } - - public bool Equals(MapSint32Sint32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteSInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteSInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Value); - } - return size; - } - - public void MergeFrom(MapSint32Sint32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadSInt32(); - break; - } - case 16: { - Value = input.ReadSInt32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSint64Sint64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSint64Sint64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[5]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSint64Sint64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSint64Sint64Entry(MapSint64Sint64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSint64Sint64Entry Clone() { - return new MapSint64Sint64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSint64Sint64Entry); - } - - public bool Equals(MapSint64Sint64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(8); - output.WriteSInt64(Key); - } - if (Value != 0L) { - output.WriteRawTag(16); - output.WriteSInt64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Key); - } - if (Value != 0L) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Value); - } - return size; - } - - public void MergeFrom(MapSint64Sint64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadSInt64(); - break; - } - case 16: { - Value = input.ReadSInt64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapFixed32Fixed32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapFixed32Fixed32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[6]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapFixed32Fixed32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapFixed32Fixed32Entry Clone() { - return new MapFixed32Fixed32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private uint key_; - public uint Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private uint value_; - public uint Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapFixed32Fixed32Entry); - } - - public bool Equals(MapFixed32Fixed32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(13); - output.WriteFixed32(Key); - } - if (Value != 0) { - output.WriteRawTag(21); - output.WriteFixed32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + 4; - } - if (Value != 0) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapFixed32Fixed32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 13: { - Key = input.ReadFixed32(); - break; - } - case 21: { - Value = input.ReadFixed32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapFixed64Fixed64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapFixed64Fixed64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[7]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapFixed64Fixed64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapFixed64Fixed64Entry Clone() { - return new MapFixed64Fixed64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private ulong key_; - public ulong Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private ulong value_; - public ulong Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapFixed64Fixed64Entry); - } - - public bool Equals(MapFixed64Fixed64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0UL) hash ^= Key.GetHashCode(); - if (Value != 0UL) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0UL) { - output.WriteRawTag(9); - output.WriteFixed64(Key); - } - if (Value != 0UL) { - output.WriteRawTag(17); - output.WriteFixed64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0UL) { - size += 1 + 8; - } - if (Value != 0UL) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapFixed64Fixed64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0UL) { - Key = other.Key; - } - if (other.Value != 0UL) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 9: { - Key = input.ReadFixed64(); - break; - } - case 17: { - Value = input.ReadFixed64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSfixed32Sfixed32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSfixed32Sfixed32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[8]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSfixed32Sfixed32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSfixed32Sfixed32Entry Clone() { - return new MapSfixed32Sfixed32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSfixed32Sfixed32Entry); - } - - public bool Equals(MapSfixed32Sfixed32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(13); - output.WriteSFixed32(Key); - } - if (Value != 0) { - output.WriteRawTag(21); - output.WriteSFixed32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + 4; - } - if (Value != 0) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapSfixed32Sfixed32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 13: { - Key = input.ReadSFixed32(); - break; - } - case 21: { - Value = input.ReadSFixed32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSfixed64Sfixed64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSfixed64Sfixed64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[9]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSfixed64Sfixed64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSfixed64Sfixed64Entry Clone() { - return new MapSfixed64Sfixed64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSfixed64Sfixed64Entry); - } - - public bool Equals(MapSfixed64Sfixed64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(9); - output.WriteSFixed64(Key); - } - if (Value != 0L) { - output.WriteRawTag(17); - output.WriteSFixed64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + 8; - } - if (Value != 0L) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapSfixed64Sfixed64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 9: { - Key = input.ReadSFixed64(); - break; - } - case 17: { - Value = input.ReadSFixed64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32FloatEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32FloatEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[10]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32FloatEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32FloatEntry(MapInt32FloatEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32FloatEntry Clone() { - return new MapInt32FloatEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private float value_; - public float Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32FloatEntry); - } - - public bool Equals(MapInt32FloatEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0F) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0F) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapInt32FloatEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0F) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 21: { - Value = input.ReadFloat(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32DoubleEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32DoubleEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[11]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32DoubleEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32DoubleEntry(MapInt32DoubleEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32DoubleEntry Clone() { - return new MapInt32DoubleEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private double value_; - public double Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32DoubleEntry); - } - - public bool Equals(MapInt32DoubleEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0D) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0D) { - output.WriteRawTag(17); - output.WriteDouble(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0D) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapInt32DoubleEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0D) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 17: { - Value = input.ReadDouble(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapBoolBoolEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapBoolBoolEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[12]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapBoolBoolEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapBoolBoolEntry(MapBoolBoolEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapBoolBoolEntry Clone() { - return new MapBoolBoolEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private bool key_; - public bool Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private bool value_; - public bool Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapBoolBoolEntry); - } - - public bool Equals(MapBoolBoolEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != false) hash ^= Key.GetHashCode(); - if (Value != false) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != false) { - output.WriteRawTag(8); - output.WriteBool(Key); - } - if (Value != false) { - output.WriteRawTag(16); - output.WriteBool(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != false) { - size += 1 + 1; - } - if (Value != false) { - size += 1 + 1; - } - return size; - } - - public void MergeFrom(MapBoolBoolEntry other) { - if (other == null) { - return; - } - if (other.Key != false) { - Key = other.Key; - } - if (other.Value != false) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadBool(); - break; - } - case 16: { - Value = input.ReadBool(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapStringStringEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapStringStringEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[13]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapStringStringEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapStringStringEntry(MapStringStringEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapStringStringEntry Clone() { - return new MapStringStringEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private string key_ = ""; - public string Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value ?? ""; - } - } - - public const int ValueFieldNumber = 2; - private string value_ = ""; - public string Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value ?? ""; - } - } - - public override bool Equals(object other) { - return Equals(other as MapStringStringEntry); - } - - public bool Equals(MapStringStringEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Value.Length != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (Value.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); - } - return size; - } - - public void MergeFrom(MapStringStringEntry other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.Value.Length != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - Key = input.ReadString(); - break; - } - case 18: { - Value = input.ReadString(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32BytesEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32BytesEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[14]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32BytesEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32BytesEntry(MapInt32BytesEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32BytesEntry Clone() { - return new MapInt32BytesEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private pb::ByteString value_ = pb::ByteString.Empty; - public pb::ByteString Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value ?? pb::ByteString.Empty; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32BytesEntry); - } - - public bool Equals(MapInt32BytesEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value.Length != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Value); - } - return size; - } - - public void MergeFrom(MapInt32BytesEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value.Length != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 18: { - Value = input.ReadBytes(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32EnumEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32EnumEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[15]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32EnumEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32EnumEntry(MapInt32EnumEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32EnumEntry Clone() { - return new MapInt32EnumEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.MapEnum value_ = global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO; - public global::Google.Protobuf.TestProtos.MapEnum Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32EnumEntry); - } - - public bool Equals(MapInt32EnumEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - output.WriteRawTag(16); - output.WriteEnum((int) Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value); - } - return size; - } - - public void MergeFrom(MapInt32EnumEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - value_ = (global::Google.Protobuf.TestProtos.MapEnum) input.ReadEnum(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32ForeignMessageEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32ForeignMessageEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[16]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32ForeignMessageEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) : this() { - key_ = other.key_; - Value = other.value_ != null ? other.Value.Clone() : null; - } - - public MapInt32ForeignMessageEntry Clone() { - return new MapInt32ForeignMessageEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - if (value_ != null) Value.Freeze(); - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.ForeignMessage value_; - public global::Google.Protobuf.TestProtos.ForeignMessage Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32ForeignMessageEntry); - } - - public bool Equals(MapInt32ForeignMessageEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (!object.Equals(Value, other.Value)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); - } - return size; - } - - public void MergeFrom(MapInt32ForeignMessageEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.value_ != null) { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.ForeignMessage(); - } - Value.MergeFrom(other.Value); - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 18: { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.ForeignMessage(); - } - input.ReadMessage(value_); - break; - } - } - } - } - - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMapSubmessage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMapSubmessage()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "test_map" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[1]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public TestMapSubmessage() { - OnConstruction(); - } - - partial void OnConstruction(); - - public TestMapSubmessage(TestMapSubmessage other) : this() { - TestMap = other.testMap_ != null ? other.TestMap.Clone() : null; - } - - public TestMapSubmessage Clone() { - return new TestMapSubmessage(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - if (testMap_ != null) TestMap.Freeze(); - } - - public const int TestMapFieldNumber = 1; - private global::Google.Protobuf.TestProtos.TestMap testMap_; - public global::Google.Protobuf.TestProtos.TestMap TestMap { - get { return testMap_; } - set { - pb::Freezable.CheckMutable(this); - testMap_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as TestMapSubmessage); - } - - public bool Equals(TestMapSubmessage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(TestMap, other.TestMap)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (testMap_ != null) hash ^= TestMap.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (testMap_ != null) { - output.WriteRawTag(10); - output.WriteMessage(TestMap); - } - } - - public int CalculateSize() { - int size = 0; - if (testMap_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TestMap); - } - return size; - } - - public void MergeFrom(TestMapSubmessage other) { - if (other == null) { - return; - } - if (other.testMap_ != null) { - if (testMap_ == null) { - testMap_ = new global::Google.Protobuf.TestProtos.TestMap(); - } - TestMap.MergeFrom(other.TestMap); - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - if (testMap_ == null) { - testMap_ = new global::Google.Protobuf.TestProtos.TestMap(); - } - input.ReadMessage(testMap_); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestMessageMap : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMessageMap()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "map_int32_message" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[2]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public TestMessageMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - public TestMessageMap(TestMessageMap other) : this() { - mapInt32Message_ = other.mapInt32Message_.Clone(); - } - - public TestMessageMap Clone() { - return new TestMessageMap(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - mapInt32Message_.Freeze(); - } - - public const int MapInt32MessageFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_mapInt32Message_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.TestAllTypes.Parser), 10); - private readonly pbc::MapField mapInt32Message_ = new pbc::MapField(); - public pbc::MapField MapInt32Message { - get { return mapInt32Message_; } - } - - public override bool Equals(object other) { - return Equals(other as TestMessageMap); - } - - public bool Equals(TestMessageMap other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!MapInt32Message.Equals(other.MapInt32Message)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - hash ^= MapInt32Message.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - mapInt32Message_.WriteTo(output, _map_mapInt32Message_codec); - } - - public int CalculateSize() { - int size = 0; - size += mapInt32Message_.CalculateSize(_map_mapInt32Message_codec); - return size; - } - - public void MergeFrom(TestMessageMap other) { - if (other == null) { - return; - } - mapInt32Message_.Add(other.mapInt32Message_); - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec); - break; - } - } - } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32MessageEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32MessageEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestMessageMap.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32MessageEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32MessageEntry(MapInt32MessageEntry other) : this() { - key_ = other.key_; - Value = other.value_ != null ? other.Value.Clone() : null; - } - - public MapInt32MessageEntry Clone() { - return new MapInt32MessageEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - if (value_ != null) Value.Freeze(); - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.TestAllTypes value_; - public global::Google.Protobuf.TestProtos.TestAllTypes Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32MessageEntry); - } - - public bool Equals(MapInt32MessageEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (!object.Equals(Value, other.Value)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); - } - return size; - } - - public void MergeFrom(MapInt32MessageEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.value_ != null) { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.TestAllTypes(); - } - Value.MergeFrom(other.Value); - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 18: { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.TestAllTypes(); - } - input.ReadMessage(value_); - break; - } - } - } - } - - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestSameTypeMap : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestSameTypeMap()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "map1", "map2" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[3]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public TestSameTypeMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - public TestSameTypeMap(TestSameTypeMap other) : this() { - map1_ = other.map1_.Clone(); - map2_ = other.map2_.Clone(); - } - - public TestSameTypeMap Clone() { - return new TestSameTypeMap(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - map1_.Freeze(); - map2_.Freeze(); - } - - public const int Map1FieldNumber = 1; - private static readonly pbc::MapField.Codec _map_map1_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); - private readonly pbc::MapField map1_ = new pbc::MapField(); - public pbc::MapField Map1 { - get { return map1_; } - } - - public const int Map2FieldNumber = 2; - private static readonly pbc::MapField.Codec _map_map2_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 18); - private readonly pbc::MapField map2_ = new pbc::MapField(); - public pbc::MapField Map2 { - get { return map2_; } - } - - public override bool Equals(object other) { - return Equals(other as TestSameTypeMap); - } - - public bool Equals(TestSameTypeMap other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!Map1.Equals(other.Map1)) return false; - if (!Map2.Equals(other.Map2)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - hash ^= Map1.GetHashCode(); - hash ^= Map2.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - map1_.WriteTo(output, _map_map1_codec); - map2_.WriteTo(output, _map_map2_codec); - } - - public int CalculateSize() { - int size = 0; - size += map1_.CalculateSize(_map_map1_codec); - size += map2_.CalculateSize(_map_map2_codec); - return size; - } - - public void MergeFrom(TestSameTypeMap other) { - if (other == null) { - return; - } - map1_.Add(other.map1_); - map2_.Add(other.map2_); - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - map1_.AddEntriesFrom(input, _map_map1_codec); - break; - } - case 18: { - map2_.AddEntriesFrom(input, _map_map2_codec); - break; - } - } - } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Map1Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Map1Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestSameTypeMap.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public Map1Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public Map1Entry(Map1Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public Map1Entry Clone() { - return new Map1Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as Map1Entry); - } - - public bool Equals(Map1Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value); - } - return size; - } - - public void MergeFrom(Map1Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - Value = input.ReadInt32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Map2Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Map2Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestSameTypeMap.Descriptor.NestedTypes[1]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public Map2Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public Map2Entry(Map2Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public Map2Entry Clone() { - return new Map2Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as Map2Entry); - } - - public bool Equals(Map2Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value); - } - return size; - } - - public void MergeFrom(Map2Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - Value = input.ReadInt32(); - break; - } - } - } - } - - } - - } - #endregion - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TestArenaMap : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestArenaMap()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "map_bool_bool", "map_fixed32_fixed32", "map_fixed64_fixed64", "map_int32_double", "map_int32_enum", "map_int32_float", "map_int32_foreign_message", "map_int32_int32", "map_int64_int64", "map_sfixed32_sfixed32", "map_sfixed64_sfixed64", "map_sint32_sint32", "map_sint64_sint64", "map_uint32_uint32", "map_uint64_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 106, 58, 66, 98, 114, 90, 122, 10, 18, 74, 82, 42, 50, 26, 34 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[4]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public TestArenaMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - public TestArenaMap(TestArenaMap other) : this() { - mapInt32Int32_ = other.mapInt32Int32_.Clone(); - mapInt64Int64_ = other.mapInt64Int64_.Clone(); - mapUint32Uint32_ = other.mapUint32Uint32_.Clone(); - mapUint64Uint64_ = other.mapUint64Uint64_.Clone(); - mapSint32Sint32_ = other.mapSint32Sint32_.Clone(); - mapSint64Sint64_ = other.mapSint64Sint64_.Clone(); - mapFixed32Fixed32_ = other.mapFixed32Fixed32_.Clone(); - mapFixed64Fixed64_ = other.mapFixed64Fixed64_.Clone(); - mapSfixed32Sfixed32_ = other.mapSfixed32Sfixed32_.Clone(); - mapSfixed64Sfixed64_ = other.mapSfixed64Sfixed64_.Clone(); - mapInt32Float_ = other.mapInt32Float_.Clone(); - mapInt32Double_ = other.mapInt32Double_.Clone(); - mapBoolBool_ = other.mapBoolBool_.Clone(); - mapInt32Enum_ = other.mapInt32Enum_.Clone(); - mapInt32ForeignMessage_ = other.mapInt32ForeignMessage_.Clone(); - } - - public TestArenaMap Clone() { - return new TestArenaMap(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - mapInt32Int32_.Freeze(); - mapInt64Int64_.Freeze(); - mapUint32Uint32_.Freeze(); - mapUint64Uint64_.Freeze(); - mapSint32Sint32_.Freeze(); - mapSint64Sint64_.Freeze(); - mapFixed32Fixed32_.Freeze(); - mapFixed64Fixed64_.Freeze(); - mapSfixed32Sfixed32_.Freeze(); - mapSfixed64Sfixed64_.Freeze(); - mapInt32Float_.Freeze(); - mapInt32Double_.Freeze(); - mapBoolBool_.Freeze(); - mapInt32Enum_.Freeze(); - mapInt32ForeignMessage_.Freeze(); - } - - public const int MapInt32Int32FieldNumber = 1; - private static readonly pbc::MapField.Codec _map_mapInt32Int32_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); - private readonly pbc::MapField mapInt32Int32_ = new pbc::MapField(); - public pbc::MapField MapInt32Int32 { - get { return mapInt32Int32_; } - } - - public const int MapInt64Int64FieldNumber = 2; - private static readonly pbc::MapField.Codec _map_mapInt64Int64_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt64(8), pb::FieldCodec.ForInt64(16), 18); - private readonly pbc::MapField mapInt64Int64_ = new pbc::MapField(); - public pbc::MapField MapInt64Int64 { - get { return mapInt64Int64_; } - } - - public const int MapUint32Uint32FieldNumber = 3; - private static readonly pbc::MapField.Codec _map_mapUint32Uint32_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForUInt32(8), pb::FieldCodec.ForUInt32(16), 26); - private readonly pbc::MapField mapUint32Uint32_ = new pbc::MapField(); - public pbc::MapField MapUint32Uint32 { - get { return mapUint32Uint32_; } - } - - public const int MapUint64Uint64FieldNumber = 4; - private static readonly pbc::MapField.Codec _map_mapUint64Uint64_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForUInt64(8), pb::FieldCodec.ForUInt64(16), 34); - private readonly pbc::MapField mapUint64Uint64_ = new pbc::MapField(); - public pbc::MapField MapUint64Uint64 { - get { return mapUint64Uint64_; } - } - - public const int MapSint32Sint32FieldNumber = 5; - private static readonly pbc::MapField.Codec _map_mapSint32Sint32_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); - private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); - public pbc::MapField MapSint32Sint32 { - get { return mapSint32Sint32_; } - } - - public const int MapSint64Sint64FieldNumber = 6; - private static readonly pbc::MapField.Codec _map_mapSint64Sint64_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); - private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); - public pbc::MapField MapSint64Sint64 { - get { return mapSint64Sint64_; } - } - - public const int MapFixed32Fixed32FieldNumber = 7; - private static readonly pbc::MapField.Codec _map_mapFixed32Fixed32_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); - private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); - public pbc::MapField MapFixed32Fixed32 { - get { return mapFixed32Fixed32_; } - } - - public const int MapFixed64Fixed64FieldNumber = 8; - private static readonly pbc::MapField.Codec _map_mapFixed64Fixed64_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); - private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); - public pbc::MapField MapFixed64Fixed64 { - get { return mapFixed64Fixed64_; } - } - - public const int MapSfixed32Sfixed32FieldNumber = 9; - private static readonly pbc::MapField.Codec _map_mapSfixed32Sfixed32_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); - private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); - public pbc::MapField MapSfixed32Sfixed32 { - get { return mapSfixed32Sfixed32_; } - } - - public const int MapSfixed64Sfixed64FieldNumber = 10; - private static readonly pbc::MapField.Codec _map_mapSfixed64Sfixed64_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); - private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); - public pbc::MapField MapSfixed64Sfixed64 { - get { return mapSfixed64Sfixed64_; } - } - - public const int MapInt32FloatFieldNumber = 11; - private static readonly pbc::MapField.Codec _map_mapInt32Float_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); - private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); - public pbc::MapField MapInt32Float { - get { return mapInt32Float_; } - } - - public const int MapInt32DoubleFieldNumber = 12; - private static readonly pbc::MapField.Codec _map_mapInt32Double_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); - private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); - public pbc::MapField MapInt32Double { - get { return mapInt32Double_; } - } - - public const int MapBoolBoolFieldNumber = 13; - private static readonly pbc::MapField.Codec _map_mapBoolBool_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); - private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); - public pbc::MapField MapBoolBool { - get { return mapBoolBool_; } - } - - public const int MapInt32EnumFieldNumber = 14; - private static readonly pbc::MapField.Codec _map_mapInt32Enum_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 114); - private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); - public pbc::MapField MapInt32Enum { - get { return mapInt32Enum_; } - } - - public const int MapInt32ForeignMessageFieldNumber = 15; - private static readonly pbc::MapField.Codec _map_mapInt32ForeignMessage_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); - private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); - public pbc::MapField MapInt32ForeignMessage { - get { return mapInt32ForeignMessage_; } - } - - public override bool Equals(object other) { - return Equals(other as TestArenaMap); - } - - public bool Equals(TestArenaMap other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!MapInt32Int32.Equals(other.MapInt32Int32)) return false; - if (!MapInt64Int64.Equals(other.MapInt64Int64)) return false; - if (!MapUint32Uint32.Equals(other.MapUint32Uint32)) return false; - if (!MapUint64Uint64.Equals(other.MapUint64Uint64)) return false; - if (!MapSint32Sint32.Equals(other.MapSint32Sint32)) return false; - if (!MapSint64Sint64.Equals(other.MapSint64Sint64)) return false; - if (!MapFixed32Fixed32.Equals(other.MapFixed32Fixed32)) return false; - if (!MapFixed64Fixed64.Equals(other.MapFixed64Fixed64)) return false; - if (!MapSfixed32Sfixed32.Equals(other.MapSfixed32Sfixed32)) return false; - if (!MapSfixed64Sfixed64.Equals(other.MapSfixed64Sfixed64)) return false; - if (!MapInt32Float.Equals(other.MapInt32Float)) return false; - if (!MapInt32Double.Equals(other.MapInt32Double)) return false; - if (!MapBoolBool.Equals(other.MapBoolBool)) return false; - if (!MapInt32Enum.Equals(other.MapInt32Enum)) return false; - if (!MapInt32ForeignMessage.Equals(other.MapInt32ForeignMessage)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - hash ^= MapInt32Int32.GetHashCode(); - hash ^= MapInt64Int64.GetHashCode(); - hash ^= MapUint32Uint32.GetHashCode(); - hash ^= MapUint64Uint64.GetHashCode(); - hash ^= MapSint32Sint32.GetHashCode(); - hash ^= MapSint64Sint64.GetHashCode(); - hash ^= MapFixed32Fixed32.GetHashCode(); - hash ^= MapFixed64Fixed64.GetHashCode(); - hash ^= MapSfixed32Sfixed32.GetHashCode(); - hash ^= MapSfixed64Sfixed64.GetHashCode(); - hash ^= MapInt32Float.GetHashCode(); - hash ^= MapInt32Double.GetHashCode(); - hash ^= MapBoolBool.GetHashCode(); - hash ^= MapInt32Enum.GetHashCode(); - hash ^= MapInt32ForeignMessage.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); - mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); - mapUint32Uint32_.WriteTo(output, _map_mapUint32Uint32_codec); - mapUint64Uint64_.WriteTo(output, _map_mapUint64Uint64_codec); - mapSint32Sint32_.WriteTo(output, _map_mapSint32Sint32_codec); - mapSint64Sint64_.WriteTo(output, _map_mapSint64Sint64_codec); - mapFixed32Fixed32_.WriteTo(output, _map_mapFixed32Fixed32_codec); - mapFixed64Fixed64_.WriteTo(output, _map_mapFixed64Fixed64_codec); - mapSfixed32Sfixed32_.WriteTo(output, _map_mapSfixed32Sfixed32_codec); - mapSfixed64Sfixed64_.WriteTo(output, _map_mapSfixed64Sfixed64_codec); - mapInt32Float_.WriteTo(output, _map_mapInt32Float_codec); - mapInt32Double_.WriteTo(output, _map_mapInt32Double_codec); - mapBoolBool_.WriteTo(output, _map_mapBoolBool_codec); - mapInt32Enum_.WriteTo(output, _map_mapInt32Enum_codec); - mapInt32ForeignMessage_.WriteTo(output, _map_mapInt32ForeignMessage_codec); - } - - public int CalculateSize() { - int size = 0; - size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); - size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); - size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); - size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); - size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); - size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); - size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); - size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); - size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); - size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); - size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); - size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); - size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); - size += mapInt32Enum_.CalculateSize(_map_mapInt32Enum_codec); - size += mapInt32ForeignMessage_.CalculateSize(_map_mapInt32ForeignMessage_codec); - return size; - } - - public void MergeFrom(TestArenaMap other) { - if (other == null) { - return; - } - mapInt32Int32_.Add(other.mapInt32Int32_); - mapInt64Int64_.Add(other.mapInt64Int64_); - mapUint32Uint32_.Add(other.mapUint32Uint32_); - mapUint64Uint64_.Add(other.mapUint64Uint64_); - mapSint32Sint32_.Add(other.mapSint32Sint32_); - mapSint64Sint64_.Add(other.mapSint64Sint64_); - mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); - mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); - mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); - mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); - mapInt32Float_.Add(other.mapInt32Float_); - mapInt32Double_.Add(other.mapInt32Double_); - mapBoolBool_.Add(other.mapBoolBool_); - mapInt32Enum_.Add(other.mapInt32Enum_); - mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_); - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); - break; - } - case 18: { - mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); - break; - } - case 26: { - mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); - break; - } - case 34: { - mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); - break; - } - case 42: { - mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); - break; - } - case 50: { - mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); - break; - } - case 58: { - mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); - break; - } - case 66: { - mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); - break; - } - case 74: { - mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); - break; - } - case 82: { - mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); - break; - } - case 90: { - mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); - break; - } - case 98: { - mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); - break; - } - case 106: { - mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); - break; - } - case 114: { - mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec); - break; - } - case 122: { - mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec); - break; - } - } - } - } - - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32Int32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32Int32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32Int32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32Int32Entry(MapInt32Int32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32Int32Entry Clone() { - return new MapInt32Int32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32Int32Entry); - } - - public bool Equals(MapInt32Int32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value); - } - return size; - } - - public void MergeFrom(MapInt32Int32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - Value = input.ReadInt32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt64Int64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt64Int64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[1]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt64Int64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt64Int64Entry(MapInt64Int64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt64Int64Entry Clone() { - return new MapInt64Int64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt64Int64Entry); - } - - public bool Equals(MapInt64Int64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(8); - output.WriteInt64(Key); - } - if (Value != 0L) { - output.WriteRawTag(16); - output.WriteInt64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Key); - } - if (Value != 0L) { - size += 1 + pb::CodedOutputStream.ComputeInt64Size(Value); - } - return size; - } - - public void MergeFrom(MapInt64Int64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt64(); - break; - } - case 16: { - Value = input.ReadInt64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapUint32Uint32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapUint32Uint32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[2]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapUint32Uint32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapUint32Uint32Entry(MapUint32Uint32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapUint32Uint32Entry Clone() { - return new MapUint32Uint32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private uint key_; - public uint Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private uint value_; - public uint Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapUint32Uint32Entry); - } - - public bool Equals(MapUint32Uint32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteUInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Value); - } - return size; - } - - public void MergeFrom(MapUint32Uint32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadUInt32(); - break; - } - case 16: { - Value = input.ReadUInt32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapUint64Uint64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapUint64Uint64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[3]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapUint64Uint64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapUint64Uint64Entry(MapUint64Uint64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapUint64Uint64Entry Clone() { - return new MapUint64Uint64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private ulong key_; - public ulong Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private ulong value_; - public ulong Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapUint64Uint64Entry); - } - - public bool Equals(MapUint64Uint64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0UL) hash ^= Key.GetHashCode(); - if (Value != 0UL) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0UL) { - output.WriteRawTag(8); - output.WriteUInt64(Key); - } - if (Value != 0UL) { - output.WriteRawTag(16); - output.WriteUInt64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Key); - } - if (Value != 0UL) { - size += 1 + pb::CodedOutputStream.ComputeUInt64Size(Value); - } - return size; - } - - public void MergeFrom(MapUint64Uint64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0UL) { - Key = other.Key; - } - if (other.Value != 0UL) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadUInt64(); - break; - } - case 16: { - Value = input.ReadUInt64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSint32Sint32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSint32Sint32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[4]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSint32Sint32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSint32Sint32Entry(MapSint32Sint32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSint32Sint32Entry Clone() { - return new MapSint32Sint32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSint32Sint32Entry); - } - - public bool Equals(MapSint32Sint32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteSInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteSInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeSInt32Size(Value); - } - return size; - } - - public void MergeFrom(MapSint32Sint32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadSInt32(); - break; - } - case 16: { - Value = input.ReadSInt32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSint64Sint64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSint64Sint64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[5]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSint64Sint64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSint64Sint64Entry(MapSint64Sint64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSint64Sint64Entry Clone() { - return new MapSint64Sint64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSint64Sint64Entry); - } - - public bool Equals(MapSint64Sint64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(8); - output.WriteSInt64(Key); - } - if (Value != 0L) { - output.WriteRawTag(16); - output.WriteSInt64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Key); - } - if (Value != 0L) { - size += 1 + pb::CodedOutputStream.ComputeSInt64Size(Value); - } - return size; - } - - public void MergeFrom(MapSint64Sint64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadSInt64(); - break; - } - case 16: { - Value = input.ReadSInt64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapFixed32Fixed32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapFixed32Fixed32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[6]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapFixed32Fixed32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapFixed32Fixed32Entry Clone() { - return new MapFixed32Fixed32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private uint key_; - public uint Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private uint value_; - public uint Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapFixed32Fixed32Entry); - } - - public bool Equals(MapFixed32Fixed32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(13); - output.WriteFixed32(Key); - } - if (Value != 0) { - output.WriteRawTag(21); - output.WriteFixed32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + 4; - } - if (Value != 0) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapFixed32Fixed32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 13: { - Key = input.ReadFixed32(); - break; - } - case 21: { - Value = input.ReadFixed32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapFixed64Fixed64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapFixed64Fixed64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[7]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapFixed64Fixed64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapFixed64Fixed64Entry Clone() { - return new MapFixed64Fixed64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private ulong key_; - public ulong Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private ulong value_; - public ulong Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapFixed64Fixed64Entry); - } - - public bool Equals(MapFixed64Fixed64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0UL) hash ^= Key.GetHashCode(); - if (Value != 0UL) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0UL) { - output.WriteRawTag(9); - output.WriteFixed64(Key); - } - if (Value != 0UL) { - output.WriteRawTag(17); - output.WriteFixed64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0UL) { - size += 1 + 8; - } - if (Value != 0UL) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapFixed64Fixed64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0UL) { - Key = other.Key; - } - if (other.Value != 0UL) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 9: { - Key = input.ReadFixed64(); - break; - } - case 17: { - Value = input.ReadFixed64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSfixed32Sfixed32Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSfixed32Sfixed32Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[8]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSfixed32Sfixed32Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSfixed32Sfixed32Entry Clone() { - return new MapSfixed32Sfixed32Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSfixed32Sfixed32Entry); - } - - public bool Equals(MapSfixed32Sfixed32Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(13); - output.WriteSFixed32(Key); - } - if (Value != 0) { - output.WriteRawTag(21); - output.WriteSFixed32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + 4; - } - if (Value != 0) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapSfixed32Sfixed32Entry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 13: { - Key = input.ReadSFixed32(); - break; - } - case 21: { - Value = input.ReadSFixed32(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapSfixed64Sfixed64Entry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapSfixed64Sfixed64Entry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[9]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapSfixed64Sfixed64Entry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapSfixed64Sfixed64Entry Clone() { - return new MapSfixed64Sfixed64Entry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private long key_; - public long Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private long value_; - public long Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapSfixed64Sfixed64Entry); - } - - public bool Equals(MapSfixed64Sfixed64Entry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0L) hash ^= Key.GetHashCode(); - if (Value != 0L) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0L) { - output.WriteRawTag(9); - output.WriteSFixed64(Key); - } - if (Value != 0L) { - output.WriteRawTag(17); - output.WriteSFixed64(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0L) { - size += 1 + 8; - } - if (Value != 0L) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapSfixed64Sfixed64Entry other) { - if (other == null) { - return; - } - if (other.Key != 0L) { - Key = other.Key; - } - if (other.Value != 0L) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 9: { - Key = input.ReadSFixed64(); - break; - } - case 17: { - Value = input.ReadSFixed64(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32FloatEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32FloatEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 21 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[10]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32FloatEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32FloatEntry(MapInt32FloatEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32FloatEntry Clone() { - return new MapInt32FloatEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private float value_; - public float Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32FloatEntry); - } - - public bool Equals(MapInt32FloatEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0F) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0F) { - size += 1 + 4; - } - return size; - } - - public void MergeFrom(MapInt32FloatEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0F) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 21: { - Value = input.ReadFloat(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32DoubleEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32DoubleEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 17 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[11]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32DoubleEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32DoubleEntry(MapInt32DoubleEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32DoubleEntry Clone() { - return new MapInt32DoubleEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private double value_; - public double Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32DoubleEntry); - } - - public bool Equals(MapInt32DoubleEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0D) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0D) { - output.WriteRawTag(17); - output.WriteDouble(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0D) { - size += 1 + 8; - } - return size; - } - - public void MergeFrom(MapInt32DoubleEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0D) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 17: { - Value = input.ReadDouble(); - break; - } - } - } - } - - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapBoolBoolEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapBoolBoolEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[12]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapBoolBoolEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapBoolBoolEntry(MapBoolBoolEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapBoolBoolEntry Clone() { - return new MapBoolBoolEntry(this); - } + public const int MapSint32Sint32FieldNumber = 5; + private static readonly pbc::MapField.Codec _map_mapSint32Sint32_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForSInt32(8), pb::FieldCodec.ForSInt32(16), 42); + private readonly pbc::MapField mapSint32Sint32_ = new pbc::MapField(); + public pbc::MapField MapSint32Sint32 { + get { return mapSint32Sint32_; } + } - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } + public const int MapSint64Sint64FieldNumber = 6; + private static readonly pbc::MapField.Codec _map_mapSint64Sint64_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForSInt64(8), pb::FieldCodec.ForSInt64(16), 50); + private readonly pbc::MapField mapSint64Sint64_ = new pbc::MapField(); + public pbc::MapField MapSint64Sint64 { + get { return mapSint64Sint64_; } + } - public const int KeyFieldNumber = 1; - private bool key_; - public bool Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } + public const int MapFixed32Fixed32FieldNumber = 7; + private static readonly pbc::MapField.Codec _map_mapFixed32Fixed32_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForFixed32(13), pb::FieldCodec.ForFixed32(21), 58); + private readonly pbc::MapField mapFixed32Fixed32_ = new pbc::MapField(); + public pbc::MapField MapFixed32Fixed32 { + get { return mapFixed32Fixed32_; } + } - public const int ValueFieldNumber = 2; - private bool value_; - public bool Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } + public const int MapFixed64Fixed64FieldNumber = 8; + private static readonly pbc::MapField.Codec _map_mapFixed64Fixed64_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForFixed64(9), pb::FieldCodec.ForFixed64(17), 66); + private readonly pbc::MapField mapFixed64Fixed64_ = new pbc::MapField(); + public pbc::MapField MapFixed64Fixed64 { + get { return mapFixed64Fixed64_; } + } - public override bool Equals(object other) { - return Equals(other as MapBoolBoolEntry); - } + public const int MapSfixed32Sfixed32FieldNumber = 9; + private static readonly pbc::MapField.Codec _map_mapSfixed32Sfixed32_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed32(13), pb::FieldCodec.ForSFixed32(21), 74); + private readonly pbc::MapField mapSfixed32Sfixed32_ = new pbc::MapField(); + public pbc::MapField MapSfixed32Sfixed32 { + get { return mapSfixed32Sfixed32_; } + } - public bool Equals(MapBoolBoolEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } + public const int MapSfixed64Sfixed64FieldNumber = 10; + private static readonly pbc::MapField.Codec _map_mapSfixed64Sfixed64_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForSFixed64(9), pb::FieldCodec.ForSFixed64(17), 82); + private readonly pbc::MapField mapSfixed64Sfixed64_ = new pbc::MapField(); + public pbc::MapField MapSfixed64Sfixed64 { + get { return mapSfixed64Sfixed64_; } + } - public override int GetHashCode() { - int hash = 1; - if (Key != false) hash ^= Key.GetHashCode(); - if (Value != false) hash ^= Value.GetHashCode(); - return hash; - } + public const int MapInt32FloatFieldNumber = 11; + private static readonly pbc::MapField.Codec _map_mapInt32Float_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForFloat(21), 90); + private readonly pbc::MapField mapInt32Float_ = new pbc::MapField(); + public pbc::MapField MapInt32Float { + get { return mapInt32Float_; } + } - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } + public const int MapInt32DoubleFieldNumber = 12; + private static readonly pbc::MapField.Codec _map_mapInt32Double_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForDouble(17), 98); + private readonly pbc::MapField mapInt32Double_ = new pbc::MapField(); + public pbc::MapField MapInt32Double { + get { return mapInt32Double_; } + } - public void WriteTo(pb::CodedOutputStream output) { - if (Key != false) { - output.WriteRawTag(8); - output.WriteBool(Key); - } - if (Value != false) { - output.WriteRawTag(16); - output.WriteBool(Value); - } - } + public const int MapBoolBoolFieldNumber = 13; + private static readonly pbc::MapField.Codec _map_mapBoolBool_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForBool(8), pb::FieldCodec.ForBool(16), 106); + private readonly pbc::MapField mapBoolBool_ = new pbc::MapField(); + public pbc::MapField MapBoolBool { + get { return mapBoolBool_; } + } - public int CalculateSize() { - int size = 0; - if (Key != false) { - size += 1 + 1; - } - if (Value != false) { - size += 1 + 1; - } - return size; - } + public const int MapInt32EnumFieldNumber = 14; + private static readonly pbc::MapField.Codec _map_mapInt32Enum_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::Google.Protobuf.TestProtos.MapEnum) x), 114); + private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); + public pbc::MapField MapInt32Enum { + get { return mapInt32Enum_; } + } - public void MergeFrom(MapBoolBoolEntry other) { - if (other == null) { - return; - } - if (other.Key != false) { - Key = other.Key; - } - if (other.Value != false) { - Value = other.Value; - } - } + public const int MapInt32ForeignMessageFieldNumber = 15; + private static readonly pbc::MapField.Codec _map_mapInt32ForeignMessage_codec + = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.ForeignMessage.Parser), 122); + private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); + public pbc::MapField MapInt32ForeignMessage { + get { return mapInt32ForeignMessage_; } + } - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadBool(); - break; - } - case 16: { - Value = input.ReadBool(); - break; - } - } - } - } + public override bool Equals(object other) { + return Equals(other as TestArenaMap); + } + public bool Equals(TestArenaMap other) { + if (ReferenceEquals(other, null)) { + return false; } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32EnumEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32EnumEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[13]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public MapInt32EnumEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public MapInt32EnumEntry(MapInt32EnumEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public MapInt32EnumEntry Clone() { - return new MapInt32EnumEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.MapEnum value_ = global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO; - public global::Google.Protobuf.TestProtos.MapEnum Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32EnumEntry); - } - - public bool Equals(MapInt32EnumEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - output.WriteRawTag(16); - output.WriteEnum((int) Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Value); - } - return size; - } - - public void MergeFrom(MapInt32EnumEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != global::Google.Protobuf.TestProtos.MapEnum.MAP_ENUM_FOO) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - value_ = (global::Google.Protobuf.TestProtos.MapEnum) input.ReadEnum(); - break; - } - } - } - } - + if (ReferenceEquals(other, this)) { + return true; } + if (!MapInt32Int32.Equals(other.MapInt32Int32)) return false; + if (!MapInt64Int64.Equals(other.MapInt64Int64)) return false; + if (!MapUint32Uint32.Equals(other.MapUint32Uint32)) return false; + if (!MapUint64Uint64.Equals(other.MapUint64Uint64)) return false; + if (!MapSint32Sint32.Equals(other.MapSint32Sint32)) return false; + if (!MapSint64Sint64.Equals(other.MapSint64Sint64)) return false; + if (!MapFixed32Fixed32.Equals(other.MapFixed32Fixed32)) return false; + if (!MapFixed64Fixed64.Equals(other.MapFixed64Fixed64)) return false; + if (!MapSfixed32Sfixed32.Equals(other.MapSfixed32Sfixed32)) return false; + if (!MapSfixed64Sfixed64.Equals(other.MapSfixed64Sfixed64)) return false; + if (!MapInt32Float.Equals(other.MapInt32Float)) return false; + if (!MapInt32Double.Equals(other.MapInt32Double)) return false; + if (!MapBoolBool.Equals(other.MapBoolBool)) return false; + if (!MapInt32Enum.Equals(other.MapInt32Enum)) return false; + if (!MapInt32ForeignMessage.Equals(other.MapInt32ForeignMessage)) return false; + return true; + } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MapInt32ForeignMessageEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapInt32ForeignMessageEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[14]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } + public override int GetHashCode() { + int hash = 1; + hash ^= MapInt32Int32.GetHashCode(); + hash ^= MapInt64Int64.GetHashCode(); + hash ^= MapUint32Uint32.GetHashCode(); + hash ^= MapUint64Uint64.GetHashCode(); + hash ^= MapSint32Sint32.GetHashCode(); + hash ^= MapSint64Sint64.GetHashCode(); + hash ^= MapFixed32Fixed32.GetHashCode(); + hash ^= MapFixed64Fixed64.GetHashCode(); + hash ^= MapSfixed32Sfixed32.GetHashCode(); + hash ^= MapSfixed64Sfixed64.GetHashCode(); + hash ^= MapInt32Float.GetHashCode(); + hash ^= MapInt32Double.GetHashCode(); + hash ^= MapBoolBool.GetHashCode(); + hash ^= MapInt32Enum.GetHashCode(); + hash ^= MapInt32ForeignMessage.GetHashCode(); + return hash; + } - public MapInt32ForeignMessageEntry() { - OnConstruction(); - } + public override string ToString() { + return pb::JsonFormatter.Default.Format(this); + } - partial void OnConstruction(); + public void WriteTo(pb::CodedOutputStream output) { + mapInt32Int32_.WriteTo(output, _map_mapInt32Int32_codec); + mapInt64Int64_.WriteTo(output, _map_mapInt64Int64_codec); + mapUint32Uint32_.WriteTo(output, _map_mapUint32Uint32_codec); + mapUint64Uint64_.WriteTo(output, _map_mapUint64Uint64_codec); + mapSint32Sint32_.WriteTo(output, _map_mapSint32Sint32_codec); + mapSint64Sint64_.WriteTo(output, _map_mapSint64Sint64_codec); + mapFixed32Fixed32_.WriteTo(output, _map_mapFixed32Fixed32_codec); + mapFixed64Fixed64_.WriteTo(output, _map_mapFixed64Fixed64_codec); + mapSfixed32Sfixed32_.WriteTo(output, _map_mapSfixed32Sfixed32_codec); + mapSfixed64Sfixed64_.WriteTo(output, _map_mapSfixed64Sfixed64_codec); + mapInt32Float_.WriteTo(output, _map_mapInt32Float_codec); + mapInt32Double_.WriteTo(output, _map_mapInt32Double_codec); + mapBoolBool_.WriteTo(output, _map_mapBoolBool_codec); + mapInt32Enum_.WriteTo(output, _map_mapInt32Enum_codec); + mapInt32ForeignMessage_.WriteTo(output, _map_mapInt32ForeignMessage_codec); + } - public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) : this() { - key_ = other.key_; - Value = other.value_ != null ? other.Value.Clone() : null; - } + public int CalculateSize() { + int size = 0; + size += mapInt32Int32_.CalculateSize(_map_mapInt32Int32_codec); + size += mapInt64Int64_.CalculateSize(_map_mapInt64Int64_codec); + size += mapUint32Uint32_.CalculateSize(_map_mapUint32Uint32_codec); + size += mapUint64Uint64_.CalculateSize(_map_mapUint64Uint64_codec); + size += mapSint32Sint32_.CalculateSize(_map_mapSint32Sint32_codec); + size += mapSint64Sint64_.CalculateSize(_map_mapSint64Sint64_codec); + size += mapFixed32Fixed32_.CalculateSize(_map_mapFixed32Fixed32_codec); + size += mapFixed64Fixed64_.CalculateSize(_map_mapFixed64Fixed64_codec); + size += mapSfixed32Sfixed32_.CalculateSize(_map_mapSfixed32Sfixed32_codec); + size += mapSfixed64Sfixed64_.CalculateSize(_map_mapSfixed64Sfixed64_codec); + size += mapInt32Float_.CalculateSize(_map_mapInt32Float_codec); + size += mapInt32Double_.CalculateSize(_map_mapInt32Double_codec); + size += mapBoolBool_.CalculateSize(_map_mapBoolBool_codec); + size += mapInt32Enum_.CalculateSize(_map_mapInt32Enum_codec); + size += mapInt32ForeignMessage_.CalculateSize(_map_mapInt32ForeignMessage_codec); + return size; + } - public MapInt32ForeignMessageEntry Clone() { - return new MapInt32ForeignMessageEntry(this); - } + public void MergeFrom(TestArenaMap other) { + if (other == null) { + return; + } + mapInt32Int32_.Add(other.mapInt32Int32_); + mapInt64Int64_.Add(other.mapInt64Int64_); + mapUint32Uint32_.Add(other.mapUint32Uint32_); + mapUint64Uint64_.Add(other.mapUint64Uint64_); + mapSint32Sint32_.Add(other.mapSint32Sint32_); + mapSint64Sint64_.Add(other.mapSint64Sint64_); + mapFixed32Fixed32_.Add(other.mapFixed32Fixed32_); + mapFixed64Fixed64_.Add(other.mapFixed64Fixed64_); + mapSfixed32Sfixed32_.Add(other.mapSfixed32Sfixed32_); + mapSfixed64Sfixed64_.Add(other.mapSfixed64Sfixed64_); + mapInt32Float_.Add(other.mapInt32Float_); + mapInt32Double_.Add(other.mapInt32Double_); + mapBoolBool_.Add(other.mapBoolBool_); + mapInt32Enum_.Add(other.mapInt32Enum_); + mapInt32ForeignMessage_.Add(other.mapInt32ForeignMessage_); + } - public void Freeze() { - if (IsFrozen) { - return; + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while (input.ReadTag(out tag)) { + switch(tag) { + case 0: + throw pb::InvalidProtocolBufferException.InvalidTag(); + default: + if (pb::WireFormat.IsEndGroupTag(tag)) { + return; + } + break; + case 10: { + mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec); + break; } - _frozen = true; - if (value_ != null) Value.Freeze(); - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; + case 18: { + mapInt64Int64_.AddEntriesFrom(input, _map_mapInt64Int64_codec); + break; } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.ForeignMessage value_; - public global::Google.Protobuf.TestProtos.ForeignMessage Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; + case 26: { + mapUint32Uint32_.AddEntriesFrom(input, _map_mapUint32Uint32_codec); + break; } - } - - public override bool Equals(object other) { - return Equals(other as MapInt32ForeignMessageEntry); - } - - public bool Equals(MapInt32ForeignMessageEntry other) { - if (ReferenceEquals(other, null)) { - return false; + case 34: { + mapUint64Uint64_.AddEntriesFrom(input, _map_mapUint64Uint64_codec); + break; } - if (ReferenceEquals(other, this)) { - return true; + case 42: { + mapSint32Sint32_.AddEntriesFrom(input, _map_mapSint32Sint32_codec); + break; } - if (Key != other.Key) return false; - if (!object.Equals(Value, other.Value)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); + case 50: { + mapSint64Sint64_.AddEntriesFrom(input, _map_mapSint64Sint64_codec); + break; } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Value); + case 58: { + mapFixed32Fixed32_.AddEntriesFrom(input, _map_mapFixed32Fixed32_codec); + break; } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); + case 66: { + mapFixed64Fixed64_.AddEntriesFrom(input, _map_mapFixed64Fixed64_codec); + break; } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); + case 74: { + mapSfixed32Sfixed32_.AddEntriesFrom(input, _map_mapSfixed32Sfixed32_codec); + break; } - return size; - } - - public void MergeFrom(MapInt32ForeignMessageEntry other) { - if (other == null) { - return; + case 82: { + mapSfixed64Sfixed64_.AddEntriesFrom(input, _map_mapSfixed64Sfixed64_codec); + break; } - if (other.Key != 0) { - Key = other.Key; + case 90: { + mapInt32Float_.AddEntriesFrom(input, _map_mapInt32Float_codec); + break; } - if (other.value_ != null) { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.ForeignMessage(); - } - Value.MergeFrom(other.Value); + case 98: { + mapInt32Double_.AddEntriesFrom(input, _map_mapInt32Double_codec); + break; } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 18: { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.ForeignMessage(); - } - input.ReadMessage(value_); - break; - } - } + case 106: { + mapBoolBool_.AddEntriesFrom(input, _map_mapBoolBool_codec); + break; + } + case 114: { + mapInt32Enum_.AddEntriesFrom(input, _map_mapInt32Enum_codec); + break; + } + case 122: { + mapInt32ForeignMessage_.AddEntriesFrom(input, _map_mapInt32ForeignMessage_codec); + break; } } - } - } - #endregion } @@ -6771,159 +1468,6 @@ namespace Google.Protobuf.TestProtos { TYPE_FOO = 0, } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class TypeEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TypeEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public TypeEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public TypeEntry(TypeEntry other) : this() { - key_ = other.key_; - Value = other.value_ != null ? other.Value.Clone() : null; - } - - public TypeEntry Clone() { - return new TypeEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - if (value_ != null) Value.Freeze(); - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType value_; - public global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as TypeEntry); - } - - public bool Equals(TypeEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (!object.Equals(Value, other.Value)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); - } - return size; - } - - public void MergeFrom(TypeEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.value_ != null) { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType(); - } - Value.MergeFrom(other.Value); - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 18: { - if (value_ == null) { - value_ = new global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType(); - } - input.ReadMessage(value_); - break; - } - } - } - } - - } - } #endregion @@ -7038,158 +1582,6 @@ namespace Google.Protobuf.TestProtos { } } - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EntryEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EntryEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public EntryEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public EntryEntry(EntryEntry other) : this() { - key_ = other.key_; - value_ = other.value_; - } - - public EntryEntry Clone() { - return new EntryEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - } - - public const int KeyFieldNumber = 1; - private int key_; - public int Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value; - } - } - - public const int ValueFieldNumber = 2; - private int value_; - public int Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as EntryEntry); - } - - public bool Equals(EntryEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key != 0) hash ^= Key.GetHashCode(); - if (Value != 0) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key != 0) { - output.WriteRawTag(8); - output.WriteInt32(Key); - } - if (Value != 0) { - output.WriteRawTag(16); - output.WriteInt32(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Key); - } - if (Value != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Value); - } - return size; - } - - public void MergeFrom(EntryEntry other) { - if (other == null) { - return; - } - if (other.Key != 0) { - Key = other.Key; - } - if (other.Value != 0) { - Value = other.Value; - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 8: { - Key = input.ReadInt32(); - break; - } - case 16: { - Value = input.ReadInt32(); - break; - } - } - } - } - - } - - } - #endregion - } #endregion diff --git a/csharp/src/ProtocolBuffers/WellKnownTypes/Struct.cs b/csharp/src/ProtocolBuffers/WellKnownTypes/Struct.cs index 98cb8138..99f88a96 100644 --- a/csharp/src/ProtocolBuffers/WellKnownTypes/Struct.cs +++ b/csharp/src/ProtocolBuffers/WellKnownTypes/Struct.cs @@ -16,7 +16,6 @@ namespace Google.Protobuf.WellKnownTypes { #region Static variables internal static pbr::FieldAccessorTable internal__static_google_protobuf_Struct__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Struct_FieldsEntry__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_google_protobuf_Value__FieldAccessorTable; internal static pbr::FieldAccessorTable internal__static_google_protobuf_ListValue__FieldAccessorTable; #endregion @@ -49,9 +48,6 @@ namespace Google.Protobuf.WellKnownTypes { internal__static_google_protobuf_Struct__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Struct), descriptor.MessageTypes[0], new string[] { "Fields", }, new string[] { }); - internal__static_google_protobuf_Struct_FieldsEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Struct.Types.FieldsEntry), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { "Key", "Value", }, new string[] { }); internal__static_google_protobuf_Value__FieldAccessorTable = new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Value), descriptor.MessageTypes[1], new string[] { "NullValue", "NumberValue", "StringValue", "BoolValue", "StructValue", "ListValue", }, new string[] { "Kind", }); @@ -180,165 +176,6 @@ namespace Google.Protobuf.WellKnownTypes { } } - #region Nested types - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class Types { - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldsEntry : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldsEntry()); - public static pb::MessageParser Parser { get { return _parser; } } - - private static readonly string[] _fieldNames = new string[] { "key", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; - public static pbr::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.WellKnownTypes.Struct.Descriptor.NestedTypes[0]; } - } - - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.internal__static_google_protobuf_Struct_FieldsEntry__FieldAccessorTable; } - } - - private bool _frozen = false; - public bool IsFrozen { get { return _frozen; } } - - public FieldsEntry() { - OnConstruction(); - } - - partial void OnConstruction(); - - public FieldsEntry(FieldsEntry other) : this() { - key_ = other.key_; - Value = other.value_ != null ? other.Value.Clone() : null; - } - - public FieldsEntry Clone() { - return new FieldsEntry(this); - } - - public void Freeze() { - if (IsFrozen) { - return; - } - _frozen = true; - if (value_ != null) Value.Freeze(); - } - - public const int KeyFieldNumber = 1; - private string key_ = ""; - public string Key { - get { return key_; } - set { - pb::Freezable.CheckMutable(this); - key_ = value ?? ""; - } - } - - public const int ValueFieldNumber = 2; - private global::Google.Protobuf.WellKnownTypes.Value value_; - public global::Google.Protobuf.WellKnownTypes.Value Value { - get { return value_; } - set { - pb::Freezable.CheckMutable(this); - value_ = value; - } - } - - public override bool Equals(object other) { - return Equals(other as FieldsEntry); - } - - public bool Equals(FieldsEntry other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (!object.Equals(Value, other.Value)) return false; - return true; - } - - public override int GetHashCode() { - int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (value_ != null) hash ^= Value.GetHashCode(); - return hash; - } - - public override string ToString() { - return pb::JsonFormatter.Default.Format(this); - } - - public void WriteTo(pb::CodedOutputStream output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (value_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Value); - } - } - - public int CalculateSize() { - int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (value_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Value); - } - return size; - } - - public void MergeFrom(FieldsEntry other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.value_ != null) { - if (value_ == null) { - value_ = new global::Google.Protobuf.WellKnownTypes.Value(); - } - Value.MergeFrom(other.Value); - } - } - - public void MergeFrom(pb::CodedInputStream input) { - uint tag; - while (input.ReadTag(out tag)) { - switch(tag) { - case 0: - throw pb::InvalidProtocolBufferException.InvalidTag(); - default: - if (pb::WireFormat.IsEndGroupTag(tag)) { - return; - } - break; - case 10: { - Key = input.ReadString(); - break; - } - case 18: { - if (value_ == null) { - value_ = new global::Google.Protobuf.WellKnownTypes.Value(); - } - input.ReadMessage(value_); - break; - } - } - } - } - - } - - } - #endregion - } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h index bd3d6e7d..a7c2395b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h @@ -105,6 +105,12 @@ uint FixedMakeTag(const FieldDescriptor* descriptor); FieldGeneratorBase* CreateFieldGenerator(const FieldDescriptor* descriptor, int fieldOrdinal); +// Determines whether the given message is a map entry message, i.e. one implicitly created +// by protoc due to a map field. +inline bool IsMapEntryMessage(const Descriptor* descriptor) { + return descriptor->options().map_entry(); +} + // Determines whether we're generating code for the proto representation of descriptors etc, // for use in the runtime. This is the only type which is allowed to use proto2 syntax, // and it generates internal classes. diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 4acc899b..5a72b2e7 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -121,6 +121,9 @@ void MessageGenerator::GenerateStaticVariables(io::Printer* printer) { "full_class_name", full_class_name()); for (int i = 0; i < descriptor_->nested_type_count(); i++) { + // Don't generate accessor table fields for maps... + if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; + MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.GenerateStaticVariables(printer); } @@ -159,8 +162,10 @@ void MessageGenerator::GenerateStaticVariableInitializers(io::Printer* printer) } printer->Print("});\n"); - // Generate static member initializers for all nested types. + // Generate static member initializers for all non-map-entry nested types. for (int i = 0; i < descriptor_->nested_type_count(); i++) { + if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; + MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.GenerateStaticVariableInitializers(printer); } @@ -285,7 +290,7 @@ void MessageGenerator::Generate(io::Printer* printer) { GenerateMergingMethods(printer); // Nested messages and enums - if (descriptor_->enum_type_count() + descriptor_->nested_type_count() > 0) { + if (HasNestedGeneratedTypes()) { printer->Print("#region Nested types\n" "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); WriteGeneratedCodeAttributes(printer); @@ -296,6 +301,9 @@ void MessageGenerator::Generate(io::Printer* printer) { enumGenerator.Generate(printer); } for (int i = 0; i < descriptor_->nested_type_count(); i++) { + // Don't generate nested types for maps... + if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; + MessageGenerator messageGenerator(descriptor_->nested_type(i)); messageGenerator.Generate(printer); } @@ -310,6 +318,21 @@ void MessageGenerator::Generate(io::Printer* printer) { printer->Print("\n"); } +// Helper to work out whether we need to generate a class to hold nested types/enums. +// Only tricky because we don't want to generate map entry types. +bool MessageGenerator::HasNestedGeneratedTypes() +{ + if (descriptor_->enum_type_count() > 0) { + return true; + } + for (int i = 0; i < descriptor_->nested_type_count(); i++) { + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + return true; + } + } + return false; +} + void MessageGenerator::GenerateCloningCode(io::Printer* printer) { map vars; vars["class_name"] = class_name(); diff --git a/src/google/protobuf/compiler/csharp/csharp_message.h b/src/google/protobuf/compiler/csharp/csharp_message.h index 6c7153aa..fbe8a3be 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.h +++ b/src/google/protobuf/compiler/csharp/csharp_message.h @@ -69,6 +69,8 @@ class MessageGenerator : public SourceGeneratorBase { FieldGeneratorBase* CreateFieldGeneratorInternal( const FieldDescriptor* descriptor); + bool HasNestedGeneratedTypes(); + std::string class_name(); std::string full_class_name(); -- cgit v1.2.3 From db52c9dd585da7d5c9063409117b8a5680e384db Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 15 Jul 2015 22:03:38 +0100 Subject: Address requested change from code review. --- .../protobuf/compiler/csharp/csharp_message.cc | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 5a72b2e7..79b762d1 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -122,10 +122,10 @@ void MessageGenerator::GenerateStaticVariables(io::Printer* printer) { for (int i = 0; i < descriptor_->nested_type_count(); i++) { // Don't generate accessor table fields for maps... - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariables(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.GenerateStaticVariables(printer); + } } } @@ -164,10 +164,10 @@ void MessageGenerator::GenerateStaticVariableInitializers(io::Printer* printer) // Generate static member initializers for all non-map-entry nested types. for (int i = 0; i < descriptor_->nested_type_count(); i++) { - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariableInitializers(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.GenerateStaticVariableInitializers(printer); + } } } @@ -302,10 +302,10 @@ void MessageGenerator::Generate(io::Printer* printer) { } for (int i = 0; i < descriptor_->nested_type_count(); i++) { // Don't generate nested types for maps... - if (IsMapEntryMessage(descriptor_->nested_type(i))) continue; - - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.Generate(printer); + if (!IsMapEntryMessage(descriptor_->nested_type(i))) { + MessageGenerator messageGenerator(descriptor_->nested_type(i)); + messageGenerator.Generate(printer); + } } printer->Outdent(); printer->Print("}\n" -- cgit v1.2.3