From 53c399a1d65df65e9f83a70b55041a01cf8d7489 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Mon, 20 Jul 2015 19:24:31 +0100 Subject: [PATCH 1/8] Revamp to reflection. Changes in brief: 1. Descriptor is now the entry point for all reflection. 2. IReflectedMessage has gone; there's now a Descriptor property in IMessage, which is explicitly implemented (due to the static property). 3. FieldAccessorTable has gone away 4. IFieldAccessor and OneofFieldAccessor still exist; we *could* put the functionality straight into FieldDescriptor and OneofDescriptor... I'm unsure about that. 5. There's a temporary property MessageDescriptor.FieldAccessorsByFieldNumber to make the test changes small - we probably want this to go away 6. Discovery for delegates is now via attributes applied to properties and the Clear method of a oneof I'm happy with 1-3. 4 I'm unsure about - feedback welcome. 5 will go away 6 I'm unsure about, both in design and implementation. Should we have a ProtobufMessageAttribute too? Should we find all the relevant attributes in MessageDescriptor and pass them down, to avoid an O(N^2) scenario? Generated code changes coming in the next commit. --- .../GeneratedMessageTest.cs | 47 ++++----- .../Reflection/DescriptorsTest.cs | 1 + .../WellKnownTypes/WrappersTest.cs | 6 +- .../Google.Protobuf/Collections/MapField.cs | 3 + .../Google.Protobuf/Google.Protobuf.csproj | 3 +- csharp/src/Google.Protobuf/IMessage.cs | 18 ++-- csharp/src/Google.Protobuf/JsonFormatter.cs | 26 ++--- .../Reflection/DescriptorUtil.cs | 5 +- .../Reflection/EnumDescriptor.cs | 10 +- .../Reflection/FieldAccessorBase.cs | 7 +- .../Reflection/FieldAccessorTable.cs | 97 ------------------- .../Reflection/FieldDescriptor.cs | 28 ++++++ .../Reflection/FileDescriptor.cs | 36 +++++-- .../Reflection/MapFieldAccessor.cs | 3 +- .../Reflection/MessageDescriptor.cs | 34 ++++++- .../Reflection/OneofAccessor.cs | 10 +- .../Reflection/OneofDescriptor.cs | 34 +++++++ .../Reflection/ProtobufFieldAttribute.cs | 58 +++++++++++ .../Reflection/ProtobufOneofAttribute.cs | 52 ++++++++++ .../Reflection/ReflectionUtil.cs | 20 ++++ .../Reflection/RepeatedFieldAccessor.cs | 3 +- .../Reflection/SingleFieldAccessor.cs | 5 +- .../compiler/csharp/csharp_field_base.cc | 2 +- .../protobuf/compiler/csharp/csharp_helpers.h | 6 +- .../compiler/csharp/csharp_map_field.cc | 1 + .../compiler/csharp/csharp_message.cc | 84 +--------------- .../protobuf/compiler/csharp/csharp_message.h | 2 - .../compiler/csharp/csharp_message_field.cc | 2 + .../compiler/csharp/csharp_primitive_field.cc | 2 + .../csharp/csharp_repeated_enum_field.cc | 3 +- .../csharp/csharp_repeated_message_field.cc | 1 + .../csharp/csharp_repeated_primitive_field.cc | 1 + .../compiler/csharp/csharp_umbrella_class.cc | 37 ++++--- .../compiler/csharp/csharp_umbrella_class.h | 1 + .../compiler/csharp/csharp_wrapper_field.cc | 2 + 35 files changed, 372 insertions(+), 278 deletions(-) delete mode 100644 csharp/src/Google.Protobuf/Reflection/FieldAccessorTable.cs create mode 100644 csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs create mode 100644 csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs index acb20b15..180976d1 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs @@ -604,7 +604,7 @@ namespace Google.Protobuf public void Reflection_GetValue() { var message = SampleMessages.CreateFullTestAllTypes(); - var fields = ((IReflectedMessage) message).Fields; + var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber; Assert.AreEqual(message.SingleBool, fields[TestAllTypes.SingleBoolFieldNumber].GetValue(message)); Assert.AreEqual(message.SingleBytes, fields[TestAllTypes.SingleBytesFieldNumber].GetValue(message)); Assert.AreEqual(message.SingleDouble, fields[TestAllTypes.SingleDoubleFieldNumber].GetValue(message)); @@ -639,7 +639,7 @@ namespace Google.Protobuf // Just a single map field, for the same reason var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } }; - fields = ((IReflectedMessage) mapMessage).Fields; + fields = TestMap.Descriptor.FieldAccessorsByFieldNumber; var dictionary = (IDictionary) fields[TestMap.MapStringStringFieldNumber].GetValue(mapMessage); Assert.AreEqual(mapMessage.MapStringString, dictionary); Assert.AreEqual("value1", dictionary["key1"]); @@ -648,8 +648,8 @@ namespace Google.Protobuf [Test] public void Reflection_Clear() { - IReflectedMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Fields; + var message = SampleMessages.CreateFullTestAllTypes(); + var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber; fields[TestAllTypes.SingleBoolFieldNumber].Clear(message); fields[TestAllTypes.SingleInt32FieldNumber].Clear(message); fields[TestAllTypes.SingleStringFieldNumber].Clear(message); @@ -673,7 +673,7 @@ namespace Google.Protobuf // Separately, maps. var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } }; - fields = ((IReflectedMessage) mapMessage).Fields; + fields = TestMap.Descriptor.FieldAccessorsByFieldNumber; fields[TestMap.MapStringStringFieldNumber].Clear(mapMessage); Assert.AreEqual(0, mapMessage.MapStringString.Count); } @@ -682,8 +682,8 @@ namespace Google.Protobuf public void Reflection_SetValue_SingleFields() { // Just a sample (primitives, messages, enums, strings, byte strings) - IReflectedMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Fields; + var message = SampleMessages.CreateFullTestAllTypes(); + var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber; fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, false); fields[TestAllTypes.SingleInt32FieldNumber].SetValue(message, 500); fields[TestAllTypes.SingleStringFieldNumber].SetValue(message, "It's a string"); @@ -709,51 +709,52 @@ namespace Google.Protobuf [Test] public void Reflection_SetValue_SingleFields_WrongType() { - IReflectedMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Fields; + IMessage message = SampleMessages.CreateFullTestAllTypes(); + var fields = message.Descriptor.FieldAccessorsByFieldNumber; Assert.Throws(() => fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, "This isn't a bool")); } [Test] public void Reflection_SetValue_MapFields() { - IReflectedMessage message = new TestMap(); - var fields = message.Fields; + IMessage message = new TestMap(); + var fields = message.Descriptor.FieldAccessorsByFieldNumber; Assert.Throws(() => fields[TestMap.MapStringStringFieldNumber].SetValue(message, new Dictionary())); } [Test] public void Reflection_SetValue_RepeatedFields() { - IReflectedMessage message = SampleMessages.CreateFullTestAllTypes(); - var fields = message.Fields; + IMessage message = SampleMessages.CreateFullTestAllTypes(); + var fields = message.Descriptor.FieldAccessorsByFieldNumber; Assert.Throws(() => fields[TestAllTypes.RepeatedDoubleFieldNumber].SetValue(message, new double[10])); } [Test] public void Reflection_GetValue_IncorrectType() { - IReflectedMessage message = SampleMessages.CreateFullTestAllTypes(); - Assert.Throws(() => message.Fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap())); + IMessage message = SampleMessages.CreateFullTestAllTypes(); + var fields = message.Descriptor.FieldAccessorsByFieldNumber; + Assert.Throws(() => fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap())); } [Test] public void Reflection_Oneof() { var message = new TestAllTypes(); - var fields = ((IReflectedMessage) message).Fields; - Assert.AreEqual(1, fields.Oneofs.Count); - var oneof = fields.Oneofs[0]; - Assert.AreEqual("oneof_field", oneof.Descriptor.Name); - Assert.IsNull(oneof.GetCaseFieldDescriptor(message)); + var descriptor = TestAllTypes.Descriptor; + Assert.AreEqual(1, descriptor.Oneofs.Count); + var oneof = descriptor.Oneofs[0]; + Assert.AreEqual("oneof_field", oneof.Name); + Assert.IsNull(oneof.Accessor.GetCaseFieldDescriptor(message)); message.OneofString = "foo"; - Assert.AreSame(fields[TestAllTypes.OneofStringFieldNumber].Descriptor, oneof.GetCaseFieldDescriptor(message)); + Assert.AreSame(descriptor.FieldAccessorsByFieldNumber[TestAllTypes.OneofStringFieldNumber].Descriptor, oneof.Accessor.GetCaseFieldDescriptor(message)); message.OneofUint32 = 10; - Assert.AreSame(fields[TestAllTypes.OneofUint32FieldNumber].Descriptor, oneof.GetCaseFieldDescriptor(message)); + Assert.AreSame(descriptor.FieldAccessorsByFieldNumber[TestAllTypes.OneofUint32FieldNumber].Descriptor, oneof.Accessor.GetCaseFieldDescriptor(message)); - oneof.Clear(message); + oneof.Accessor.Clear(message); Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase); } } diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs index 0db01a5e..0aff0a6c 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs @@ -62,6 +62,7 @@ namespace Google.Protobuf.Reflection Assert.AreEqual(UnittestImportProto3.Descriptor, file.Dependencies[0]); MessageDescriptor messageType = TestAllTypes.Descriptor; + Assert.AreSame(typeof(TestAllTypes), messageType.GeneratedType); Assert.AreEqual(messageType, file.MessageTypes[0]); Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); Assert.Null(file.FindTypeByName("NoSuchType")); diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs index ad88c4eb..c617db36 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs @@ -192,7 +192,7 @@ namespace Google.Protobuf.WellKnownTypes Uint32Field = 3, Uint64Field = 4 }; - var fields = ((IReflectedMessage) message).Fields; + var fields = TestWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; Assert.AreEqual("x", fields[TestWellKnownTypes.StringFieldFieldNumber].GetValue(message)); Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), fields[TestWellKnownTypes.BytesFieldFieldNumber].GetValue(message)); @@ -216,7 +216,7 @@ namespace Google.Protobuf.WellKnownTypes { // Just a single example... note that we can't have a null value here var message = new RepeatedWellKnownTypes { Int32Field = { 1, 2 } }; - var fields = ((IReflectedMessage) message).Fields; + var fields = RepeatedWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; var list = (IList) fields[RepeatedWellKnownTypes.Int32FieldFieldNumber].GetValue(message); CollectionAssert.AreEqual(new[] { 1, 2 }, list); } @@ -226,7 +226,7 @@ namespace Google.Protobuf.WellKnownTypes { // Just a single example... note that we can't have a null value here var message = new MapWellKnownTypes { Int32Field = { { 1, 2 }, { 3, null } } }; - var fields = ((IReflectedMessage) message).Fields; + var fields = MapWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; var dictionary = (IDictionary) fields[MapWellKnownTypes.Int32FieldFieldNumber].GetValue(message); Assert.AreEqual(2, dictionary[1]); Assert.IsNull(dictionary[3]); diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index f5e4fd3a..9ca5104d 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -30,6 +30,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using Google.Protobuf.Reflection; using System; using System.Collections; using System.Collections.Generic; @@ -559,6 +560,8 @@ namespace Google.Protobuf.Collections { return codec.keyCodec.CalculateSizeWithTag(Key) + codec.valueCodec.CalculateSizeWithTag(Value); } + + MessageDescriptor IMessage.Descriptor { get { return null; } } } } } diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 431668fe..50756299 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -78,7 +78,6 @@ - @@ -91,6 +90,8 @@ + + diff --git a/csharp/src/Google.Protobuf/IMessage.cs b/csharp/src/Google.Protobuf/IMessage.cs index 8c4a4aaf..d179c386 100644 --- a/csharp/src/Google.Protobuf/IMessage.cs +++ b/csharp/src/Google.Protobuf/IMessage.cs @@ -39,15 +39,6 @@ namespace Google.Protobuf // TODO(jonskeet): Do we want a "weak" (non-generic) version of IReflectedMessage? // TODO(jonskeet): Split these interfaces into separate files when we're happy with them. - /// - /// Reflection support for accessing field values. - /// - public interface IReflectedMessage : IMessage - { - FieldAccessorTable Fields { get; } - // TODO(jonskeet): Descriptor? Or a single property which has "all you need for reflection"? - } - /// /// Interface for a Protocol Buffers message, supporting /// basic operations required for serialization. @@ -73,6 +64,13 @@ namespace Google.Protobuf /// The number of bytes required to write this message /// to a coded output stream. int CalculateSize(); + + /// + /// Descriptor for this message. All instances are expected to return the same descriptor, + /// and for generated types this will be an explicitly-implemented member, returning the + /// same value as the static property declared on the type. + /// + MessageDescriptor Descriptor { get; } } /// @@ -81,7 +79,7 @@ namespace Google.Protobuf /// the implementation class. /// /// The message type. - public interface IMessage : IReflectedMessage, IEquatable, IDeepCloneable, IFreezable where T : IMessage + public interface IMessage : IMessage, IEquatable, IDeepCloneable, IFreezable where T : IMessage { /// /// Merges the given message into this one. diff --git a/csharp/src/Google.Protobuf/JsonFormatter.cs b/csharp/src/Google.Protobuf/JsonFormatter.cs index a06e6545..7f13e33e 100644 --- a/csharp/src/Google.Protobuf/JsonFormatter.cs +++ b/csharp/src/Google.Protobuf/JsonFormatter.cs @@ -118,7 +118,7 @@ namespace Google.Protobuf this.settings = settings; } - public string Format(IReflectedMessage message) + public string Format(IMessage message) { ThrowHelper.ThrowIfNull(message, "message"); StringBuilder builder = new StringBuilder(); @@ -129,7 +129,7 @@ namespace Google.Protobuf return builder.ToString(); } - private void WriteMessage(StringBuilder builder, IReflectedMessage message) + private void WriteMessage(StringBuilder builder, IMessage message) { if (message == null) { @@ -137,15 +137,15 @@ namespace Google.Protobuf return; } builder.Append("{ "); - var fields = message.Fields; + var fields = message.Descriptor.Fields; bool first = true; // First non-oneof fields - foreach (var accessor in fields.Accessors) + foreach (var field in fields) { - var descriptor = accessor.Descriptor; + var accessor = field.Accessor; // Oneofs are written later // TODO: Change to write out fields in order, interleaving oneofs appropriately (as per binary format) - if (descriptor.ContainingOneof != null) + if (field.ContainingOneof != null) { continue; } @@ -156,7 +156,7 @@ namespace Google.Protobuf continue; } // Omit awkward (single) values such as unknown enum values - if (!descriptor.IsRepeated && !descriptor.IsMap && !CanWriteSingleValue(accessor.Descriptor, value)) + if (!field.IsRepeated && !field.IsMap && !CanWriteSingleValue(accessor.Descriptor, value)) { continue; } @@ -173,15 +173,15 @@ namespace Google.Protobuf } // Now oneofs - foreach (var accessor in fields.Oneofs) + foreach (var oneof in message.Descriptor.Oneofs) { + var accessor = oneof.Accessor; var fieldDescriptor = accessor.GetCaseFieldDescriptor(message); if (fieldDescriptor == null) { continue; } - var fieldAccessor = fields[fieldDescriptor.FieldNumber]; - object value = fieldAccessor.GetValue(message); + object value = fieldDescriptor.Accessor.GetValue(message); // Omit awkward (single) values such as unknown enum values if (!fieldDescriptor.IsRepeated && !fieldDescriptor.IsMap && !CanWriteSingleValue(fieldDescriptor, value)) { @@ -194,7 +194,7 @@ namespace Google.Protobuf } WriteString(builder, ToCamelCase(fieldDescriptor.Name)); builder.Append(": "); - WriteValue(builder, fieldAccessor, value); + WriteValue(builder, fieldDescriptor.Accessor, value); first = false; } builder.Append(first ? "}" : " }"); @@ -385,7 +385,7 @@ namespace Google.Protobuf } else { - WriteMessage(builder, (IReflectedMessage) value); + WriteMessage(builder, (IMessage) value); } break; default: @@ -406,7 +406,7 @@ namespace Google.Protobuf WriteSingleValue(builder, descriptor.MessageType.FindFieldByNumber(1), value); return; } - WriteMessage(builder, (IReflectedMessage) value); + WriteMessage(builder, (IMessage) value); } private void WriteList(StringBuilder builder, IFieldAccessor accessor, IList list) diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs index af31dfb1..f5570fc4 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs @@ -50,9 +50,8 @@ namespace Google.Protobuf.Reflection /// Converts the given array into a read-only list, applying the specified conversion to /// each input element. /// - internal static IList ConvertAndMakeReadOnly(IList input, - IndexedConverter - converter) + internal static IList ConvertAndMakeReadOnly + (IList input, IndexedConverter converter) { TOutput[] array = new TOutput[input.Count]; for (int i = 0; i < array.Length; i++) diff --git a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs index bf8f8c83..285f26f3 100644 --- a/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/EnumDescriptor.cs @@ -30,6 +30,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System; using System.Collections.Generic; namespace Google.Protobuf.Reflection @@ -42,11 +43,13 @@ namespace Google.Protobuf.Reflection private readonly EnumDescriptorProto proto; private readonly MessageDescriptor containingType; private readonly IList values; + private readonly Type generatedType; - internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) + internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index, Type generatedType) : base(file, file.ComputeFullName(parent, proto.Name), index) { this.proto = proto; + this.generatedType = generatedType; containingType = parent; if (proto.Value.Count == 0) @@ -69,6 +72,11 @@ namespace Google.Protobuf.Reflection /// public override string Name { get { return proto.Name; } } + /// + /// The generated type for this enum, or null if the descriptor does not represent a generated type. + /// + public Type GeneratedType { get { return generatedType; } } + /// /// If this is a nested type, get the outer descriptor, otherwise null. /// diff --git a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs index 39a63b47..0893dc3d 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldAccessorBase.cs @@ -43,13 +43,8 @@ namespace Google.Protobuf.Reflection private readonly Func getValueDelegate; private readonly FieldDescriptor descriptor; - internal FieldAccessorBase(Type type, string propertyName, FieldDescriptor descriptor) + internal FieldAccessorBase(PropertyInfo property, FieldDescriptor descriptor) { - PropertyInfo property = type.GetProperty(propertyName); - if (property == null || !property.CanRead) - { - throw new ArgumentException("Not all required properties/methods available"); - } this.descriptor = descriptor; getValueDelegate = ReflectionUtil.CreateFuncObjectObject(property.GetGetMethod()); } diff --git a/csharp/src/Google.Protobuf/Reflection/FieldAccessorTable.cs b/csharp/src/Google.Protobuf/Reflection/FieldAccessorTable.cs deleted file mode 100644 index 24fcbc64..00000000 --- a/csharp/src/Google.Protobuf/Reflection/FieldAccessorTable.cs +++ /dev/null @@ -1,97 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#endregion - -using System; -using System.Collections.ObjectModel; - -namespace Google.Protobuf.Reflection -{ - /// - /// Provides access to fields in generated messages via reflection. - /// - public sealed class FieldAccessorTable - { - private readonly ReadOnlyCollection accessors; - private readonly ReadOnlyCollection oneofs; - private readonly MessageDescriptor descriptor; - - /// - /// Constructs a FieldAccessorTable for a particular message class. - /// Only one FieldAccessorTable should be constructed per class. - /// - /// The CLR type for the message. - /// The type's descriptor - /// The Pascal-case names of all the field-based properties in the message. - public FieldAccessorTable(Type type, MessageDescriptor descriptor, string[] propertyNames, string[] oneofPropertyNames) - { - this.descriptor = descriptor; - var accessorsArray = new IFieldAccessor[descriptor.Fields.Count]; - for (int i = 0; i < accessorsArray.Length; i++) - { - var field = descriptor.Fields[i]; - var name = propertyNames[i]; - accessorsArray[i] = - field.IsMap ? new MapFieldAccessor(type, name, field) - : field.IsRepeated ? new RepeatedFieldAccessor(type, name, field) - : (IFieldAccessor) new SingleFieldAccessor(type, name, field); - } - accessors = new ReadOnlyCollection(accessorsArray); - var oneofsArray = new OneofAccessor[descriptor.Oneofs.Count]; - for (int i = 0; i < oneofsArray.Length; i++) - { - var oneof = descriptor.Oneofs[i]; - oneofsArray[i] = new OneofAccessor(type, oneofPropertyNames[i], oneof); - } - oneofs = new ReadOnlyCollection(oneofsArray); - } - - // TODO: Validate the name here... should possibly make this type a more "general reflection access" type, - // bearing in mind the oneof parts to come as well. - /// - /// Returns all of the field accessors for the message type. - /// - public ReadOnlyCollection Accessors { get { return accessors; } } - - public ReadOnlyCollection Oneofs { get { return oneofs; } } - - // TODO: Review this, as it's easy to get confused between FieldNumber and Index. - // Currently only used to get an accessor related to a oneof... maybe just make that simpler? - public IFieldAccessor this[int fieldNumber] - { - get - { - FieldDescriptor field = descriptor.FindFieldByNumber(fieldNumber); - return accessors[field.Index]; - } - } - } -} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 3d9d0d75..57378e4c 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.Linq; namespace Google.Protobuf.Reflection { @@ -45,6 +46,7 @@ namespace Google.Protobuf.Reflection private readonly MessageDescriptor containingType; private readonly OneofDescriptor containingOneof; private FieldType fieldType; + private IFieldAccessor accessor; internal FieldDescriptor(FieldDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) @@ -82,6 +84,8 @@ namespace Google.Protobuf.Reflection public override string Name { get { return proto.Name; } } internal FieldDescriptorProto Proto { get { return proto; } } + + public IFieldAccessor Accessor { get { return accessor; } } /// /// Maps a field type as included in the .proto file to a FieldType. @@ -287,6 +291,30 @@ namespace Google.Protobuf.Reflection { throw new DescriptorValidationException(this, "MessageSet format is not supported."); } + + accessor = CreateAccessor(); + } + + private IFieldAccessor CreateAccessor() + { + // TODO: Check the performance of this with some large protos. Each message is O(N^2) in the number of fields, + // which isn't great... + if (containingType.GeneratedType == null) + { + return null; + } + var property = containingType + .GeneratedType + .GetProperties() + .FirstOrDefault(p => p.IsDefined(typeof(ProtobufFieldAttribute), false) && + p.GetCustomAttributes(typeof(ProtobufFieldAttribute), false).Cast().Single().Number == FieldNumber); + if (property == null) + { + return null; + } + return IsMap ? new MapFieldAccessor(property, this) + : IsRepeated ? new RepeatedFieldAccessor(property, this) + : (IFieldAccessor) new SingleFieldAccessor(property, this); } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index db393480..a10e617b 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -62,11 +62,12 @@ namespace Google.Protobuf.Reflection get { return proto.Syntax == "proto3" ? ProtoSyntax.Proto3 : ProtoSyntax.Proto2; } } - private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies) + private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, Type[] generatedTypes) { this.pool = pool; this.proto = proto; this.dependencies = new ReadOnlyCollection((FileDescriptor[]) dependencies.Clone()); + IEnumerator generatedTypeIterator = generatedTypes == null ? null : ((IEnumerable)generatedTypes).GetEnumerator(); publicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies); @@ -74,15 +75,21 @@ namespace Google.Protobuf.Reflection messageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType, (message, index) => - new MessageDescriptor(message, this, null, index)); + new MessageDescriptor(message, this, null, index, generatedTypeIterator)); enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType, (enumType, index) => - new EnumDescriptor(enumType, this, null, index)); + new EnumDescriptor(enumType, this, null, index, ReflectionUtil.GetNextType(generatedTypeIterator))); services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service, (service, index) => new ServiceDescriptor(service, this, index)); + + // We should now have consumed all the generated types. + if (generatedTypeIterator != null && generatedTypeIterator.MoveNext()) + { + throw new ArgumentException("More generated types left over after consuming all expected ones", "generatedTypes"); + } } /// @@ -265,7 +272,7 @@ namespace Google.Protobuf.Reflection /// If is not /// a valid descriptor. This can occur for a number of reasons, such as a field /// having an undefined type or because two messages were defined with the same name. - private static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies) + private static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, Type[] generatedTypes) { // Building descriptors involves two steps: translating and linking. // In the translation step (implemented by FileDescriptor's @@ -282,7 +289,7 @@ namespace Google.Protobuf.Reflection } DescriptorPool pool = new DescriptorPool(dependencies); - FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies); + FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies, generatedTypes); // TODO(jonskeet): Reinstate these checks, or get rid of them entirely. They aren't in the Java code, // and fail for the CustomOptions test right now. (We get "descriptor.proto" vs "google/protobuf/descriptor.proto".) @@ -319,8 +326,23 @@ namespace Google.Protobuf.Reflection } } + /// + /// Creates an instance for generated code. + /// + /// + /// The parameter should be null for descriptors which don't correspond to + /// generated types. Otherwise, the array should be represent all the generated types in the file: messages then + /// enums. Within each message, there can be nested messages and enums, which must be specified "inline" in the array: + /// containing message, nested messages, nested enums - and of course each nested message may contain *more* nested messages, + /// etc. All messages within the descriptor should be represented, even if they do not have a generated type - any + /// type without a corresponding generated type (such as map entries) should respond to a null element. + /// For example, a file with a messages OuterMessage and InnerMessage, and enums OuterEnum and InnerEnum (where + /// InnerMessage and InnerEnum are nested within InnerMessage) would result in an array of + /// OuterMessage, InnerMessage, InnerEnum, OuterEnum. + /// public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, - FileDescriptor[] dependencies) + FileDescriptor[] dependencies, + Type[] generatedTypes) { FileDescriptorProto proto; try @@ -336,7 +358,7 @@ namespace Google.Protobuf.Reflection { // When building descriptors for generated code, we allow unknown // dependencies by default. - return BuildFrom(proto, dependencies, true); + return BuildFrom(proto, dependencies, true, generatedTypes); } catch (DescriptorValidationException e) { diff --git a/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs index 317fbd8d..6df4c5f0 100644 --- a/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MapFieldAccessor.cs @@ -32,6 +32,7 @@ using System; using System.Collections; +using System.Reflection; namespace Google.Protobuf.Reflection { @@ -40,7 +41,7 @@ namespace Google.Protobuf.Reflection /// internal sealed class MapFieldAccessor : FieldAccessorBase { - internal MapFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) + internal MapFieldAccessor(PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor) { } diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs index 1c22c460..9413cf61 100644 --- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs @@ -30,8 +30,10 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using Google.Protobuf.Collections; using System; using System.Collections.Generic; +using System.Linq; namespace Google.Protobuf.Reflection { @@ -60,11 +62,15 @@ namespace Google.Protobuf.Reflection private readonly IList enumTypes; private readonly IList fields; private readonly IList oneofs; + // CLR representation of the type described by this descriptor, if any. + private readonly Type generatedType; + private IDictionary fieldAccessorsByFieldNumber; - internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex) + internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, IEnumerator generatedTypeIterator) : base(file, file.ComputeFullName(parent, proto.Name), typeIndex) { this.proto = proto; + generatedType = ReflectionUtil.GetNextType(generatedTypeIterator); containingType = parent; oneofs = DescriptorUtil.ConvertAndMakeReadOnly(proto.OneofDecl, @@ -73,11 +79,11 @@ namespace Google.Protobuf.Reflection nestedTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.NestedType, (type, index) => - new MessageDescriptor(type, file, this, index)); + new MessageDescriptor(type, file, this, index, generatedTypeIterator)); enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType, (type, index) => - new EnumDescriptor(type, file, this, index)); + new EnumDescriptor(type, file, this, index, ReflectionUtil.GetNextType(generatedTypeIterator))); // TODO(jonskeet): Sort fields first? fields = DescriptorUtil.ConvertAndMakeReadOnly(proto.Field, @@ -85,6 +91,14 @@ namespace Google.Protobuf.Reflection new FieldDescriptor(field, file, this, index)); file.DescriptorPool.AddSymbol(this); } + + /// + /// Returns the total number of nested types and enums, recursively. + /// + private int CountTotalGeneratedTypes() + { + return nestedTypes.Sum(nested => nested.CountTotalGeneratedTypes()) + enumTypes.Count; + } /// /// The brief name of the descriptor's target. @@ -93,6 +107,11 @@ namespace Google.Protobuf.Reflection internal DescriptorProto Proto { get { return proto; } } + /// + /// The generated type for this message, or null if the descriptor does not represent a generated type. + /// + public Type GeneratedType { get { return generatedType; } } + /// /// Returns whether this message is one of the "well known types" which may have runtime/protoc support. /// @@ -141,6 +160,13 @@ namespace Google.Protobuf.Reflection get { return oneofs; } } + /// + /// Returns a map from field number to accessor. + /// TODO: Revisit this. It's mostly in place to make the transition from FieldAccessorTable + /// to descriptor-based reflection simple in terms of tests. Work out what we really want. + /// + public IDictionary FieldAccessorsByFieldNumber { get { return fieldAccessorsByFieldNumber; } } + /// /// Finds a field by field name. /// @@ -192,6 +218,8 @@ namespace Google.Protobuf.Reflection { oneof.CrossLink(); } + + fieldAccessorsByFieldNumber = new ReadOnlyDictionary(fields.ToDictionary(field => field.FieldNumber, field => field.Accessor)); } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs index 7a11d36b..20cbea92 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs @@ -44,18 +44,16 @@ namespace Google.Protobuf.Reflection private readonly Action clearDelegate; private OneofDescriptor descriptor; - internal OneofAccessor(Type type, string propertyName, OneofDescriptor descriptor) + internal OneofAccessor(PropertyInfo caseProperty, MethodInfo clearMethod, OneofDescriptor descriptor) { - PropertyInfo property = type.GetProperty(propertyName + "Case"); - if (property == null || !property.CanRead) + if (!caseProperty.CanRead) { - throw new ArgumentException("Not all required properties/methods available"); + throw new ArgumentException("Cannot read from property"); } this.descriptor = descriptor; - caseDelegate = ReflectionUtil.CreateFuncObjectT(property.GetGetMethod()); + caseDelegate = ReflectionUtil.CreateFuncObjectT(caseProperty.GetGetMethod()); this.descriptor = descriptor; - MethodInfo clearMethod = type.GetMethod("Clear" + propertyName); clearDelegate = ReflectionUtil.CreateActionObject(clearMethod); } diff --git a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs index e92dc8bb..b4cc0791 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs @@ -32,6 +32,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Linq; namespace Google.Protobuf.Reflection { @@ -40,6 +41,7 @@ namespace Google.Protobuf.Reflection private readonly OneofDescriptorProto proto; private MessageDescriptor containingType; private IList fields; + private OneofAccessor accessor; internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) : base(file, file.ComputeFullName(parent, proto.Name), index) @@ -62,6 +64,8 @@ namespace Google.Protobuf.Reflection public IList Fields { get { return fields; } } + public OneofAccessor Accessor { get { return accessor; } } + internal void CrossLink() { List fieldCollection = new List(); @@ -73,6 +77,36 @@ namespace Google.Protobuf.Reflection } } fields = new ReadOnlyCollection(fieldCollection); + accessor = CreateAccessor(); + } + + private OneofAccessor CreateAccessor() + { + if (containingType.GeneratedType == null) + { + return null; + } + var caseProperty = containingType + .GeneratedType + .GetProperties() + .FirstOrDefault(p => p.IsDefined(typeof(ProtobufOneofAttribute), false) && + p.GetCustomAttributes(typeof(ProtobufOneofAttribute), false).Cast().Single().Name == Name); + if (caseProperty == null) + { + return null; + } + + var clearMethod = containingType + .GeneratedType + .GetMethods() + .FirstOrDefault(p => p.IsDefined(typeof(ProtobufOneofAttribute), false) && + p.GetCustomAttributes(typeof(ProtobufOneofAttribute), false).Cast().Single().Name == Name); + if (clearMethod == null) + { + return null; + } + + return new OneofAccessor(caseProperty, clearMethod, this); } } } diff --git a/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs b/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs new file mode 100644 index 00000000..a59caea7 --- /dev/null +++ b/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs @@ -0,0 +1,58 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion +using System; + +namespace Google.Protobuf.Reflection +{ + /// + /// Attribute applied to a generated property corresponding to a field in a .proto file. + /// + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + public sealed class ProtobufFieldAttribute : Attribute + { + /// + /// The field number in the original .proto file. + /// + public int Number { get; set; } + + /// + /// The field name in the original .proto file. + /// + public string Name { get; set; } + + public ProtobufFieldAttribute(int number, string name) + { + this.Number = number; + this.Name = name; + } + } +} diff --git a/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs b/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs new file mode 100644 index 00000000..74ad8c53 --- /dev/null +++ b/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs @@ -0,0 +1,52 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#endregion +using System; + +namespace Google.Protobuf.Reflection +{ + /// + /// Attribute applied to the "case" property or "clear" method corresponding to a oneof in a .proto file. + /// + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)] + public sealed class ProtobufOneofAttribute : Attribute + { + /// + /// The oneof name in the original .proto file. + /// + public string Name { get; set; } + + public ProtobufOneofAttribute(string name) + { + this.Name = name; + } + } +} diff --git a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs index d0dc3e8b..ec222dc1 100644 --- a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; @@ -102,5 +103,24 @@ namespace Google.Protobuf.Reflection Expression call = Expression.Call(castTarget, method); return Expression.Lambda>(call, targetParameter).Compile(); } + + /// + /// Returns the next type from an iterator of types, unless the iterator is a null reference, + /// in which case null is returned. + /// + internal static Type GetNextType(IEnumerator generatedTypeIterator) + { + if (generatedTypeIterator == null) + { + return null; + } + if (!generatedTypeIterator.MoveNext()) + { + // This parameter name corresponds to any public method supplying the generated types to start with. + throw new ArgumentException("More generated types left over after consuming all expected ones", "generatedTypes"); + } + return generatedTypeIterator.Current; + } + } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs index 0ada7567..acb3c8d5 100644 --- a/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/RepeatedFieldAccessor.cs @@ -32,6 +32,7 @@ using System; using System.Collections; +using System.Reflection; namespace Google.Protobuf.Reflection { @@ -40,7 +41,7 @@ namespace Google.Protobuf.Reflection /// internal sealed class RepeatedFieldAccessor : FieldAccessorBase { - internal RepeatedFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) + internal RepeatedFieldAccessor(PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor) { } diff --git a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs index 8c24e46e..f00a51ba 100644 --- a/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs +++ b/csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs @@ -48,11 +48,8 @@ namespace Google.Protobuf.Reflection private readonly Action setValueDelegate; private readonly Action clearDelegate; - internal SingleFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) + internal SingleFieldAccessor(PropertyInfo property, FieldDescriptor descriptor) : base(property, descriptor) { - PropertyInfo property = type.GetProperty(propertyName); - // We know there *is* such a property, or the base class constructor would have thrown. We should be able to write - // to it though. if (!property.CanWrite) { throw new ArgumentException("Not all required properties/methods available"); diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.cc b/src/google/protobuf/compiler/csharp/csharp_field_base.cc index 89d4eb18..d327e267 100644 --- a/src/google/protobuf/compiler/csharp/csharp_field_base.cc +++ b/src/google/protobuf/compiler/csharp/csharp_field_base.cc @@ -74,6 +74,7 @@ void FieldGeneratorBase::SetCommonFieldVariables( (*variables)["property_name"] = property_name(); (*variables)["type_name"] = type_name(); + (*variables)["original_name"] = descriptor_->name(); (*variables)["name"] = name(); (*variables)["descriptor_name"] = descriptor_->name(); (*variables)["default_value"] = default_value(); @@ -85,7 +86,6 @@ void FieldGeneratorBase::SetCommonFieldVariables( } (*variables)["capitalized_type_name"] = capitalized_type_name(); (*variables)["number"] = number(); - (*variables)["field_ordinal"] = field_ordinal(); (*variables)["has_property_check"] = (*variables)["property_name"] + " != " + (*variables)["default_value"]; (*variables)["other_has_property_check"] = "other." + diff --git a/src/google/protobuf/compiler/csharp/csharp_helpers.h b/src/google/protobuf/compiler/csharp/csharp_helpers.h index 653ff992..7737ffe2 100644 --- a/src/google/protobuf/compiler/csharp/csharp_helpers.h +++ b/src/google/protobuf/compiler/csharp/csharp_helpers.h @@ -77,6 +77,8 @@ std::string GetFullUmbrellaClassName(const FileDescriptor* descriptor); std::string GetQualifiedUmbrellaClassName(const FileDescriptor* descriptor); +std::string GetClassName(const Descriptor* descriptor); + std::string GetClassName(const EnumDescriptor* descriptor); std::string GetFieldName(const FieldDescriptor* descriptor); @@ -119,10 +121,6 @@ inline bool IsDescriptorProto(const FileDescriptor* descriptor) { return descriptor->name() == "google/protobuf/descriptor_proto_file.proto"; } -inline bool IsMapEntry(const Descriptor* descriptor) { - return descriptor->options().map_entry(); -} - inline bool IsWrapperType(const FieldDescriptor* descriptor) { return descriptor->type() == FieldDescriptor::TYPE_MESSAGE && descriptor->message_type()->file()->name() == "google/protobuf/wrappers.proto"; diff --git a/src/google/protobuf/compiler/csharp/csharp_map_field.cc b/src/google/protobuf/compiler/csharp/csharp_map_field.cc index cba24a59..bdbfd92b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_map_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_map_field.cc @@ -79,6 +79,7 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::MapField<$key_type_name$, $value_type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 10cf3585..42fd5065 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -96,88 +96,11 @@ const std::vector& MessageGenerator::fields_by_number() return fields_by_number_; } -/// Get an identifier that uniquely identifies this type within the file. -/// This is used to declare static variables related to this type at the -/// outermost file scope. -std::string GetUniqueFileScopeIdentifier(const Descriptor* descriptor) { - std::string result = descriptor->full_name(); - std::replace(result.begin(), result.end(), '.', '_'); - return "static_" + result; -} - -void MessageGenerator::GenerateStaticVariables(io::Printer* printer) { - // Because descriptor.proto (Google.Protobuf.DescriptorProtos) is - // used in the construction of descriptors, we have a tricky bootstrapping - // problem. To help control static initialization order, we make sure all - // descriptors and other static data that depends on them are members of - // the proto-descriptor class. This way, they will be initialized in - // a deterministic order. - - std::string identifier = GetUniqueFileScopeIdentifier(descriptor_); - - // The descriptor for this type. - printer->Print( - "internal static pbr::FieldAccessorTable internal__$identifier$__FieldAccessorTable;\n", - "identifier", GetUniqueFileScopeIdentifier(descriptor_), - "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))) { - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariables(printer); - } - } -} - -void MessageGenerator::GenerateStaticVariableInitializers(io::Printer* printer) { - map vars; - vars["identifier"] = GetUniqueFileScopeIdentifier(descriptor_); - vars["full_class_name"] = full_class_name(); - - // Work out how to get to the message descriptor (which may be multiply nested) from the file - // descriptor. - string descriptor_chain; - const Descriptor* current_descriptor = descriptor_; - while (current_descriptor->containing_type()) { - descriptor_chain = ".NestedTypes[" + SimpleItoa(current_descriptor->index()) + "]" + descriptor_chain; - current_descriptor = current_descriptor->containing_type(); - } - descriptor_chain = "descriptor.MessageTypes[" + SimpleItoa(current_descriptor->index()) + "]" + descriptor_chain; - vars["descriptor_chain"] = descriptor_chain; - - printer->Print( - vars, - "internal__$identifier$__FieldAccessorTable = \n" - " new pbr::FieldAccessorTable(typeof($full_class_name$), $descriptor_chain$,\n"); - printer->Print(" new string[] { "); - for (int i = 0; i < descriptor_->field_count(); i++) { - printer->Print("\"$property_name$\", ", - "property_name", GetPropertyName(descriptor_->field(i))); - } - printer->Print("}, new string[] { "); - for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { - printer->Print("\"$oneof_name$\", ", - "oneof_name", - UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), true)); - } - printer->Print("});\n"); - - // 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))) { - MessageGenerator messageGenerator(descriptor_->nested_type(i)); - messageGenerator.GenerateStaticVariableInitializers(printer); - } - } -} - void MessageGenerator::Generate(io::Printer* printer) { map vars; vars["class_name"] = class_name(); vars["access_level"] = class_access_level(); vars["umbrella_class_name"] = GetFullUmbrellaClassName(descriptor_->file()); - vars["identifier"] = GetUniqueFileScopeIdentifier(descriptor_); printer->Print( "[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n"); @@ -221,8 +144,8 @@ void MessageGenerator::Generate(io::Printer* printer) { " get { return $descriptor_accessor$; }\n" "}\n" "\n" - "pbr::FieldAccessorTable pb::IReflectedMessage.Fields {\n" - " get { return $umbrella_class_name$.internal__$identifier$__FieldAccessorTable; }\n" + "pbr::MessageDescriptor pb::IMessage.Descriptor {\n" + " get { return Descriptor; }\n" "}\n" "\n" "private bool _frozen = false;\n" @@ -258,6 +181,7 @@ void MessageGenerator::Generate(io::Printer* printer) { for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { vars["name"] = UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), false); vars["property_name"] = UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), true); + vars["original_name"] = descriptor_->oneof_decl(i)->name(); printer->Print( vars, "private object $name$_;\n" @@ -275,9 +199,11 @@ void MessageGenerator::Generate(io::Printer* printer) { printer->Print( vars, "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n" + "[pbr::ProtobufOneof(\"$original_name$\")]\n" "public $property_name$OneofCase $property_name$Case {\n" " get { return $name$Case_; }\n" "}\n\n" + "[pbr::ProtobufOneof(\"$original_name$\")]\n" "public void Clear$property_name$() {\n" " pb::Freezable.CheckMutable(this);\n" " $name$Case_ = $property_name$OneofCase.None;\n" diff --git a/src/google/protobuf/compiler/csharp/csharp_message.h b/src/google/protobuf/compiler/csharp/csharp_message.h index fbe8a3be..f0c49ac9 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.h +++ b/src/google/protobuf/compiler/csharp/csharp_message.h @@ -53,8 +53,6 @@ class MessageGenerator : public SourceGeneratorBase { void GenerateCloningCode(io::Printer* printer); void GenerateFreezingCode(io::Printer* printer); void GenerateFrameworkMethods(io::Printer* printer); - void GenerateStaticVariables(io::Printer* printer); - void GenerateStaticVariableInitializers(io::Printer* printer); void Generate(io::Printer* printer); private: diff --git a/src/google/protobuf/compiler/csharp/csharp_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_message_field.cc index d2c3a88b..c2b6ff76 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message_field.cc @@ -64,6 +64,7 @@ void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -158,6 +159,7 @@ void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : null; }\n" " set {\n" diff --git a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc index 4454ef02..2c9338bd 100644 --- a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc @@ -71,6 +71,7 @@ void PrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -174,6 +175,7 @@ void PrimitiveOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : $default_value$; }\n" " set {\n" diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc index d5fc6d98..60d06154 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc @@ -59,12 +59,13 @@ void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { printer->Print( variables_, "private static readonly pb::FieldCodec<$type_name$> _repeated_$name$_codec\n" - " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);"); + " = pb::FieldCodec.ForEnum($tag$, x => (int) x, x => ($type_name$) x);\n"); printer->Print(variables_, "private readonly pbc::RepeatedField<$type_name$> $name$_ = new pbc::RepeatedField<$type_name$>();\n"); AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc index d939fc79..921798b0 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc @@ -78,6 +78,7 @@ void RepeatedMessageFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc index 5b5d9b3d..bcfb9936 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc @@ -65,6 +65,7 @@ void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc index 57271d17..3f39250e 100644 --- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc +++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc @@ -63,12 +63,6 @@ UmbrellaClassGenerator::~UmbrellaClassGenerator() { void UmbrellaClassGenerator::Generate(io::Printer* printer) { WriteIntroduction(printer); - printer->Print("#region Static variables\n"); - for (int i = 0; i < file_->message_type_count(); i++) { - MessageGenerator messageGenerator(file_->message_type(i)); - messageGenerator.GenerateStaticVariables(printer); - } - printer->Print("#endregion\n"); WriteDescriptor(printer); // Close the class declaration. printer->Outdent(); @@ -183,24 +177,43 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) { // Invoke InternalBuildGeneratedFileFrom() to build the file. printer->Print( "descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,\n"); - printer->Print(" new pbr::FileDescriptor[] {\n"); + printer->Print(" new pbr::FileDescriptor[] { "); for (int i = 0; i < file_->dependency_count(); i++) { printer->Print( - " $full_umbrella_class_name$.Descriptor, \n", + "$full_umbrella_class_name$.Descriptor, ", "full_umbrella_class_name", GetFullUmbrellaClassName(file_->dependency(i))); } - printer->Print(" });\n"); - // Then invoke any other static variable initializers, e.g. field accessors. + // Specify all the generated types (messages and enums), recursively, as an array. + printer->Print("},\n" + " new global::System.Type[] { "); for (int i = 0; i < file_->message_type_count(); i++) { - MessageGenerator messageGenerator(file_->message_type(i)); - messageGenerator.GenerateStaticVariableInitializers(printer); + WriteTypeLiterals(file_->message_type(i), printer); } + for (int i = 0; i < file_->enum_type_count(); i++) { + printer->Print("typeof($type_name$), ", "type_name", GetClassName(file_->enum_type(i))); + } + printer->Print("});\n"); + printer->Outdent(); printer->Print("}\n"); printer->Print("#endregion\n\n"); } +void UmbrellaClassGenerator::WriteTypeLiterals(const Descriptor* descriptor, io::Printer* printer) { + if (IsMapEntryMessage(descriptor)) { + printer->Print("null, "); + return; + } + printer->Print("typeof($type_name$), ", "type_name", GetClassName(descriptor)); + for (int i = 0; i < descriptor->nested_type_count(); i++) { + WriteTypeLiterals(descriptor->nested_type(i), printer); + } + for (int i = 0; i < descriptor->enum_type_count(); i++) { + printer->Print("typeof($type_name$), ", "type_name", GetClassName(descriptor->enum_type(i))); + } +} + } // namespace csharp } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h index f7533d2d..db1092a9 100644 --- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h +++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h @@ -57,6 +57,7 @@ class UmbrellaClassGenerator : public SourceGeneratorBase { void WriteIntroduction(io::Printer* printer); void WriteDescriptor(io::Printer* printer); + void WriteTypeLiterals(const Descriptor* descriptor, io::Printer* printer); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UmbrellaClassGenerator); }; diff --git a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc index 75ef5e50..d6cd0a10 100644 --- a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc @@ -73,6 +73,7 @@ void WrapperFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -169,6 +170,7 @@ void WrapperOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, + "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : ($type_name$) null; }\n" " set {\n" From 96cffaa8e397d466ee3b07c413824182f4a95a9e Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Mon, 20 Jul 2015 19:25:07 +0100 Subject: [PATCH 2/8] Generated code changes following previous commit. --- csharp/src/AddressBook/Addressbook.cs | 37 +- .../TestProtos/MapUnittestProto3.cs | 101 ++-- .../TestProtos/UnittestImportProto3.cs | 16 +- .../TestProtos/UnittestImportPublicProto3.cs | 15 +- .../TestProtos/UnittestIssues.cs | 81 ++-- .../TestProtos/UnittestProto3.cs | 433 +++++++++--------- .../TestProtos/UnittestWellKnownTypes.cs | 122 +++-- .../Reflection/DescriptorProtoFile.cs | 285 ++++++------ .../src/Google.Protobuf/WellKnownTypes/Any.cs | 16 +- .../src/Google.Protobuf/WellKnownTypes/Api.cs | 35 +- .../WellKnownTypes/Duration.cs | 16 +- .../Google.Protobuf/WellKnownTypes/Empty.cs | 14 +- .../WellKnownTypes/FieldMask.cs | 15 +- .../WellKnownTypes/SourceContext.cs | 15 +- .../Google.Protobuf/WellKnownTypes/Struct.cs | 40 +- .../WellKnownTypes/Timestamp.cs | 16 +- .../Google.Protobuf/WellKnownTypes/Type.cs | 70 ++- .../WellKnownTypes/Wrappers.cs | 87 ++-- 18 files changed, 686 insertions(+), 728 deletions(-) diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index e3abd98b..92257064 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -12,11 +12,6 @@ namespace Google.Protobuf.Examples.AddressBook { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Addressbook { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -36,17 +31,8 @@ namespace Google.Protobuf.Examples.AddressBook { "aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt", "cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_tutorial_Person__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.Person), descriptor.MessageTypes[0], - new string[] { "Name", "Id", "Email", "Phones", }, new string[] { }); - internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { "Number", "Type", }, new string[] { }); - internal__static_tutorial_AddressBook__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), descriptor.MessageTypes[1], - new string[] { "People", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.Examples.AddressBook.Person), typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType), typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), }); } #endregion @@ -63,8 +49,8 @@ namespace Google.Protobuf.Examples.AddressBook { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -97,6 +83,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -107,6 +94,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int IdFieldNumber = 2; private int id_; + [pbr::ProtobufField(2, "id")] public int Id { get { return id_; } set { @@ -117,6 +105,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int EmailFieldNumber = 3; private string email_ = ""; + [pbr::ProtobufField(3, "email")] public string Email { get { return email_; } set { @@ -129,6 +118,7 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_phones_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); private readonly pbc::RepeatedField phones_ = new pbc::RepeatedField(); + [pbr::ProtobufField(4, "phones")] public pbc::RepeatedField Phones { get { return phones_; } } @@ -262,8 +252,8 @@ namespace Google.Protobuf.Examples.AddressBook { get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -293,6 +283,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NumberFieldNumber = 1; private string number_ = ""; + [pbr::ProtobufField(1, "number")] public string Number { get { return number_; } set { @@ -303,6 +294,7 @@ namespace Google.Protobuf.Examples.AddressBook { public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE; + [pbr::ProtobufField(2, "type")] public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { get { return type_; } set { @@ -413,8 +405,8 @@ namespace Google.Protobuf.Examples.AddressBook { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_AddressBook__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -446,6 +438,7 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_people_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); private readonly pbc::RepeatedField people_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "people")] public pbc::RepeatedField People { get { return people_; } } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs index 5f6eae0c..4eeb7423 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs @@ -12,15 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MapUnittestProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap__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_TestSameTypeMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -155,30 +146,8 @@ namespace Google.Protobuf.TestProtos { "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, - }); - 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_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_TestSameTypeMap__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), descriptor.MessageTypes[3], - new string[] { "Map1", "Map2", }, 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_MessageContainingEnumCalledType__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), descriptor.MessageTypes[5], - new string[] { "Type", }, 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[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestMap), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), typeof(global::Google.Protobuf.TestProtos.TestMessageMap), null, typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), null, null, typeof(global::Google.Protobuf.TestProtos.TestArenaMap), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), null, typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.Type), typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), null, typeof(global::Google.Protobuf.TestProtos.MapEnum), }); } #endregion @@ -204,8 +173,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -269,6 +238,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(1, "map_int32_int32")] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -277,6 +247,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(2, "map_int64_int64")] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -285,6 +256,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(3, "map_uint32_uint32")] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -293,6 +265,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(4, "map_uint64_uint64")] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -301,6 +274,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(5, "map_sint32_sint32")] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -309,6 +283,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(6, "map_sint64_sint64")] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -317,6 +292,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(7, "map_fixed32_fixed32")] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -325,6 +301,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(8, "map_fixed64_fixed64")] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -333,6 +310,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(9, "map_sfixed32_sfixed32")] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -341,6 +319,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(10, "map_sfixed64_sfixed64")] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -349,6 +328,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(11, "map_int32_float")] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -357,6 +337,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(12, "map_int32_double")] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -365,6 +346,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(13, "map_bool_bool")] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -373,6 +355,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_mapStringString_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 114); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); + [pbr::ProtobufField(14, "map_string_string")] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -381,6 +364,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_mapInt32Bytes_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForBytes(18), 122); private readonly pbc::MapField mapInt32Bytes_ = new pbc::MapField(); + [pbr::ProtobufField(15, "map_int32_bytes")] public pbc::MapField MapInt32Bytes { get { return mapInt32Bytes_; } } @@ -389,6 +373,7 @@ namespace Google.Protobuf.TestProtos { 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), 130); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); + [pbr::ProtobufField(16, "map_int32_enum")] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -397,6 +382,7 @@ namespace Google.Protobuf.TestProtos { 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), 138); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); + [pbr::ProtobufField(17, "map_int32_foreign_message")] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } @@ -619,8 +605,8 @@ namespace Google.Protobuf.TestProtos { 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; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -650,6 +636,7 @@ namespace Google.Protobuf.TestProtos { public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; + [pbr::ProtobufField(1, "test_map")] public global::Google.Protobuf.TestProtos.TestMap TestMap { get { return testMap_; } set { @@ -745,8 +732,8 @@ namespace Google.Protobuf.TestProtos { 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; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -778,6 +765,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(1, "map_int32_message")] public pbc::MapField MapInt32Message { get { return mapInt32Message_; } } @@ -856,8 +844,8 @@ namespace Google.Protobuf.TestProtos { 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; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -891,6 +879,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(1, "map1")] public pbc::MapField Map1 { get { return map1_; } } @@ -899,6 +888,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(2, "map2")] public pbc::MapField Map2 { get { return map2_; } } @@ -986,8 +976,8 @@ namespace Google.Protobuf.TestProtos { 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; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1047,6 +1037,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(1, "map_int32_int32")] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1055,6 +1046,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(2, "map_int64_int64")] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1063,6 +1055,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(3, "map_uint32_uint32")] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1071,6 +1064,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(4, "map_uint64_uint64")] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1079,6 +1073,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(5, "map_sint32_sint32")] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1087,6 +1082,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(6, "map_sint64_sint64")] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1095,6 +1091,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(7, "map_fixed32_fixed32")] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1103,6 +1100,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(8, "map_fixed64_fixed64")] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1111,6 +1109,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(9, "map_sfixed32_sfixed32")] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1119,6 +1118,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(10, "map_sfixed64_sfixed64")] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1127,6 +1127,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(11, "map_int32_float")] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1135,6 +1136,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(12, "map_int32_double")] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1143,6 +1145,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(13, "map_bool_bool")] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1151,6 +1154,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(14, "map_int32_enum")] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -1159,6 +1163,7 @@ namespace Google.Protobuf.TestProtos { 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(); + [pbr::ProtobufField(15, "map_int32_foreign_message")] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } @@ -1363,8 +1368,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1396,6 +1401,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_type_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); private readonly pbc::MapField type_ = new pbc::MapField(); + [pbr::ProtobufField(1, "type")] public pbc::MapField Type { get { return type_; } } @@ -1484,8 +1490,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1517,6 +1523,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_entry_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); private readonly pbc::MapField entry_ = new pbc::MapField(); + [pbr::ProtobufField(1, "entry")] public pbc::MapField Entry { get { return entry_; } } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index 3875a4c3..87bec2af 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -12,9 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -33,12 +30,8 @@ namespace Google.Protobuf.TestProtos { "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", "Mw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, - }); - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ImportMessage), descriptor.MessageTypes[0], - new string[] { "D", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.ImportMessage), typeof(global::Google.Protobuf.TestProtos.ImportEnum), }); } #endregion @@ -65,8 +58,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -95,6 +88,7 @@ namespace Google.Protobuf.TestProtos { public const int DFieldNumber = 1; private int d_; + [pbr::ProtobufField(1, "d")] public int D { get { return d_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs index 048ae5e9..a983dfa8 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs @@ -12,9 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportPublicProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -29,11 +26,8 @@ namespace Google.Protobuf.TestProtos { "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), descriptor.MessageTypes[0], - new string[] { "E", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), }); } #endregion @@ -50,8 +44,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -80,6 +74,7 @@ namespace Google.Protobuf.TestProtos { public const int EFieldNumber = 1; private int e_; + [pbr::ProtobufField(1, "e")] public int E { get { return e_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index c68c67fb..9a656f25 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -12,15 +12,6 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestIssues { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -49,29 +40,8 @@ namespace UnitTest.Issues.TestProtos { "dGVkRW51bRITCg9ERVBSRUNBVEVEX1pFUk8QABIHCgNvbmUQAUIfSAGqAhpV", "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_unittest_issues_Issue307__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307), descriptor.MessageTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), descriptor.MessageTypes[0].NestedTypes[0].NestedTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), descriptor.MessageTypes[1], - new string[] { "Value", "Values", "PackedValues", }, new string[] { }); - internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), descriptor.MessageTypes[2], - new string[] { }, new string[] { }); - internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), descriptor.MessageTypes[3], - new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }, new string[] { }); - internal__static_unittest_issues_ItemField__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.ItemField), descriptor.MessageTypes[4], - new string[] { "Item", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::UnitTest.Issues.TestProtos.Issue307), typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), typeof(global::UnitTest.Issues.TestProtos.ItemField), typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }); } #endregion @@ -102,8 +72,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -195,8 +165,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -288,8 +258,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -390,8 +360,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -424,6 +394,7 @@ namespace UnitTest.Issues.TestProtos { public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO; + [pbr::ProtobufField(1, "value")] public global::UnitTest.Issues.TestProtos.NegativeEnum Value { get { return value_; } set { @@ -434,14 +405,18 @@ namespace UnitTest.Issues.TestProtos { public const int ValuesFieldNumber = 2; private static readonly pb::FieldCodec _repeated_values_codec - = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); + private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "values")] public pbc::RepeatedField Values { get { return values_; } } public const int PackedValuesFieldNumber = 3; private static readonly pb::FieldCodec _repeated_packedValues_codec - = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);private readonly pbc::RepeatedField packedValues_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); + private readonly pbc::RepeatedField packedValues_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "packed_values")] public pbc::RepeatedField PackedValues { get { return packedValues_; } } @@ -547,8 +522,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -639,8 +614,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -679,6 +654,7 @@ namespace UnitTest.Issues.TestProtos { public const int PrimitiveValueFieldNumber = 1; private int primitiveValue_; [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(1, "PrimitiveValue")] public int PrimitiveValue { get { return primitiveValue_; } set { @@ -692,6 +668,7 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField primitiveArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(2, "PrimitiveArray")] public pbc::RepeatedField PrimitiveArray { get { return primitiveArray_; } } @@ -699,6 +676,7 @@ namespace UnitTest.Issues.TestProtos { public const int MessageValueFieldNumber = 3; private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(3, "MessageValue")] public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { get { return messageValue_; } set { @@ -712,6 +690,7 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser); private readonly pbc::RepeatedField messageArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(4, "MessageArray")] public pbc::RepeatedField MessageArray { get { return messageArray_; } } @@ -719,6 +698,7 @@ namespace UnitTest.Issues.TestProtos { public const int EnumValueFieldNumber = 5; private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO; [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(5, "EnumValue")] public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { get { return enumValue_; } set { @@ -729,8 +709,10 @@ namespace UnitTest.Issues.TestProtos { public const int EnumArrayFieldNumber = 6; private static readonly pb::FieldCodec _repeated_enumArray_codec - = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);private readonly pbc::RepeatedField enumArray_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); + private readonly pbc::RepeatedField enumArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(6, "EnumArray")] public pbc::RepeatedField EnumArray { get { return enumArray_; } } @@ -883,8 +865,8 @@ namespace UnitTest.Issues.TestProtos { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -913,6 +895,7 @@ namespace UnitTest.Issues.TestProtos { public const int ItemFieldNumber = 1; private int item_; + [pbr::ProtobufField(1, "item")] public int Item { get { return item_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index 67c42708..55ed08af 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -12,43 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MoreString__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -186,114 +149,8 @@ namespace Google.Protobuf.TestProtos { "dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB", "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, - }); - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestAllTypes), descriptor.MessageTypes[0], - new string[] { "SingleInt32", "SingleInt64", "SingleUint32", "SingleUint64", "SingleSint32", "SingleSint64", "SingleFixed32", "SingleFixed64", "SingleSfixed32", "SingleSfixed64", "SingleFloat", "SingleDouble", "SingleBool", "SingleString", "SingleBytes", "SingleNestedMessage", "SingleForeignMessage", "SingleImportMessage", "SingleNestedEnum", "SingleForeignEnum", "SingleImportEnum", "SinglePublicImportMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedPublicImportMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", }, new string[] { "OneofField", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { "Bb", }, new string[] { }); - internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), descriptor.MessageTypes[1], - new string[] { "Child", "Payload", "RepeatedChild", }, new string[] { }); - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), descriptor.MessageTypes[2], - new string[] { "DeprecatedInt32", }, new string[] { }); - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ForeignMessage), descriptor.MessageTypes[3], - new string[] { "C", }, new string[] { }); - internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReservedFields), descriptor.MessageTypes[4], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestForeignNested), descriptor.MessageTypes[5], - new string[] { "ForeignNested", }, new string[] { }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), descriptor.MessageTypes[6], - new string[] { "A", "Bb", }, new string[] { }); - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), descriptor.MessageTypes[7], - new string[] { "A", "I", }, new string[] { }); - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), descriptor.MessageTypes[8], - new string[] { "Bb", }, new string[] { }); - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), descriptor.MessageTypes[9], - new string[] { "A", "OptionalInt32", }, new string[] { }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), descriptor.MessageTypes[10], - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", }, new string[] { }); - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), descriptor.MessageTypes[11], - new string[] { "MyString", "MyInt", "MyFloat", "SingleNestedMessage", }, new string[] { }); - internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), descriptor.MessageTypes[11].NestedTypes[0], - new string[] { "Oo", "Bb", }, new string[] { }); - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), descriptor.MessageTypes[12], - new string[] { "SparseEnum", }, new string[] { }); - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneString), descriptor.MessageTypes[13], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_MoreString__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreString), descriptor.MessageTypes[14], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneBytes), descriptor.MessageTypes[15], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreBytes), descriptor.MessageTypes[16], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Int32Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int32Message), descriptor.MessageTypes[17], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint32Message), descriptor.MessageTypes[18], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Int64Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int64Message), descriptor.MessageTypes[19], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint64Message), descriptor.MessageTypes[20], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BoolMessage), descriptor.MessageTypes[21], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_TestOneof__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestOneof), descriptor.MessageTypes[22], - new string[] { "FooInt", "FooString", "FooMessage", }, new string[] { "Foo", }); - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), descriptor.MessageTypes[23], - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }, new string[] { }); - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), descriptor.MessageTypes[24], - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }, new string[] { }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), descriptor.MessageTypes[25], - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }, new string[] { }); - internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), descriptor.MessageTypes[26], - new string[] { "A", }, new string[] { }); - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooRequest), descriptor.MessageTypes[27], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooResponse), descriptor.MessageTypes[28], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), descriptor.MessageTypes[29], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), descriptor.MessageTypes[30], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarRequest), descriptor.MessageTypes[31], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarResponse), descriptor.MessageTypes[32], - new string[] { }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestAllTypes), typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum), typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), typeof(global::Google.Protobuf.TestProtos.ForeignMessage), typeof(global::Google.Protobuf.TestProtos.TestReservedFields), typeof(global::Google.Protobuf.TestProtos.TestForeignNested), typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), typeof(global::Google.Protobuf.TestProtos.OneString), typeof(global::Google.Protobuf.TestProtos.MoreString), typeof(global::Google.Protobuf.TestProtos.OneBytes), typeof(global::Google.Protobuf.TestProtos.MoreBytes), typeof(global::Google.Protobuf.TestProtos.Int32Message), typeof(global::Google.Protobuf.TestProtos.Uint32Message), typeof(global::Google.Protobuf.TestProtos.Int64Message), typeof(global::Google.Protobuf.TestProtos.Uint64Message), typeof(global::Google.Protobuf.TestProtos.BoolMessage), typeof(global::Google.Protobuf.TestProtos.TestOneof), typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), typeof(global::Google.Protobuf.TestProtos.FooRequest), typeof(global::Google.Protobuf.TestProtos.FooResponse), typeof(global::Google.Protobuf.TestProtos.FooClientMessage), typeof(global::Google.Protobuf.TestProtos.FooServerMessage), typeof(global::Google.Protobuf.TestProtos.BarRequest), typeof(global::Google.Protobuf.TestProtos.BarResponse), typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), }); } #endregion @@ -339,8 +196,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -454,6 +311,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt32FieldNumber = 1; private int singleInt32_; + [pbr::ProtobufField(1, "single_int32")] public int SingleInt32 { get { return singleInt32_; } set { @@ -464,6 +322,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt64FieldNumber = 2; private long singleInt64_; + [pbr::ProtobufField(2, "single_int64")] public long SingleInt64 { get { return singleInt64_; } set { @@ -474,6 +333,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint32FieldNumber = 3; private uint singleUint32_; + [pbr::ProtobufField(3, "single_uint32")] public uint SingleUint32 { get { return singleUint32_; } set { @@ -484,6 +344,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; + [pbr::ProtobufField(4, "single_uint64")] public ulong SingleUint64 { get { return singleUint64_; } set { @@ -494,6 +355,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint32FieldNumber = 5; private int singleSint32_; + [pbr::ProtobufField(5, "single_sint32")] public int SingleSint32 { get { return singleSint32_; } set { @@ -504,6 +366,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint64FieldNumber = 6; private long singleSint64_; + [pbr::ProtobufField(6, "single_sint64")] public long SingleSint64 { get { return singleSint64_; } set { @@ -514,6 +377,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; + [pbr::ProtobufField(7, "single_fixed32")] public uint SingleFixed32 { get { return singleFixed32_; } set { @@ -524,6 +388,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; + [pbr::ProtobufField(8, "single_fixed64")] public ulong SingleFixed64 { get { return singleFixed64_; } set { @@ -534,6 +399,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; + [pbr::ProtobufField(9, "single_sfixed32")] public int SingleSfixed32 { get { return singleSfixed32_; } set { @@ -544,6 +410,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; + [pbr::ProtobufField(10, "single_sfixed64")] public long SingleSfixed64 { get { return singleSfixed64_; } set { @@ -554,6 +421,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleFloatFieldNumber = 11; private float singleFloat_; + [pbr::ProtobufField(11, "single_float")] public float SingleFloat { get { return singleFloat_; } set { @@ -564,6 +432,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleDoubleFieldNumber = 12; private double singleDouble_; + [pbr::ProtobufField(12, "single_double")] public double SingleDouble { get { return singleDouble_; } set { @@ -574,6 +443,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleBoolFieldNumber = 13; private bool singleBool_; + [pbr::ProtobufField(13, "single_bool")] public bool SingleBool { get { return singleBool_; } set { @@ -584,6 +454,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleStringFieldNumber = 14; private string singleString_ = ""; + [pbr::ProtobufField(14, "single_string")] public string SingleString { get { return singleString_; } set { @@ -594,6 +465,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; + [pbr::ProtobufField(15, "single_bytes")] public pb::ByteString SingleBytes { get { return singleBytes_; } set { @@ -604,6 +476,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; + [pbr::ProtobufField(18, "single_nested_message")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -614,6 +487,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; + [pbr::ProtobufField(19, "single_foreign_message")] public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { get { return singleForeignMessage_; } set { @@ -624,6 +498,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; + [pbr::ProtobufField(20, "single_import_message")] public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { get { return singleImportMessage_; } set { @@ -634,6 +509,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.NESTED_ENUM_UNSPECIFIED; + [pbr::ProtobufField(21, "single_nested_enum")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { get { return singleNestedEnum_; } set { @@ -644,6 +520,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; + [pbr::ProtobufField(22, "single_foreign_enum")] public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { get { return singleForeignEnum_; } set { @@ -654,6 +531,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.IMPORT_ENUM_UNSPECIFIED; + [pbr::ProtobufField(23, "single_import_enum")] public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { get { return singleImportEnum_; } set { @@ -664,6 +542,7 @@ namespace Google.Protobuf.TestProtos { public const int SinglePublicImportMessageFieldNumber = 26; private global::Google.Protobuf.TestProtos.PublicImportMessage singlePublicImportMessage_; + [pbr::ProtobufField(26, "single_public_import_message")] public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -676,6 +555,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(31, "repeated_int32")] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -684,6 +564,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(32, "repeated_int64")] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -692,6 +573,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(33, "repeated_uint32")] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -700,6 +582,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(34, "repeated_uint64")] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -708,6 +591,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(35, "repeated_sint32")] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -716,6 +600,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(36, "repeated_sint64")] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -724,6 +609,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(37, "repeated_fixed32")] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -732,6 +618,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(38, "repeated_fixed64")] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -740,6 +627,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(39, "repeated_sfixed32")] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -748,6 +636,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(40, "repeated_sfixed64")] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -756,6 +645,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); + [pbr::ProtobufField(41, "repeated_float")] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -764,6 +654,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); + [pbr::ProtobufField(42, "repeated_double")] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -772,6 +663,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); + [pbr::ProtobufField(43, "repeated_bool")] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -780,6 +672,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); + [pbr::ProtobufField(44, "repeated_string")] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -788,6 +681,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); + [pbr::ProtobufField(45, "repeated_bytes")] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -796,6 +690,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); + [pbr::ProtobufField(48, "repeated_nested_message")] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -804,6 +699,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); + [pbr::ProtobufField(49, "repeated_foreign_message")] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -812,27 +708,34 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedImportMessage_codec = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); + [pbr::ProtobufField(50, "repeated_import_message")] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec - = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x);private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); + private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); + [pbr::ProtobufField(51, "repeated_nested_enum")] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec _repeated_repeatedForeignEnum_codec - = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); + [pbr::ProtobufField(52, "repeated_foreign_enum")] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } public const int RepeatedImportEnumFieldNumber = 53; private static readonly pb::FieldCodec _repeated_repeatedImportEnum_codec - = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x);private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); + private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); + [pbr::ProtobufField(53, "repeated_import_enum")] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -841,11 +744,13 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedPublicImportMessage_codec = pb::FieldCodec.ForMessage(434, global::Google.Protobuf.TestProtos.PublicImportMessage.Parser); private readonly pbc::RepeatedField repeatedPublicImportMessage_ = new pbc::RepeatedField(); + [pbr::ProtobufField(54, "repeated_public_import_message")] public pbc::RepeatedField RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } public const int OneofUint32FieldNumber = 111; + [pbr::ProtobufField(111, "oneof_uint32")] public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { @@ -856,6 +761,7 @@ namespace Google.Protobuf.TestProtos { } public const int OneofNestedMessageFieldNumber = 112; + [pbr::ProtobufField(112, "oneof_nested_message")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { @@ -866,6 +772,7 @@ namespace Google.Protobuf.TestProtos { } public const int OneofStringFieldNumber = 113; + [pbr::ProtobufField(113, "oneof_string")] public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { @@ -876,6 +783,7 @@ namespace Google.Protobuf.TestProtos { } public const int OneofBytesFieldNumber = 114; + [pbr::ProtobufField(114, "oneof_bytes")] public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -894,10 +802,12 @@ namespace Google.Protobuf.TestProtos { OneofBytes = 114, } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; + [pbr::ProtobufOneof("oneof_field")] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } + [pbr::ProtobufOneof("oneof_field")] public void ClearOneofField() { pb::Freezable.CheckMutable(this); oneofFieldCase_ = OneofFieldOneofCase.None; @@ -1640,8 +1550,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1670,6 +1580,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private int bb_; + [pbr::ProtobufField(1, "bb")] public int Bb { get { return bb_; } set { @@ -1764,8 +1675,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1799,6 +1710,7 @@ namespace Google.Protobuf.TestProtos { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; + [pbr::ProtobufField(1, "child")] public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { get { return child_; } set { @@ -1809,6 +1721,7 @@ namespace Google.Protobuf.TestProtos { public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; + [pbr::ProtobufField(2, "payload")] public global::Google.Protobuf.TestProtos.TestAllTypes Payload { get { return payload_; } set { @@ -1821,6 +1734,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedChild_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "repeated_child")] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } @@ -1943,8 +1857,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1974,6 +1888,7 @@ namespace Google.Protobuf.TestProtos { public const int DeprecatedInt32FieldNumber = 1; private int deprecatedInt32_; [global::System.ObsoleteAttribute()] + [pbr::ProtobufField(1, "deprecated_int32")] public int DeprecatedInt32 { get { return deprecatedInt32_; } set { @@ -2063,8 +1978,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2093,6 +2008,7 @@ namespace Google.Protobuf.TestProtos { public const int CFieldNumber = 1; private int c_; + [pbr::ProtobufField(1, "c")] public int C { get { return c_; } set { @@ -2182,8 +2098,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2274,8 +2190,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2305,6 +2221,7 @@ namespace Google.Protobuf.TestProtos { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; + [pbr::ProtobufField(1, "foreign_nested")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { @@ -2400,8 +2317,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2431,6 +2348,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private int a_; + [pbr::ProtobufField(1, "a")] public int A { get { return a_; } set { @@ -2441,6 +2359,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 268435455; private int bb_; + [pbr::ProtobufField(268435455, "bb")] public int Bb { get { return bb_; } set { @@ -2546,8 +2465,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[7]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2578,6 +2497,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; + [pbr::ProtobufField(1, "a")] public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { get { return a_; } set { @@ -2588,6 +2508,7 @@ namespace Google.Protobuf.TestProtos { public const int IFieldNumber = 2; private int i_; + [pbr::ProtobufField(2, "i")] public int I { get { return i_; } set { @@ -2699,8 +2620,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[8]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2730,6 +2651,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; + [pbr::ProtobufField(1, "bb")] public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { get { return bb_; } set { @@ -2825,8 +2747,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[9]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2857,6 +2779,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; + [pbr::ProtobufField(1, "a")] public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { get { return a_; } set { @@ -2867,6 +2790,7 @@ namespace Google.Protobuf.TestProtos { public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; + [pbr::ProtobufField(2, "optional_int32")] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -2978,8 +2902,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[10]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3020,6 +2944,7 @@ namespace Google.Protobuf.TestProtos { public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; + [pbr::ProtobufField(1, "PrimitiveField")] public int PrimitiveField { get { return primitiveField_; } set { @@ -3030,6 +2955,7 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 2; private string stringField_ = ""; + [pbr::ProtobufField(2, "StringField")] public string StringField { get { return stringField_; } set { @@ -3040,6 +2966,7 @@ namespace Google.Protobuf.TestProtos { public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; + [pbr::ProtobufField(3, "EnumField")] public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { get { return enumField_; } set { @@ -3050,6 +2977,7 @@ namespace Google.Protobuf.TestProtos { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; + [pbr::ProtobufField(4, "MessageField")] public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { get { return messageField_; } set { @@ -3062,6 +2990,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedPrimitiveField_codec = pb::FieldCodec.ForInt32(58); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(7, "RepeatedPrimitiveField")] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -3070,13 +2999,16 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedStringField_codec = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(8, "RepeatedStringField")] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } public const int RepeatedEnumFieldFieldNumber = 9; private static readonly pb::FieldCodec _repeated_repeatedEnumField_codec - = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(9, "RepeatedEnumField")] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -3085,6 +3017,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedMessageField_codec = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(10, "RepeatedMessageField")] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } @@ -3262,8 +3195,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[11]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3296,6 +3229,7 @@ namespace Google.Protobuf.TestProtos { public const int MyStringFieldNumber = 11; private string myString_ = ""; + [pbr::ProtobufField(11, "my_string")] public string MyString { get { return myString_; } set { @@ -3306,6 +3240,7 @@ namespace Google.Protobuf.TestProtos { public const int MyIntFieldNumber = 1; private long myInt_; + [pbr::ProtobufField(1, "my_int")] public long MyInt { get { return myInt_; } set { @@ -3316,6 +3251,7 @@ namespace Google.Protobuf.TestProtos { public const int MyFloatFieldNumber = 101; private float myFloat_; + [pbr::ProtobufField(101, "my_float")] public float MyFloat { get { return myFloat_; } set { @@ -3326,6 +3262,7 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; + [pbr::ProtobufField(200, "single_nested_message")] public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -3470,8 +3407,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3501,6 +3438,7 @@ namespace Google.Protobuf.TestProtos { public const int OoFieldNumber = 2; private long oo_; + [pbr::ProtobufField(2, "oo")] public long Oo { get { return oo_; } set { @@ -3511,6 +3449,7 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private int bb_; + [pbr::ProtobufField(1, "bb")] public int Bb { get { return bb_; } set { @@ -3621,8 +3560,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[12]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3651,6 +3590,7 @@ namespace Google.Protobuf.TestProtos { public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED; + [pbr::ProtobufField(1, "sparse_enum")] public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { get { return sparseEnum_; } set { @@ -3740,8 +3680,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[13]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3770,6 +3710,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private string data_ = ""; + [pbr::ProtobufField(1, "data")] public string Data { get { return data_; } set { @@ -3859,8 +3800,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[14]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreString__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3892,6 +3833,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_data_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "data")] public pbc::RepeatedField Data { get { return data_; } } @@ -3970,8 +3912,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[15]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4000,6 +3942,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; + [pbr::ProtobufField(1, "data")] public pb::ByteString Data { get { return data_; } set { @@ -4089,8 +4032,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[16]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4119,6 +4062,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; + [pbr::ProtobufField(1, "data")] public pb::ByteString Data { get { return data_; } set { @@ -4208,8 +4152,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[17]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4238,6 +4182,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private int data_; + [pbr::ProtobufField(1, "data")] public int Data { get { return data_; } set { @@ -4327,8 +4272,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[18]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4357,6 +4302,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private uint data_; + [pbr::ProtobufField(1, "data")] public uint Data { get { return data_; } set { @@ -4446,8 +4392,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[19]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4476,6 +4422,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private long data_; + [pbr::ProtobufField(1, "data")] public long Data { get { return data_; } set { @@ -4565,8 +4512,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[20]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4595,6 +4542,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private ulong data_; + [pbr::ProtobufField(1, "data")] public ulong Data { get { return data_; } set { @@ -4684,8 +4632,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[21]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4714,6 +4662,7 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private bool data_; + [pbr::ProtobufField(1, "data")] public bool Data { get { return data_; } set { @@ -4803,8 +4752,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[22]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4844,6 +4793,7 @@ namespace Google.Protobuf.TestProtos { } public const int FooIntFieldNumber = 1; + [pbr::ProtobufField(1, "foo_int")] public int FooInt { get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } set { @@ -4854,6 +4804,7 @@ namespace Google.Protobuf.TestProtos { } public const int FooStringFieldNumber = 2; + [pbr::ProtobufField(2, "foo_string")] public string FooString { get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } set { @@ -4864,6 +4815,7 @@ namespace Google.Protobuf.TestProtos { } public const int FooMessageFieldNumber = 3; + [pbr::ProtobufField(3, "foo_message")] public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } set { @@ -4881,10 +4833,12 @@ namespace Google.Protobuf.TestProtos { FooMessage = 3, } private FooOneofCase fooCase_ = FooOneofCase.None; + [pbr::ProtobufOneof("foo")] public FooOneofCase FooCase { get { return fooCase_; } } + [pbr::ProtobufOneof("foo")] public void ClearFoo() { pb::Freezable.CheckMutable(this); fooCase_ = FooOneofCase.None; @@ -5012,8 +4966,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[23]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5071,6 +5025,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedInt32_codec = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(90, "packed_int32")] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -5079,6 +5034,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedInt64_codec = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(91, "packed_int64")] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -5087,6 +5043,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedUint32_codec = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(92, "packed_uint32")] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -5095,6 +5052,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedUint64_codec = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(93, "packed_uint64")] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -5103,6 +5061,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSint32_codec = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(94, "packed_sint32")] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -5111,6 +5070,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSint64_codec = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(95, "packed_sint64")] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -5119,6 +5079,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFixed32_codec = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(96, "packed_fixed32")] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -5127,6 +5088,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFixed64_codec = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(97, "packed_fixed64")] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -5135,6 +5097,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSfixed32_codec = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(98, "packed_sfixed32")] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -5143,6 +5106,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSfixed64_codec = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(99, "packed_sfixed64")] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -5151,6 +5115,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFloat_codec = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); + [pbr::ProtobufField(100, "packed_float")] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -5159,6 +5124,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedDouble_codec = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); + [pbr::ProtobufField(101, "packed_double")] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -5167,13 +5133,16 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedBool_codec = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); + [pbr::ProtobufField(102, "packed_bool")] public pbc::RepeatedField PackedBool { get { return packedBool_; } } public const int PackedEnumFieldNumber = 103; private static readonly pb::FieldCodec _repeated_packedEnum_codec - = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); + [pbr::ProtobufField(103, "packed_enum")] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } @@ -5383,8 +5352,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[24]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5442,6 +5411,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedInt32_codec = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(90, "unpacked_int32")] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -5450,6 +5420,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedInt64_codec = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(91, "unpacked_int64")] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -5458,6 +5429,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedUint32_codec = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(92, "unpacked_uint32")] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -5466,6 +5438,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedUint64_codec = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(93, "unpacked_uint64")] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -5474,6 +5447,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSint32_codec = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(94, "unpacked_sint32")] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -5482,6 +5456,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSint64_codec = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(95, "unpacked_sint64")] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -5490,6 +5465,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFixed32_codec = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(96, "unpacked_fixed32")] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -5498,6 +5474,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFixed64_codec = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(97, "unpacked_fixed64")] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -5506,6 +5483,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSfixed32_codec = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(98, "unpacked_sfixed32")] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -5514,6 +5492,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSfixed64_codec = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(99, "unpacked_sfixed64")] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -5522,6 +5501,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFloat_codec = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); + [pbr::ProtobufField(100, "unpacked_float")] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -5530,6 +5510,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedDouble_codec = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); + [pbr::ProtobufField(101, "unpacked_double")] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -5538,13 +5519,16 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedBool_codec = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); + [pbr::ProtobufField(102, "unpacked_bool")] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } public const int UnpackedEnumFieldNumber = 103; private static readonly pb::FieldCodec _repeated_unpackedEnum_codec - = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); + = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); + [pbr::ProtobufField(103, "unpacked_enum")] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } @@ -5754,8 +5738,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[25]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5797,6 +5781,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(98); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(12, "repeated_fixed32")] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -5805,6 +5790,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(106); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); + [pbr::ProtobufField(13, "repeated_int32")] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -5813,6 +5799,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(16370); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2046, "repeated_fixed64")] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -5821,6 +5808,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(16378); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2047, "repeated_int64")] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -5829,6 +5817,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(2097138); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); + [pbr::ProtobufField(262142, "repeated_float")] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -5837,6 +5826,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(2097146); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); + [pbr::ProtobufField(262143, "repeated_uint64")] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -5966,8 +5956,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[26]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5996,6 +5986,7 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private string a_ = ""; + [pbr::ProtobufField(1, "a")] public string A { get { return a_; } set { @@ -6085,8 +6076,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[27]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6177,8 +6168,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[28]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6269,8 +6260,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[29]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6361,8 +6352,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[30]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6453,8 +6444,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[31]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6545,8 +6536,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[32]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index af7d83ba..cbfa2d5e 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -12,12 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestWellKnownTypes { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -164,30 +158,8 @@ namespace Google.Protobuf.TestProtos { "Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz", "dFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, - global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, - }); - internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), descriptor.MessageTypes[0], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); - internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), descriptor.MessageTypes[1], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); - internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), descriptor.MessageTypes[2], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { "OneofField", }); - internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), descriptor.MessageTypes[3], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }); } #endregion @@ -204,8 +176,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -260,6 +232,7 @@ namespace Google.Protobuf.TestProtos { public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; + [pbr::ProtobufField(1, "any_field")] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return anyField_; } set { @@ -270,6 +243,7 @@ namespace Google.Protobuf.TestProtos { public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; + [pbr::ProtobufField(2, "api_field")] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return apiField_; } set { @@ -280,6 +254,7 @@ namespace Google.Protobuf.TestProtos { public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; + [pbr::ProtobufField(3, "duration_field")] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return durationField_; } set { @@ -290,6 +265,7 @@ namespace Google.Protobuf.TestProtos { public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; + [pbr::ProtobufField(4, "empty_field")] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return emptyField_; } set { @@ -300,6 +276,7 @@ namespace Google.Protobuf.TestProtos { public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; + [pbr::ProtobufField(5, "field_mask_field")] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return fieldMaskField_; } set { @@ -310,6 +287,7 @@ namespace Google.Protobuf.TestProtos { public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; + [pbr::ProtobufField(6, "source_context_field")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return sourceContextField_; } set { @@ -320,6 +298,7 @@ namespace Google.Protobuf.TestProtos { public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; + [pbr::ProtobufField(7, "struct_field")] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return structField_; } set { @@ -330,6 +309,7 @@ namespace Google.Protobuf.TestProtos { public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; + [pbr::ProtobufField(8, "timestamp_field")] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return timestampField_; } set { @@ -340,6 +320,7 @@ namespace Google.Protobuf.TestProtos { public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; + [pbr::ProtobufField(9, "type_field")] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return typeField_; } set { @@ -351,6 +332,7 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _single_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField_; + [pbr::ProtobufField(10, "double_field")] public double? DoubleField { get { return doubleField_; } set { @@ -362,6 +344,7 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _single_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private float? floatField_; + [pbr::ProtobufField(11, "float_field")] public float? FloatField { get { return floatField_; } set { @@ -373,6 +356,7 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _single_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private long? int64Field_; + [pbr::ProtobufField(12, "int64_field")] public long? Int64Field { get { return int64Field_; } set { @@ -384,6 +368,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private ulong? uint64Field_; + [pbr::ProtobufField(13, "uint64_field")] public ulong? Uint64Field { get { return uint64Field_; } set { @@ -395,6 +380,7 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _single_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private int? int32Field_; + [pbr::ProtobufField(14, "int32_field")] public int? Int32Field { get { return int32Field_; } set { @@ -406,6 +392,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private uint? uint32Field_; + [pbr::ProtobufField(15, "uint32_field")] public uint? Uint32Field { get { return uint32Field_; } set { @@ -417,6 +404,7 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _single_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private bool? boolField_; + [pbr::ProtobufField(16, "bool_field")] public bool? BoolField { get { return boolField_; } set { @@ -428,6 +416,7 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _single_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private string stringField_; + [pbr::ProtobufField(17, "string_field")] public string StringField { get { return stringField_; } set { @@ -439,6 +428,7 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _single_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private pb::ByteString bytesField_; + [pbr::ProtobufField(18, "bytes_field")] public pb::ByteString BytesField { get { return bytesField_; } set { @@ -890,8 +880,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -957,6 +947,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_anyField_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField anyField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "any_field")] public pbc::RepeatedField AnyField { get { return anyField_; } } @@ -965,6 +956,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_apiField_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); private readonly pbc::RepeatedField apiField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "api_field")] public pbc::RepeatedField ApiField { get { return apiField_; } } @@ -973,6 +965,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_durationField_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField durationField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "duration_field")] public pbc::RepeatedField DurationField { get { return durationField_; } } @@ -981,6 +974,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_emptyField_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); private readonly pbc::RepeatedField emptyField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(4, "empty_field")] public pbc::RepeatedField EmptyField { get { return emptyField_; } } @@ -989,6 +983,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_fieldMaskField_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField fieldMaskField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(5, "field_mask_field")] public pbc::RepeatedField FieldMaskField { get { return fieldMaskField_; } } @@ -997,6 +992,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_sourceContextField_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); private readonly pbc::RepeatedField sourceContextField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(6, "source_context_field")] public pbc::RepeatedField SourceContextField { get { return sourceContextField_; } } @@ -1005,6 +1001,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_structField_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField structField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(7, "struct_field")] public pbc::RepeatedField StructField { get { return structField_; } } @@ -1013,6 +1010,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_timestampField_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField timestampField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(8, "timestamp_field")] public pbc::RepeatedField TimestampField { get { return timestampField_; } } @@ -1021,6 +1019,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_typeField_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); private readonly pbc::RepeatedField typeField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(9, "type_field")] public pbc::RepeatedField TypeField { get { return typeField_; } } @@ -1029,6 +1028,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private readonly pbc::RepeatedField doubleField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(10, "double_field")] public pbc::RepeatedField DoubleField { get { return doubleField_; } } @@ -1037,6 +1037,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private readonly pbc::RepeatedField floatField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(11, "float_field")] public pbc::RepeatedField FloatField { get { return floatField_; } } @@ -1045,6 +1046,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private readonly pbc::RepeatedField int64Field_ = new pbc::RepeatedField(); + [pbr::ProtobufField(12, "int64_field")] public pbc::RepeatedField Int64Field { get { return int64Field_; } } @@ -1053,6 +1055,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private readonly pbc::RepeatedField uint64Field_ = new pbc::RepeatedField(); + [pbr::ProtobufField(13, "uint64_field")] public pbc::RepeatedField Uint64Field { get { return uint64Field_; } } @@ -1061,6 +1064,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private readonly pbc::RepeatedField int32Field_ = new pbc::RepeatedField(); + [pbr::ProtobufField(14, "int32_field")] public pbc::RepeatedField Int32Field { get { return int32Field_; } } @@ -1069,6 +1073,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private readonly pbc::RepeatedField uint32Field_ = new pbc::RepeatedField(); + [pbr::ProtobufField(15, "uint32_field")] public pbc::RepeatedField Uint32Field { get { return uint32Field_; } } @@ -1077,6 +1082,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private readonly pbc::RepeatedField boolField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(16, "bool_field")] public pbc::RepeatedField BoolField { get { return boolField_; } } @@ -1085,6 +1091,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private readonly pbc::RepeatedField stringField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(17, "string_field")] public pbc::RepeatedField StringField { get { return stringField_; } } @@ -1093,6 +1100,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private readonly pbc::RepeatedField bytesField_ = new pbc::RepeatedField(); + [pbr::ProtobufField(18, "bytes_field")] public pbc::RepeatedField BytesField { get { return bytesField_; } } @@ -1324,8 +1332,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1410,6 +1418,7 @@ namespace Google.Protobuf.TestProtos { } public const int AnyFieldFieldNumber = 1; + [pbr::ProtobufField(1, "any_field")] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } set { @@ -1420,6 +1429,7 @@ namespace Google.Protobuf.TestProtos { } public const int ApiFieldFieldNumber = 2; + [pbr::ProtobufField(2, "api_field")] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } set { @@ -1430,6 +1440,7 @@ namespace Google.Protobuf.TestProtos { } public const int DurationFieldFieldNumber = 3; + [pbr::ProtobufField(3, "duration_field")] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } set { @@ -1440,6 +1451,7 @@ namespace Google.Protobuf.TestProtos { } public const int EmptyFieldFieldNumber = 4; + [pbr::ProtobufField(4, "empty_field")] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } set { @@ -1450,6 +1462,7 @@ namespace Google.Protobuf.TestProtos { } public const int FieldMaskFieldFieldNumber = 5; + [pbr::ProtobufField(5, "field_mask_field")] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } set { @@ -1460,6 +1473,7 @@ namespace Google.Protobuf.TestProtos { } public const int SourceContextFieldFieldNumber = 6; + [pbr::ProtobufField(6, "source_context_field")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } set { @@ -1470,6 +1484,7 @@ namespace Google.Protobuf.TestProtos { } public const int StructFieldFieldNumber = 7; + [pbr::ProtobufField(7, "struct_field")] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } set { @@ -1480,6 +1495,7 @@ namespace Google.Protobuf.TestProtos { } public const int TimestampFieldFieldNumber = 8; + [pbr::ProtobufField(8, "timestamp_field")] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } set { @@ -1490,6 +1506,7 @@ namespace Google.Protobuf.TestProtos { } public const int TypeFieldFieldNumber = 9; + [pbr::ProtobufField(9, "type_field")] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } set { @@ -1501,6 +1518,7 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); + [pbr::ProtobufField(10, "double_field")] public double? DoubleField { get { return oneofFieldCase_ == OneofFieldOneofCase.DoubleField ? (double?) oneofField_ : (double?) null; } set { @@ -1512,6 +1530,7 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper(90); + [pbr::ProtobufField(11, "float_field")] public float? FloatField { get { return oneofFieldCase_ == OneofFieldOneofCase.FloatField ? (float?) oneofField_ : (float?) null; } set { @@ -1523,6 +1542,7 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); + [pbr::ProtobufField(12, "int64_field")] public long? Int64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int64Field ? (long?) oneofField_ : (long?) null; } set { @@ -1534,6 +1554,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); + [pbr::ProtobufField(13, "uint64_field")] public ulong? Uint64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint64Field ? (ulong?) oneofField_ : (ulong?) null; } set { @@ -1545,6 +1566,7 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); + [pbr::ProtobufField(14, "int32_field")] public int? Int32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int32Field ? (int?) oneofField_ : (int?) null; } set { @@ -1556,6 +1578,7 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); + [pbr::ProtobufField(15, "uint32_field")] public uint? Uint32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint32Field ? (uint?) oneofField_ : (uint?) null; } set { @@ -1567,6 +1590,7 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper(130); + [pbr::ProtobufField(16, "bool_field")] public bool? BoolField { get { return oneofFieldCase_ == OneofFieldOneofCase.BoolField ? (bool?) oneofField_ : (bool?) null; } set { @@ -1578,6 +1602,7 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper(138); + [pbr::ProtobufField(17, "string_field")] public string StringField { get { return oneofFieldCase_ == OneofFieldOneofCase.StringField ? (string) oneofField_ : (string) null; } set { @@ -1589,6 +1614,7 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); + [pbr::ProtobufField(18, "bytes_field")] public pb::ByteString BytesField { get { return oneofFieldCase_ == OneofFieldOneofCase.BytesField ? (pb::ByteString) oneofField_ : (pb::ByteString) null; } set { @@ -1621,10 +1647,12 @@ namespace Google.Protobuf.TestProtos { BytesField = 18, } private OneofFieldOneofCase oneofFieldCase_ = OneofFieldOneofCase.None; + [pbr::ProtobufOneof("oneof_field")] public OneofFieldOneofCase OneofFieldCase { get { return oneofFieldCase_; } } + [pbr::ProtobufOneof("oneof_field")] public void ClearOneofField() { pb::Freezable.CheckMutable(this); oneofFieldCase_ = OneofFieldOneofCase.None; @@ -2023,8 +2051,8 @@ namespace Google.Protobuf.TestProtos { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2090,6 +2118,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_anyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); private readonly pbc::MapField anyField_ = new pbc::MapField(); + [pbr::ProtobufField(1, "any_field")] public pbc::MapField AnyField { get { return anyField_; } } @@ -2098,6 +2127,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_apiField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); private readonly pbc::MapField apiField_ = new pbc::MapField(); + [pbr::ProtobufField(2, "api_field")] public pbc::MapField ApiField { get { return apiField_; } } @@ -2106,6 +2136,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_durationField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); private readonly pbc::MapField durationField_ = new pbc::MapField(); + [pbr::ProtobufField(3, "duration_field")] public pbc::MapField DurationField { get { return durationField_; } } @@ -2114,6 +2145,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_emptyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); private readonly pbc::MapField emptyField_ = new pbc::MapField(); + [pbr::ProtobufField(4, "empty_field")] public pbc::MapField EmptyField { get { return emptyField_; } } @@ -2122,6 +2154,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_fieldMaskField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); private readonly pbc::MapField fieldMaskField_ = new pbc::MapField(); + [pbr::ProtobufField(5, "field_mask_field")] public pbc::MapField FieldMaskField { get { return fieldMaskField_; } } @@ -2130,6 +2163,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_sourceContextField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); private readonly pbc::MapField sourceContextField_ = new pbc::MapField(); + [pbr::ProtobufField(6, "source_context_field")] public pbc::MapField SourceContextField { get { return sourceContextField_; } } @@ -2138,6 +2172,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_structField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); private readonly pbc::MapField structField_ = new pbc::MapField(); + [pbr::ProtobufField(7, "struct_field")] public pbc::MapField StructField { get { return structField_; } } @@ -2146,6 +2181,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_timestampField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); private readonly pbc::MapField timestampField_ = new pbc::MapField(); + [pbr::ProtobufField(8, "timestamp_field")] public pbc::MapField TimestampField { get { return timestampField_; } } @@ -2154,6 +2190,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_typeField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); private readonly pbc::MapField typeField_ = new pbc::MapField(); + [pbr::ProtobufField(9, "type_field")] public pbc::MapField TypeField { get { return typeField_; } } @@ -2162,6 +2199,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_doubleField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 82); private readonly pbc::MapField doubleField_ = new pbc::MapField(true); + [pbr::ProtobufField(10, "double_field")] public pbc::MapField DoubleField { get { return doubleField_; } } @@ -2170,6 +2208,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_floatField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 90); private readonly pbc::MapField floatField_ = new pbc::MapField(true); + [pbr::ProtobufField(11, "float_field")] public pbc::MapField FloatField { get { return floatField_; } } @@ -2178,6 +2217,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_int64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 98); private readonly pbc::MapField int64Field_ = new pbc::MapField(true); + [pbr::ProtobufField(12, "int64_field")] public pbc::MapField Int64Field { get { return int64Field_; } } @@ -2186,6 +2226,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_uint64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 106); private readonly pbc::MapField uint64Field_ = new pbc::MapField(true); + [pbr::ProtobufField(13, "uint64_field")] public pbc::MapField Uint64Field { get { return uint64Field_; } } @@ -2194,6 +2235,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_int32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 114); private readonly pbc::MapField int32Field_ = new pbc::MapField(true); + [pbr::ProtobufField(14, "int32_field")] public pbc::MapField Int32Field { get { return int32Field_; } } @@ -2202,6 +2244,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_uint32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 122); private readonly pbc::MapField uint32Field_ = new pbc::MapField(true); + [pbr::ProtobufField(15, "uint32_field")] public pbc::MapField Uint32Field { get { return uint32Field_; } } @@ -2210,6 +2253,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_boolField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 130); private readonly pbc::MapField boolField_ = new pbc::MapField(true); + [pbr::ProtobufField(16, "bool_field")] public pbc::MapField BoolField { get { return boolField_; } } @@ -2218,6 +2262,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_stringField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 138); private readonly pbc::MapField stringField_ = new pbc::MapField(true); + [pbr::ProtobufField(17, "string_field")] public pbc::MapField StringField { get { return stringField_; } } @@ -2226,6 +2271,7 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_bytesField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 146); private readonly pbc::MapField bytesField_ = new pbc::MapField(true); + [pbr::ProtobufField(18, "bytes_field")] public pbc::MapField BytesField { get { return bytesField_; } } diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs index c87969b9..6565982c 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs @@ -12,30 +12,6 @@ namespace Google.Protobuf.Reflection { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] internal static partial class DescriptorProtoFile { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -157,74 +133,8 @@ namespace Google.Protobuf.Reflection { "clByb3Rvc0gBWgpkZXNjcmlwdG9yogIDR1BCqgIaR29vZ2xlLlByb3RvYnVm", "LlJlZmxlY3Rpb24=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), descriptor.MessageTypes[0], - new string[] { "File", }, new string[] { }); - internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), descriptor.MessageTypes[1], - new string[] { "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax", }, new string[] { }); - internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.DescriptorProto), descriptor.MessageTypes[2], - new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName", }, new string[] { }); - internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), descriptor.MessageTypes[2].NestedTypes[0], - new string[] { "Start", "End", }, new string[] { }); - internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), descriptor.MessageTypes[2].NestedTypes[1], - new string[] { "Start", "End", }, new string[] { }); - internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), descriptor.MessageTypes[3], - new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "Options", }, new string[] { }); - internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), descriptor.MessageTypes[4], - new string[] { "Name", }, new string[] { }); - internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), descriptor.MessageTypes[5], - new string[] { "Name", "Value", "Options", }, new string[] { }); - internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), descriptor.MessageTypes[6], - new string[] { "Name", "Number", "Options", }, new string[] { }); - internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), descriptor.MessageTypes[7], - new string[] { "Name", "Method", "Options", }, new string[] { }); - internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), descriptor.MessageTypes[8], - new string[] { "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming", }, new string[] { }); - internal__static_google_protobuf_FileOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.FileOptions), descriptor.MessageTypes[9], - new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_MessageOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.MessageOptions), descriptor.MessageTypes[10], - new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_FieldOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.FieldOptions), descriptor.MessageTypes[11], - new string[] { "Ctype", "Packed", "Jstype", "Lazy", "Deprecated", "Weak", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_EnumOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.EnumOptions), descriptor.MessageTypes[12], - new string[] { "AllowAlias", "Deprecated", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.EnumValueOptions), descriptor.MessageTypes[13], - new string[] { "Deprecated", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.ServiceOptions), descriptor.MessageTypes[14], - new string[] { "Deprecated", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_MethodOptions__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.MethodOptions), descriptor.MessageTypes[15], - new string[] { "Deprecated", "UninterpretedOption", }, new string[] { }); - internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.UninterpretedOption), descriptor.MessageTypes[16], - new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }, new string[] { }); - internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), descriptor.MessageTypes[16].NestedTypes[0], - new string[] { "NamePart_", "IsExtension", }, new string[] { }); - internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), descriptor.MessageTypes[17], - new string[] { "Location", }, new string[] { }); - internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), descriptor.MessageTypes[17].NestedTypes[0], - new string[] { "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), typeof(global::Google.Protobuf.Reflection.DescriptorProto), typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label), typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), typeof(global::Google.Protobuf.Reflection.FileOptions), typeof(global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode), typeof(global::Google.Protobuf.Reflection.MessageOptions), typeof(global::Google.Protobuf.Reflection.FieldOptions), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.CType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.JSType), typeof(global::Google.Protobuf.Reflection.EnumOptions), typeof(global::Google.Protobuf.Reflection.EnumValueOptions), typeof(global::Google.Protobuf.Reflection.ServiceOptions), typeof(global::Google.Protobuf.Reflection.MethodOptions), typeof(global::Google.Protobuf.Reflection.UninterpretedOption), typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), }); } #endregion @@ -241,8 +151,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -274,6 +184,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_file_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "file")] internal pbc::RepeatedField File { get { return file_; } } @@ -352,8 +263,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -402,6 +313,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -412,6 +324,7 @@ namespace Google.Protobuf.Reflection { public const int PackageFieldNumber = 2; private string package_ = ""; + [pbr::ProtobufField(2, "package")] internal string Package { get { return package_; } set { @@ -424,6 +337,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_dependency_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField dependency_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "dependency")] internal pbc::RepeatedField Dependency { get { return dependency_; } } @@ -432,6 +346,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_publicDependency_codec = pb::FieldCodec.ForInt32(80); private readonly pbc::RepeatedField publicDependency_ = new pbc::RepeatedField(); + [pbr::ProtobufField(10, "public_dependency")] internal pbc::RepeatedField PublicDependency { get { return publicDependency_; } } @@ -440,6 +355,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_weakDependency_codec = pb::FieldCodec.ForInt32(88); private readonly pbc::RepeatedField weakDependency_ = new pbc::RepeatedField(); + [pbr::ProtobufField(11, "weak_dependency")] internal pbc::RepeatedField WeakDependency { get { return weakDependency_; } } @@ -448,6 +364,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_messageType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField messageType_ = new pbc::RepeatedField(); + [pbr::ProtobufField(4, "message_type")] internal pbc::RepeatedField MessageType { get { return messageType_; } } @@ -456,6 +373,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); + [pbr::ProtobufField(5, "enum_type")] internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -464,6 +382,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_service_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); + [pbr::ProtobufField(6, "service")] internal pbc::RepeatedField Service { get { return service_; } } @@ -472,12 +391,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); + [pbr::ProtobufField(7, "extension")] internal pbc::RepeatedField Extension { get { return extension_; } } public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FileOptions options_; + [pbr::ProtobufField(8, "options")] internal global::Google.Protobuf.Reflection.FileOptions Options { get { return options_; } set { @@ -488,6 +409,7 @@ namespace Google.Protobuf.Reflection { public const int SourceCodeInfoFieldNumber = 9; private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_; + [pbr::ProtobufField(9, "source_code_info")] internal global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { @@ -498,6 +420,7 @@ namespace Google.Protobuf.Reflection { public const int SyntaxFieldNumber = 12; private string syntax_ = ""; + [pbr::ProtobufField(12, "syntax")] internal string Syntax { get { return syntax_; } set { @@ -728,8 +651,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -776,6 +699,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -788,6 +712,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_field_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField field_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "field")] internal pbc::RepeatedField Field { get { return field_; } } @@ -796,6 +721,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); + [pbr::ProtobufField(6, "extension")] internal pbc::RepeatedField Extension { get { return extension_; } } @@ -804,6 +730,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_nestedType_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField nestedType_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "nested_type")] internal pbc::RepeatedField NestedType { get { return nestedType_; } } @@ -812,6 +739,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); + [pbr::ProtobufField(4, "enum_type")] internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -820,6 +748,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extensionRange_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); private readonly pbc::RepeatedField extensionRange_ = new pbc::RepeatedField(); + [pbr::ProtobufField(5, "extension_range")] internal pbc::RepeatedField ExtensionRange { get { return extensionRange_; } } @@ -828,12 +757,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_oneofDecl_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); private readonly pbc::RepeatedField oneofDecl_ = new pbc::RepeatedField(); + [pbr::ProtobufField(8, "oneof_decl")] internal pbc::RepeatedField OneofDecl { get { return oneofDecl_; } } public const int OptionsFieldNumber = 7; private global::Google.Protobuf.Reflection.MessageOptions options_; + [pbr::ProtobufField(7, "options")] internal global::Google.Protobuf.Reflection.MessageOptions Options { get { return options_; } set { @@ -846,6 +777,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_reservedRange_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); + [pbr::ProtobufField(9, "reserved_range")] internal pbc::RepeatedField ReservedRange { get { return reservedRange_; } } @@ -854,6 +786,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_reservedName_codec = pb::FieldCodec.ForString(82); private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); + [pbr::ProtobufField(10, "reserved_name")] internal pbc::RepeatedField ReservedName { get { return reservedName_; } } @@ -1034,8 +967,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1065,6 +998,7 @@ namespace Google.Protobuf.Reflection { public const int StartFieldNumber = 1; private int start_; + [pbr::ProtobufField(1, "start")] internal int Start { get { return start_; } set { @@ -1075,6 +1009,7 @@ namespace Google.Protobuf.Reflection { public const int EndFieldNumber = 2; private int end_; + [pbr::ProtobufField(2, "end")] internal int End { get { return end_; } set { @@ -1180,8 +1115,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1211,6 +1146,7 @@ namespace Google.Protobuf.Reflection { public const int StartFieldNumber = 1; private int start_; + [pbr::ProtobufField(1, "start")] internal int Start { get { return start_; } set { @@ -1221,6 +1157,7 @@ namespace Google.Protobuf.Reflection { public const int EndFieldNumber = 2; private int end_; + [pbr::ProtobufField(2, "end")] internal int End { get { return end_; } set { @@ -1331,8 +1268,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1370,6 +1307,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1380,6 +1318,7 @@ namespace Google.Protobuf.Reflection { public const int NumberFieldNumber = 3; private int number_; + [pbr::ProtobufField(3, "number")] internal int Number { get { return number_; } set { @@ -1390,6 +1329,7 @@ namespace Google.Protobuf.Reflection { public const int LabelFieldNumber = 4; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; + [pbr::ProtobufField(4, "label")] internal global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { get { return label_; } set { @@ -1400,6 +1340,7 @@ namespace Google.Protobuf.Reflection { public const int TypeFieldNumber = 5; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; + [pbr::ProtobufField(5, "type")] internal global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { get { return type_; } set { @@ -1410,6 +1351,7 @@ namespace Google.Protobuf.Reflection { public const int TypeNameFieldNumber = 6; private string typeName_ = ""; + [pbr::ProtobufField(6, "type_name")] internal string TypeName { get { return typeName_; } set { @@ -1420,6 +1362,7 @@ namespace Google.Protobuf.Reflection { public const int ExtendeeFieldNumber = 2; private string extendee_ = ""; + [pbr::ProtobufField(2, "extendee")] internal string Extendee { get { return extendee_; } set { @@ -1430,6 +1373,7 @@ namespace Google.Protobuf.Reflection { public const int DefaultValueFieldNumber = 7; private string defaultValue_ = ""; + [pbr::ProtobufField(7, "default_value")] internal string DefaultValue { get { return defaultValue_; } set { @@ -1440,6 +1384,7 @@ namespace Google.Protobuf.Reflection { public const int OneofIndexFieldNumber = 9; private int oneofIndex_; + [pbr::ProtobufField(9, "oneof_index")] internal int OneofIndex { get { return oneofIndex_; } set { @@ -1450,6 +1395,7 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FieldOptions options_; + [pbr::ProtobufField(8, "options")] internal global::Google.Protobuf.Reflection.FieldOptions Options { get { return options_; } set { @@ -1706,8 +1652,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1736,6 +1682,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1825,8 +1772,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1859,6 +1806,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1871,12 +1819,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_value_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "value")] internal pbc::RepeatedField Value { get { return value_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumOptions options_; + [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.EnumOptions Options { get { return options_; } set { @@ -1997,8 +1947,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2030,6 +1980,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -2040,6 +1991,7 @@ namespace Google.Protobuf.Reflection { public const int NumberFieldNumber = 2; private int number_; + [pbr::ProtobufField(2, "number")] internal int Number { get { return number_; } set { @@ -2050,6 +2002,7 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumValueOptions options_; + [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.EnumValueOptions Options { get { return options_; } set { @@ -2177,8 +2130,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[7]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2211,6 +2164,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -2223,12 +2177,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_method_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); private readonly pbc::RepeatedField method_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "method")] internal pbc::RepeatedField Method { get { return method_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ServiceOptions options_; + [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.ServiceOptions Options { get { return options_; } set { @@ -2349,8 +2305,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[8]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2385,6 +2341,7 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -2395,6 +2352,7 @@ namespace Google.Protobuf.Reflection { public const int InputTypeFieldNumber = 2; private string inputType_ = ""; + [pbr::ProtobufField(2, "input_type")] internal string InputType { get { return inputType_; } set { @@ -2405,6 +2363,7 @@ namespace Google.Protobuf.Reflection { public const int OutputTypeFieldNumber = 3; private string outputType_ = ""; + [pbr::ProtobufField(3, "output_type")] internal string OutputType { get { return outputType_; } set { @@ -2415,6 +2374,7 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 4; private global::Google.Protobuf.Reflection.MethodOptions options_; + [pbr::ProtobufField(4, "options")] internal global::Google.Protobuf.Reflection.MethodOptions Options { get { return options_; } set { @@ -2425,6 +2385,7 @@ namespace Google.Protobuf.Reflection { public const int ClientStreamingFieldNumber = 5; private bool clientStreaming_; + [pbr::ProtobufField(5, "client_streaming")] internal bool ClientStreaming { get { return clientStreaming_; } set { @@ -2435,6 +2396,7 @@ namespace Google.Protobuf.Reflection { public const int ServerStreamingFieldNumber = 6; private bool serverStreaming_; + [pbr::ProtobufField(6, "server_streaming")] internal bool ServerStreaming { get { return serverStreaming_; } set { @@ -2610,8 +2572,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[9]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2655,6 +2617,7 @@ namespace Google.Protobuf.Reflection { public const int JavaPackageFieldNumber = 1; private string javaPackage_ = ""; + [pbr::ProtobufField(1, "java_package")] internal string JavaPackage { get { return javaPackage_; } set { @@ -2665,6 +2628,7 @@ namespace Google.Protobuf.Reflection { public const int JavaOuterClassnameFieldNumber = 8; private string javaOuterClassname_ = ""; + [pbr::ProtobufField(8, "java_outer_classname")] internal string JavaOuterClassname { get { return javaOuterClassname_; } set { @@ -2675,6 +2639,7 @@ namespace Google.Protobuf.Reflection { public const int JavaMultipleFilesFieldNumber = 10; private bool javaMultipleFiles_; + [pbr::ProtobufField(10, "java_multiple_files")] internal bool JavaMultipleFiles { get { return javaMultipleFiles_; } set { @@ -2685,6 +2650,7 @@ namespace Google.Protobuf.Reflection { public const int JavaGenerateEqualsAndHashFieldNumber = 20; private bool javaGenerateEqualsAndHash_; + [pbr::ProtobufField(20, "java_generate_equals_and_hash")] internal bool JavaGenerateEqualsAndHash { get { return javaGenerateEqualsAndHash_; } set { @@ -2695,6 +2661,7 @@ namespace Google.Protobuf.Reflection { public const int JavaStringCheckUtf8FieldNumber = 27; private bool javaStringCheckUtf8_; + [pbr::ProtobufField(27, "java_string_check_utf8")] internal bool JavaStringCheckUtf8 { get { return javaStringCheckUtf8_; } set { @@ -2705,6 +2672,7 @@ namespace Google.Protobuf.Reflection { public const int OptimizeForFieldNumber = 9; private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED; + [pbr::ProtobufField(9, "optimize_for")] internal global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { get { return optimizeFor_; } set { @@ -2715,6 +2683,7 @@ namespace Google.Protobuf.Reflection { public const int GoPackageFieldNumber = 11; private string goPackage_ = ""; + [pbr::ProtobufField(11, "go_package")] internal string GoPackage { get { return goPackage_; } set { @@ -2725,6 +2694,7 @@ namespace Google.Protobuf.Reflection { public const int CcGenericServicesFieldNumber = 16; private bool ccGenericServices_; + [pbr::ProtobufField(16, "cc_generic_services")] internal bool CcGenericServices { get { return ccGenericServices_; } set { @@ -2735,6 +2705,7 @@ namespace Google.Protobuf.Reflection { public const int JavaGenericServicesFieldNumber = 17; private bool javaGenericServices_; + [pbr::ProtobufField(17, "java_generic_services")] internal bool JavaGenericServices { get { return javaGenericServices_; } set { @@ -2745,6 +2716,7 @@ namespace Google.Protobuf.Reflection { public const int PyGenericServicesFieldNumber = 18; private bool pyGenericServices_; + [pbr::ProtobufField(18, "py_generic_services")] internal bool PyGenericServices { get { return pyGenericServices_; } set { @@ -2755,6 +2727,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 23; private bool deprecated_; + [pbr::ProtobufField(23, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -2765,6 +2738,7 @@ namespace Google.Protobuf.Reflection { public const int CcEnableArenasFieldNumber = 31; private bool ccEnableArenas_; + [pbr::ProtobufField(31, "cc_enable_arenas")] internal bool CcEnableArenas { get { return ccEnableArenas_; } set { @@ -2775,6 +2749,7 @@ namespace Google.Protobuf.Reflection { public const int ObjcClassPrefixFieldNumber = 36; private string objcClassPrefix_ = ""; + [pbr::ProtobufField(36, "objc_class_prefix")] internal string ObjcClassPrefix { get { return objcClassPrefix_; } set { @@ -2785,6 +2760,7 @@ namespace Google.Protobuf.Reflection { public const int CsharpNamespaceFieldNumber = 37; private string csharpNamespace_ = ""; + [pbr::ProtobufField(37, "csharp_namespace")] internal string CsharpNamespace { get { return csharpNamespace_; } set { @@ -2797,6 +2773,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3111,8 +3088,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[10]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3146,6 +3123,7 @@ namespace Google.Protobuf.Reflection { public const int MessageSetWireFormatFieldNumber = 1; private bool messageSetWireFormat_; + [pbr::ProtobufField(1, "message_set_wire_format")] internal bool MessageSetWireFormat { get { return messageSetWireFormat_; } set { @@ -3156,6 +3134,7 @@ namespace Google.Protobuf.Reflection { public const int NoStandardDescriptorAccessorFieldNumber = 2; private bool noStandardDescriptorAccessor_; + [pbr::ProtobufField(2, "no_standard_descriptor_accessor")] internal bool NoStandardDescriptorAccessor { get { return noStandardDescriptorAccessor_; } set { @@ -3166,6 +3145,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; + [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3176,6 +3156,7 @@ namespace Google.Protobuf.Reflection { public const int MapEntryFieldNumber = 7; private bool mapEntry_; + [pbr::ProtobufField(7, "map_entry")] internal bool MapEntry { get { return mapEntry_; } set { @@ -3188,6 +3169,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3330,8 +3312,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[11]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3367,6 +3349,7 @@ namespace Google.Protobuf.Reflection { public const int CtypeFieldNumber = 1; private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING; + [pbr::ProtobufField(1, "ctype")] internal global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { get { return ctype_; } set { @@ -3377,6 +3360,7 @@ namespace Google.Protobuf.Reflection { public const int PackedFieldNumber = 2; private bool packed_; + [pbr::ProtobufField(2, "packed")] internal bool Packed { get { return packed_; } set { @@ -3387,6 +3371,7 @@ namespace Google.Protobuf.Reflection { public const int JstypeFieldNumber = 6; private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL; + [pbr::ProtobufField(6, "jstype")] internal global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { get { return jstype_; } set { @@ -3397,6 +3382,7 @@ namespace Google.Protobuf.Reflection { public const int LazyFieldNumber = 5; private bool lazy_; + [pbr::ProtobufField(5, "lazy")] internal bool Lazy { get { return lazy_; } set { @@ -3407,6 +3393,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; + [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3417,6 +3404,7 @@ namespace Google.Protobuf.Reflection { public const int WeakFieldNumber = 10; private bool weak_; + [pbr::ProtobufField(10, "weak")] internal bool Weak { get { return weak_; } set { @@ -3429,6 +3417,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3621,8 +3610,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[12]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3654,6 +3643,7 @@ namespace Google.Protobuf.Reflection { public const int AllowAliasFieldNumber = 2; private bool allowAlias_; + [pbr::ProtobufField(2, "allow_alias")] internal bool AllowAlias { get { return allowAlias_; } set { @@ -3664,6 +3654,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; + [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3676,6 +3667,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3786,8 +3778,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[13]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3818,6 +3810,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 1; private bool deprecated_; + [pbr::ProtobufField(1, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3830,6 +3823,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3924,8 +3918,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[14]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3956,6 +3950,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 33; private bool deprecated_; + [pbr::ProtobufField(33, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3968,6 +3963,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -4062,8 +4058,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[15]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4094,6 +4090,7 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 33; private bool deprecated_; + [pbr::ProtobufField(33, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -4106,6 +4103,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); + [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -4200,8 +4198,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[16]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4239,12 +4237,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_name_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); private readonly pbc::RepeatedField name_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "name")] internal pbc::RepeatedField Name { get { return name_; } } public const int IdentifierValueFieldNumber = 3; private string identifierValue_ = ""; + [pbr::ProtobufField(3, "identifier_value")] internal string IdentifierValue { get { return identifierValue_; } set { @@ -4255,6 +4255,7 @@ namespace Google.Protobuf.Reflection { public const int PositiveIntValueFieldNumber = 4; private ulong positiveIntValue_; + [pbr::ProtobufField(4, "positive_int_value")] internal ulong PositiveIntValue { get { return positiveIntValue_; } set { @@ -4265,6 +4266,7 @@ namespace Google.Protobuf.Reflection { public const int NegativeIntValueFieldNumber = 5; private long negativeIntValue_; + [pbr::ProtobufField(5, "negative_int_value")] internal long NegativeIntValue { get { return negativeIntValue_; } set { @@ -4275,6 +4277,7 @@ namespace Google.Protobuf.Reflection { public const int DoubleValueFieldNumber = 6; private double doubleValue_; + [pbr::ProtobufField(6, "double_value")] internal double DoubleValue { get { return doubleValue_; } set { @@ -4285,6 +4288,7 @@ namespace Google.Protobuf.Reflection { public const int StringValueFieldNumber = 7; private pb::ByteString stringValue_ = pb::ByteString.Empty; + [pbr::ProtobufField(7, "string_value")] internal pb::ByteString StringValue { get { return stringValue_; } set { @@ -4295,6 +4299,7 @@ namespace Google.Protobuf.Reflection { public const int AggregateValueFieldNumber = 8; private string aggregateValue_ = ""; + [pbr::ProtobufField(8, "aggregate_value")] internal string AggregateValue { get { return aggregateValue_; } set { @@ -4474,8 +4479,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.UninterpretedOption.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4505,6 +4510,7 @@ namespace Google.Protobuf.Reflection { public const int NamePart_FieldNumber = 1; private string namePart_ = ""; + [pbr::ProtobufField(1, "name_part")] internal string NamePart_ { get { return namePart_; } set { @@ -4515,6 +4521,7 @@ namespace Google.Protobuf.Reflection { public const int IsExtensionFieldNumber = 2; private bool isExtension_; + [pbr::ProtobufField(2, "is_extension")] internal bool IsExtension { get { return isExtension_; } set { @@ -4625,8 +4632,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[17]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4658,6 +4665,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_location_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser); private readonly pbc::RepeatedField location_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "location")] internal pbc::RepeatedField Location { get { return location_; } } @@ -4737,8 +4745,8 @@ namespace Google.Protobuf.Reflection { get { return global::Google.Protobuf.Reflection.SourceCodeInfo.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4776,6 +4784,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_path_codec = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "path")] internal pbc::RepeatedField Path { get { return path_; } } @@ -4784,12 +4793,14 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_span_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField span_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "span")] internal pbc::RepeatedField Span { get { return span_; } } public const int LeadingCommentsFieldNumber = 3; private string leadingComments_ = ""; + [pbr::ProtobufField(3, "leading_comments")] internal string LeadingComments { get { return leadingComments_; } set { @@ -4800,6 +4811,7 @@ namespace Google.Protobuf.Reflection { public const int TrailingCommentsFieldNumber = 4; private string trailingComments_ = ""; + [pbr::ProtobufField(4, "trailing_comments")] internal string TrailingComments { get { return trailingComments_; } set { @@ -4812,6 +4824,7 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_leadingDetachedComments_codec = pb::FieldCodec.ForString(50); private readonly pbc::RepeatedField leadingDetachedComments_ = new pbc::RepeatedField(); + [pbr::ProtobufField(6, "leading_detached_comments")] internal pbc::RepeatedField LeadingDetachedComments { get { return leadingDetachedComments_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 64d52ac5..41fd892b 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Any { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Any__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -31,11 +28,8 @@ namespace Google.Protobuf.WellKnownTypes { "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n", "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_Any__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Any), descriptor.MessageTypes[0], - new string[] { "TypeUrl", "Value", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Any), }); } #endregion @@ -53,8 +47,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Any.internal__static_google_protobuf_Any__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -84,6 +78,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int TypeUrlFieldNumber = 1; private string typeUrl_ = ""; + [pbr::ProtobufField(1, "type_url")] public string TypeUrl { get { return typeUrl_; } set { @@ -94,6 +89,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 2; private pb::ByteString value_ = pb::ByteString.Empty; + [pbr::ProtobufField(2, "value")] public pb::ByteString Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index 1e2506a4..65f6d9b5 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -14,10 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Api { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Api__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Method__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -41,16 +37,8 @@ namespace Google.Protobuf.WellKnownTypes { "dG9QAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, - }); - internal__static_google_protobuf_Api__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Api), descriptor.MessageTypes[0], - new string[] { "Name", "Methods", "Options", "Version", "SourceContext", }, new string[] { }); - internal__static_google_protobuf_Method__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Method), descriptor.MessageTypes[1], - new string[] { "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Api), typeof(global::Google.Protobuf.WellKnownTypes.Method), }); } #endregion @@ -68,8 +56,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.internal__static_google_protobuf_Api__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -105,6 +93,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -117,6 +106,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_methods_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "methods")] public pbc::RepeatedField Methods { get { return methods_; } } @@ -125,12 +115,14 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int VersionFieldNumber = 4; private string version_ = ""; + [pbr::ProtobufField(4, "version")] public string Version { get { return version_; } set { @@ -141,6 +133,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + [pbr::ProtobufField(5, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -286,8 +279,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.internal__static_google_protobuf_Method__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -322,6 +315,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -332,6 +326,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int RequestTypeUrlFieldNumber = 2; private string requestTypeUrl_ = ""; + [pbr::ProtobufField(2, "request_type_url")] public string RequestTypeUrl { get { return requestTypeUrl_; } set { @@ -342,6 +337,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int RequestStreamingFieldNumber = 3; private bool requestStreaming_; + [pbr::ProtobufField(3, "request_streaming")] public bool RequestStreaming { get { return requestStreaming_; } set { @@ -352,6 +348,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ResponseTypeUrlFieldNumber = 4; private string responseTypeUrl_ = ""; + [pbr::ProtobufField(4, "response_type_url")] public string ResponseTypeUrl { get { return responseTypeUrl_; } set { @@ -362,6 +359,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ResponseStreamingFieldNumber = 5; private bool responseStreaming_; + [pbr::ProtobufField(5, "response_streaming")] public bool ResponseStreaming { get { return responseStreaming_; } set { @@ -374,6 +372,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(6, "options")] public pbc::RepeatedField Options { get { return options_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index fbc9c007..d00e8b74 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Duration { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Duration__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -32,11 +29,8 @@ namespace Google.Protobuf.WellKnownTypes { "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", "dG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_Duration__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Duration), descriptor.MessageTypes[0], - new string[] { "Seconds", "Nanos", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Duration), }); } #endregion @@ -54,8 +48,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Duration.internal__static_google_protobuf_Duration__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -85,6 +79,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int SecondsFieldNumber = 1; private long seconds_; + [pbr::ProtobufField(1, "seconds")] public long Seconds { get { return seconds_; } set { @@ -95,6 +90,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NanosFieldNumber = 2; private int nanos_; + [pbr::ProtobufField(2, "nanos")] public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index c2681e29..eb7dd937 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Empty { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Empty__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -31,11 +28,8 @@ namespace Google.Protobuf.WellKnownTypes { "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_Empty__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Empty), descriptor.MessageTypes[0], - new string[] { }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Empty), }); } #endregion @@ -53,8 +47,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Empty.internal__static_google_protobuf_Empty__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 310c0d21..16c961ed 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class FieldMask { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FieldMask__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -31,11 +28,8 @@ namespace Google.Protobuf.WellKnownTypes { "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABogIDR1BCqgIeR29vZ2xl", "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_FieldMask__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), descriptor.MessageTypes[0], - new string[] { "Paths", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), }); } #endregion @@ -53,8 +47,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.internal__static_google_protobuf_FieldMask__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -86,6 +80,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_paths_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField paths_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "paths")] public pbc::RepeatedField Paths { get { return paths_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index ee60fbe9..b94fe072 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class SourceContext { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_SourceContext__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -32,11 +29,8 @@ namespace Google.Protobuf.WellKnownTypes { "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", "dG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_SourceContext__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.SourceContext), descriptor.MessageTypes[0], - new string[] { "FileName", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.SourceContext), }); } #endregion @@ -54,8 +48,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.internal__static_google_protobuf_SourceContext__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -84,6 +78,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int FileNameFieldNumber = 1; private string fileName_ = ""; + [pbr::ProtobufField(1, "file_name")] public string FileName { get { return fileName_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 99f88a96..860a9925 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -14,11 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Struct { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Struct__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Value__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_ListValue__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -43,17 +38,8 @@ namespace Google.Protobuf.WellKnownTypes { "AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - 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_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", }); - internal__static_google_protobuf_ListValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.ListValue), descriptor.MessageTypes[2], - new string[] { "Values", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Struct), null, typeof(global::Google.Protobuf.WellKnownTypes.Value), typeof(global::Google.Protobuf.WellKnownTypes.ListValue), typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }); } #endregion @@ -78,8 +64,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.internal__static_google_protobuf_Struct__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -111,6 +97,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pbc::MapField.Codec _map_fields_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); private readonly pbc::MapField fields_ = new pbc::MapField(); + [pbr::ProtobufField(1, "fields")] public pbc::MapField Fields { get { return fields_; } } @@ -189,8 +176,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.internal__static_google_protobuf_Value__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -239,6 +226,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int NullValueFieldNumber = 1; + [pbr::ProtobufField(1, "null_value")] public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NULL_VALUE; } set { @@ -249,6 +237,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int NumberValueFieldNumber = 2; + [pbr::ProtobufField(2, "number_value")] public double NumberValue { get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } set { @@ -259,6 +248,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int StringValueFieldNumber = 3; + [pbr::ProtobufField(3, "string_value")] public string StringValue { get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } set { @@ -269,6 +259,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int BoolValueFieldNumber = 4; + [pbr::ProtobufField(4, "bool_value")] public bool BoolValue { get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } set { @@ -279,6 +270,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int StructValueFieldNumber = 5; + [pbr::ProtobufField(5, "struct_value")] public global::Google.Protobuf.WellKnownTypes.Struct StructValue { get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } set { @@ -289,6 +281,7 @@ namespace Google.Protobuf.WellKnownTypes { } public const int ListValueFieldNumber = 6; + [pbr::ProtobufField(6, "list_value")] public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } set { @@ -309,10 +302,12 @@ namespace Google.Protobuf.WellKnownTypes { ListValue = 6, } private KindOneofCase kindCase_ = KindOneofCase.None; + [pbr::ProtobufOneof("kind")] public KindOneofCase KindCase { get { return kindCase_; } } + [pbr::ProtobufOneof("kind")] public void ClearKind() { pb::Freezable.CheckMutable(this); kindCase_ = KindOneofCase.None; @@ -494,8 +489,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.internal__static_google_protobuf_ListValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -527,6 +522,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_values_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); + [pbr::ProtobufField(1, "values")] public pbc::RepeatedField Values { get { return values_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index e3bb3c37..bfc2f37a 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -14,9 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Timestamp { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Timestamp__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -32,11 +29,8 @@ namespace Google.Protobuf.WellKnownTypes { "AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_Timestamp__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), descriptor.MessageTypes[0], - new string[] { "Seconds", "Nanos", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), }); } #endregion @@ -54,8 +48,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.internal__static_google_protobuf_Timestamp__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -85,6 +79,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int SecondsFieldNumber = 1; private long seconds_; + [pbr::ProtobufField(1, "seconds")] public long Seconds { get { return seconds_; } set { @@ -95,6 +90,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NanosFieldNumber = 2; private int nanos_; + [pbr::ProtobufField(2, "nanos")] public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index dbc1ee0d..53b8f6be 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -14,13 +14,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Type { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Type__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Field__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Enum__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_EnumValue__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Option__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -62,25 +55,8 @@ namespace Google.Protobuf.WellKnownTypes { "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, - }); - internal__static_google_protobuf_Type__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Type), descriptor.MessageTypes[0], - new string[] { "Name", "Fields", "Oneofs", "Options", "SourceContext", }, new string[] { }); - internal__static_google_protobuf_Field__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Field), descriptor.MessageTypes[1], - new string[] { "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options", }, new string[] { }); - internal__static_google_protobuf_Enum__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Enum), descriptor.MessageTypes[2], - new string[] { "Name", "Enumvalue", "Options", "SourceContext", }, new string[] { }); - internal__static_google_protobuf_EnumValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), descriptor.MessageTypes[3], - new string[] { "Name", "Number", "Options", }, new string[] { }); - internal__static_google_protobuf_Option__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Option), descriptor.MessageTypes[4], - new string[] { "Name", "Value", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Type), typeof(global::Google.Protobuf.WellKnownTypes.Field), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality), typeof(global::Google.Protobuf.WellKnownTypes.Enum), typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), typeof(global::Google.Protobuf.WellKnownTypes.Option), }); } #endregion @@ -98,8 +74,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.internal__static_google_protobuf_Type__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -136,6 +112,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -148,6 +125,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_fields_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); private readonly pbc::RepeatedField fields_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "fields")] public pbc::RepeatedField Fields { get { return fields_; } } @@ -156,6 +134,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_oneofs_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField oneofs_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "oneofs")] public pbc::RepeatedField Oneofs { get { return oneofs_; } } @@ -164,12 +143,14 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(4, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + [pbr::ProtobufField(5, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -308,8 +289,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.internal__static_google_protobuf_Field__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -346,6 +327,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int KindFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN; + [pbr::ProtobufField(1, "kind")] public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -356,6 +338,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int CardinalityFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN; + [pbr::ProtobufField(2, "cardinality")] public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -366,6 +349,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NumberFieldNumber = 3; private int number_; + [pbr::ProtobufField(3, "number")] public int Number { get { return number_; } set { @@ -376,6 +360,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 4; private string name_ = ""; + [pbr::ProtobufField(4, "name")] public string Name { get { return name_; } set { @@ -386,6 +371,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int TypeUrlFieldNumber = 6; private string typeUrl_ = ""; + [pbr::ProtobufField(6, "type_url")] public string TypeUrl { get { return typeUrl_; } set { @@ -396,6 +382,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int OneofIndexFieldNumber = 7; private int oneofIndex_; + [pbr::ProtobufField(7, "oneof_index")] public int OneofIndex { get { return oneofIndex_; } set { @@ -406,6 +393,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int PackedFieldNumber = 8; private bool packed_; + [pbr::ProtobufField(8, "packed")] public bool Packed { get { return packed_; } set { @@ -418,6 +406,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(9, "options")] public pbc::RepeatedField Options { get { return options_; } } @@ -642,8 +631,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.internal__static_google_protobuf_Enum__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -678,6 +667,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -690,6 +680,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_enumvalue_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); private readonly pbc::RepeatedField enumvalue_ = new pbc::RepeatedField(); + [pbr::ProtobufField(2, "enumvalue")] public pbc::RepeatedField Enumvalue { get { return enumvalue_; } } @@ -698,12 +689,14 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int SourceContextFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; + [pbr::ProtobufField(4, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -833,8 +826,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.internal__static_google_protobuf_EnumValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -866,6 +859,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -876,6 +870,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NumberFieldNumber = 2; private int number_; + [pbr::ProtobufField(2, "number")] public int Number { get { return number_; } set { @@ -888,6 +883,7 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); + [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } @@ -998,8 +994,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.internal__static_google_protobuf_Option__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1030,6 +1026,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; + [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -1040,6 +1037,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Any value_; + [pbr::ProtobufField(2, "value")] public global::Google.Protobuf.WellKnownTypes.Any Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs index c26f874d..d1b5497e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs @@ -12,17 +12,6 @@ namespace Google.Protobuf.WellKnownTypes { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Wrappers { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_google_protobuf_DoubleValue__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_FloatValue__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Int64Value__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_UInt64Value__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_Int32Value__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_UInt32Value__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_BoolValue__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_StringValue__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_google_protobuf_BytesValue__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -42,35 +31,8 @@ namespace Google.Protobuf.WellKnownTypes { "ChNjb20uZ29vZ2xlLnByb3RvYnVmQg1XcmFwcGVyc1Byb3RvUAGiAgNHUEKq", "Ah5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_google_protobuf_DoubleValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.DoubleValue), descriptor.MessageTypes[0], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_FloatValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.FloatValue), descriptor.MessageTypes[1], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_Int64Value__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Int64Value), descriptor.MessageTypes[2], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_UInt64Value__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.UInt64Value), descriptor.MessageTypes[3], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_Int32Value__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.Int32Value), descriptor.MessageTypes[4], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_UInt32Value__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.UInt32Value), descriptor.MessageTypes[5], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_BoolValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.BoolValue), descriptor.MessageTypes[6], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_StringValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.StringValue), descriptor.MessageTypes[7], - new string[] { "Value", }, new string[] { }); - internal__static_google_protobuf_BytesValue__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.WellKnownTypes.BytesValue), descriptor.MessageTypes[8], - new string[] { "Value", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.DoubleValue), typeof(global::Google.Protobuf.WellKnownTypes.FloatValue), typeof(global::Google.Protobuf.WellKnownTypes.Int64Value), typeof(global::Google.Protobuf.WellKnownTypes.UInt64Value), typeof(global::Google.Protobuf.WellKnownTypes.Int32Value), typeof(global::Google.Protobuf.WellKnownTypes.UInt32Value), typeof(global::Google.Protobuf.WellKnownTypes.BoolValue), typeof(global::Google.Protobuf.WellKnownTypes.StringValue), typeof(global::Google.Protobuf.WellKnownTypes.BytesValue), }); } #endregion @@ -87,8 +49,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_DoubleValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -117,6 +79,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private double value_; + [pbr::ProtobufField(1, "value")] public double Value { get { return value_; } set { @@ -206,8 +169,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_FloatValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -236,6 +199,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private float value_; + [pbr::ProtobufField(1, "value")] public float Value { get { return value_; } set { @@ -325,8 +289,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_Int64Value__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -355,6 +319,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private long value_; + [pbr::ProtobufField(1, "value")] public long Value { get { return value_; } set { @@ -444,8 +409,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_UInt64Value__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -474,6 +439,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private ulong value_; + [pbr::ProtobufField(1, "value")] public ulong Value { get { return value_; } set { @@ -563,8 +529,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_Int32Value__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -593,6 +559,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private int value_; + [pbr::ProtobufField(1, "value")] public int Value { get { return value_; } set { @@ -682,8 +649,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_UInt32Value__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -712,6 +679,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private uint value_; + [pbr::ProtobufField(1, "value")] public uint Value { get { return value_; } set { @@ -801,8 +769,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_BoolValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -831,6 +799,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private bool value_; + [pbr::ProtobufField(1, "value")] public bool Value { get { return value_; } set { @@ -920,8 +889,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[7]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_StringValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -950,6 +919,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private string value_ = ""; + [pbr::ProtobufField(1, "value")] public string Value { get { return value_; } set { @@ -1039,8 +1009,8 @@ namespace Google.Protobuf.WellKnownTypes { get { return global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor.MessageTypes[8]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.WellKnownTypes.Wrappers.internal__static_google_protobuf_BytesValue__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1069,6 +1039,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 1; private pb::ByteString value_ = pb::ByteString.Empty; + [pbr::ProtobufField(1, "value")] public pb::ByteString Value { get { return value_; } set { From 8d115298c7fc6fec135515ff7ddacb7f1524149e Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 21 Jul 2015 09:46:06 +0100 Subject: [PATCH 3/8] Fix comment typo --- csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index a10e617b..ba832b89 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -331,7 +331,7 @@ namespace Google.Protobuf.Reflection /// /// /// The parameter should be null for descriptors which don't correspond to - /// generated types. Otherwise, the array should be represent all the generated types in the file: messages then + /// generated types. Otherwise, the array should represent all the generated types in the file: messages then /// enums. Within each message, there can be nested messages and enums, which must be specified "inline" in the array: /// containing message, nested messages, nested enums - and of course each nested message may contain *more* nested messages, /// etc. All messages within the descriptor should be represented, even if they do not have a generated type - any From 4668c3dc3921e157b7904e26a1ddd84287b881be Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 22 Jul 2015 11:38:22 +0100 Subject: [PATCH 4/8] Remove the usage of attributes for field/method discovery. Instead, introduce GeneratedCodeInfo which passes in what we need, and adjust the codegen to take account of this. --- .../Google.Protobuf/Google.Protobuf.csproj | 3 +- .../Reflection/DescriptorProtoFile.cs | 171 +++--------------- .../Reflection/FieldDescriptor.cs | 26 +-- .../Reflection/FileDescriptor.cs | 36 ++-- .../Reflection/GeneratedCodeInfo.cs | 66 +++++++ .../Reflection/MessageDescriptor.cs | 36 ++-- .../Reflection/OneofDescriptor.cs | 27 +-- .../Reflection/ProtobufFieldAttribute.cs | 58 ------ .../Reflection/ProtobufOneofAttribute.cs | 52 ------ .../Reflection/ReflectionUtil.cs | 21 +-- .../compiler/csharp/csharp_field_base.cc | 5 - .../compiler/csharp/csharp_field_base.h | 1 - .../compiler/csharp/csharp_map_field.cc | 1 - .../compiler/csharp/csharp_message.cc | 13 -- .../compiler/csharp/csharp_message_field.cc | 2 - .../compiler/csharp/csharp_primitive_field.cc | 2 - .../csharp/csharp_repeated_enum_field.cc | 1 - .../csharp/csharp_repeated_message_field.cc | 1 - .../csharp/csharp_repeated_primitive_field.cc | 1 - .../compiler/csharp/csharp_umbrella_class.cc | 115 ++++++++++-- .../compiler/csharp/csharp_umbrella_class.h | 2 +- .../compiler/csharp/csharp_wrapper_field.cc | 2 - 22 files changed, 240 insertions(+), 402 deletions(-) create mode 100644 csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs delete mode 100644 csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs delete mode 100644 csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index 50756299..29320ca8 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -81,6 +81,7 @@ + @@ -90,8 +91,6 @@ - - diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs index 6565982c..def70b53 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorProtoFile.cs @@ -131,10 +131,30 @@ namespace Google.Protobuf.Reflection { "YWlsaW5nX2NvbW1lbnRzGAQgASgJEiEKGWxlYWRpbmdfZGV0YWNoZWRfY29t", "bWVudHMYBiADKAlCWAoTY29tLmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRv", "clByb3Rvc0gBWgpkZXNjcmlwdG9yogIDR1BCqgIaR29vZ2xlLlByb3RvYnVm", - "LlJlZmxlY3Rpb24=")); + "LlJlZmxlY3Rpb24=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), typeof(global::Google.Protobuf.Reflection.DescriptorProto), typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label), typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), typeof(global::Google.Protobuf.Reflection.FileOptions), typeof(global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode), typeof(global::Google.Protobuf.Reflection.MessageOptions), typeof(global::Google.Protobuf.Reflection.FieldOptions), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.CType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.JSType), typeof(global::Google.Protobuf.Reflection.EnumOptions), typeof(global::Google.Protobuf.Reflection.EnumValueOptions), typeof(global::Google.Protobuf.Reflection.ServiceOptions), typeof(global::Google.Protobuf.Reflection.MethodOptions), typeof(global::Google.Protobuf.Reflection.UninterpretedOption), typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorSet), new[]{ "File" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileDescriptorProto), new[]{ "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto), new[]{ "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange), new[]{ "Start", "End" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange), new[]{ "Start", "End" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto), new[]{ "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "Options" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type), typeof(global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.OneofDescriptorProto), new[]{ "Name" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumDescriptorProto), new[]{ "Name", "Value", "Options" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueDescriptorProto), new[]{ "Name", "Number", "Options" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.ServiceDescriptorProto), new[]{ "Name", "Method", "Options" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MethodDescriptorProto), new[]{ "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FileOptions), new[]{ "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MessageOptions), new[]{ "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.FieldOptions), new[]{ "Ctype", "Packed", "Jstype", "Lazy", "Deprecated", "Weak", "UninterpretedOption" }, null, new[]{ typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.CType), typeof(global::Google.Protobuf.Reflection.FieldOptions.Types.JSType) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumOptions), new[]{ "AllowAlias", "Deprecated", "UninterpretedOption" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.EnumValueOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.ServiceOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.MethodOptions), new[]{ "Deprecated", "UninterpretedOption" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption), new[]{ "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart), new[]{ "NamePart_", "IsExtension" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo), new[]{ "Location" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location), new[]{ "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments" }, null, null, null)}) + })); } #endregion @@ -145,8 +165,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "file" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[0]; } } @@ -184,7 +202,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_file_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.FileDescriptorProto.Parser); private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "file")] internal pbc::RepeatedField File { get { return file_; } } @@ -257,8 +274,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "dependency", "enum_type", "extension", "message_type", "name", "options", "package", "public_dependency", "service", "source_code_info", "syntax", "weak_dependency" }; - private static readonly uint[] _fieldTags = new uint[] { 26, 42, 58, 34, 10, 66, 18, 80, 50, 74, 98, 88 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[1]; } } @@ -313,7 +328,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -324,7 +338,6 @@ namespace Google.Protobuf.Reflection { public const int PackageFieldNumber = 2; private string package_ = ""; - [pbr::ProtobufField(2, "package")] internal string Package { get { return package_; } set { @@ -337,7 +350,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_dependency_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField dependency_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "dependency")] internal pbc::RepeatedField Dependency { get { return dependency_; } } @@ -346,7 +358,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_publicDependency_codec = pb::FieldCodec.ForInt32(80); private readonly pbc::RepeatedField publicDependency_ = new pbc::RepeatedField(); - [pbr::ProtobufField(10, "public_dependency")] internal pbc::RepeatedField PublicDependency { get { return publicDependency_; } } @@ -355,7 +366,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_weakDependency_codec = pb::FieldCodec.ForInt32(88); private readonly pbc::RepeatedField weakDependency_ = new pbc::RepeatedField(); - [pbr::ProtobufField(11, "weak_dependency")] internal pbc::RepeatedField WeakDependency { get { return weakDependency_; } } @@ -364,7 +374,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_messageType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField messageType_ = new pbc::RepeatedField(); - [pbr::ProtobufField(4, "message_type")] internal pbc::RepeatedField MessageType { get { return messageType_; } } @@ -373,7 +382,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - [pbr::ProtobufField(5, "enum_type")] internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -382,7 +390,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_service_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.ServiceDescriptorProto.Parser); private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); - [pbr::ProtobufField(6, "service")] internal pbc::RepeatedField Service { get { return service_; } } @@ -391,14 +398,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - [pbr::ProtobufField(7, "extension")] internal pbc::RepeatedField Extension { get { return extension_; } } public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FileOptions options_; - [pbr::ProtobufField(8, "options")] internal global::Google.Protobuf.Reflection.FileOptions Options { get { return options_; } set { @@ -409,7 +414,6 @@ namespace Google.Protobuf.Reflection { public const int SourceCodeInfoFieldNumber = 9; private global::Google.Protobuf.Reflection.SourceCodeInfo sourceCodeInfo_; - [pbr::ProtobufField(9, "source_code_info")] internal global::Google.Protobuf.Reflection.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { @@ -420,7 +424,6 @@ namespace Google.Protobuf.Reflection { public const int SyntaxFieldNumber = 12; private string syntax_ = ""; - [pbr::ProtobufField(12, "syntax")] internal string Syntax { get { return syntax_; } set { @@ -645,8 +648,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "enum_type", "extension", "extension_range", "field", "name", "nested_type", "oneof_decl", "options", "reserved_name", "reserved_range" }; - private static readonly uint[] _fieldTags = new uint[] { 34, 50, 42, 18, 10, 26, 66, 58, 82, 74 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[2]; } } @@ -699,7 +700,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -712,7 +712,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_field_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField field_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "field")] internal pbc::RepeatedField Field { get { return field_; } } @@ -721,7 +720,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.Reflection.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - [pbr::ProtobufField(6, "extension")] internal pbc::RepeatedField Extension { get { return extension_; } } @@ -730,7 +728,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_nestedType_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.Reflection.DescriptorProto.Parser); private readonly pbc::RepeatedField nestedType_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "nested_type")] internal pbc::RepeatedField NestedType { get { return nestedType_; } } @@ -739,7 +736,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Reflection.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - [pbr::ProtobufField(4, "enum_type")] internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -748,7 +744,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_extensionRange_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.Reflection.DescriptorProto.Types.ExtensionRange.Parser); private readonly pbc::RepeatedField extensionRange_ = new pbc::RepeatedField(); - [pbr::ProtobufField(5, "extension_range")] internal pbc::RepeatedField ExtensionRange { get { return extensionRange_; } } @@ -757,14 +752,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_oneofDecl_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.Reflection.OneofDescriptorProto.Parser); private readonly pbc::RepeatedField oneofDecl_ = new pbc::RepeatedField(); - [pbr::ProtobufField(8, "oneof_decl")] internal pbc::RepeatedField OneofDecl { get { return oneofDecl_; } } public const int OptionsFieldNumber = 7; private global::Google.Protobuf.Reflection.MessageOptions options_; - [pbr::ProtobufField(7, "options")] internal global::Google.Protobuf.Reflection.MessageOptions Options { get { return options_; } set { @@ -777,7 +770,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_reservedRange_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.Reflection.DescriptorProto.Types.ReservedRange.Parser); private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); - [pbr::ProtobufField(9, "reserved_range")] internal pbc::RepeatedField ReservedRange { get { return reservedRange_; } } @@ -786,7 +778,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_reservedName_codec = pb::FieldCodec.ForString(82); private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); - [pbr::ProtobufField(10, "reserved_name")] internal pbc::RepeatedField ReservedName { get { return reservedName_; } } @@ -961,8 +952,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRange()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "end", "start" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[0]; } } @@ -998,7 +987,6 @@ namespace Google.Protobuf.Reflection { public const int StartFieldNumber = 1; private int start_; - [pbr::ProtobufField(1, "start")] internal int Start { get { return start_; } set { @@ -1009,7 +997,6 @@ namespace Google.Protobuf.Reflection { public const int EndFieldNumber = 2; private int end_; - [pbr::ProtobufField(2, "end")] internal int End { get { return end_; } set { @@ -1109,8 +1096,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "end", "start" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProto.Descriptor.NestedTypes[1]; } } @@ -1146,7 +1131,6 @@ namespace Google.Protobuf.Reflection { public const int StartFieldNumber = 1; private int start_; - [pbr::ProtobufField(1, "start")] internal int Start { get { return start_; } set { @@ -1157,7 +1141,6 @@ namespace Google.Protobuf.Reflection { public const int EndFieldNumber = 2; private int end_; - [pbr::ProtobufField(2, "end")] internal int End { get { return end_; } set { @@ -1262,8 +1245,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "default_value", "extendee", "label", "name", "number", "oneof_index", "options", "type", "type_name" }; - private static readonly uint[] _fieldTags = new uint[] { 58, 18, 32, 10, 24, 72, 66, 40, 50 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[3]; } } @@ -1307,7 +1288,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1318,7 +1298,6 @@ namespace Google.Protobuf.Reflection { public const int NumberFieldNumber = 3; private int number_; - [pbr::ProtobufField(3, "number")] internal int Number { get { return number_; } set { @@ -1329,7 +1308,6 @@ namespace Google.Protobuf.Reflection { public const int LabelFieldNumber = 4; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - [pbr::ProtobufField(4, "label")] internal global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Label Label { get { return label_; } set { @@ -1340,7 +1318,6 @@ namespace Google.Protobuf.Reflection { public const int TypeFieldNumber = 5; private global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - [pbr::ProtobufField(5, "type")] internal global::Google.Protobuf.Reflection.FieldDescriptorProto.Types.Type Type { get { return type_; } set { @@ -1351,7 +1328,6 @@ namespace Google.Protobuf.Reflection { public const int TypeNameFieldNumber = 6; private string typeName_ = ""; - [pbr::ProtobufField(6, "type_name")] internal string TypeName { get { return typeName_; } set { @@ -1362,7 +1338,6 @@ namespace Google.Protobuf.Reflection { public const int ExtendeeFieldNumber = 2; private string extendee_ = ""; - [pbr::ProtobufField(2, "extendee")] internal string Extendee { get { return extendee_; } set { @@ -1373,7 +1348,6 @@ namespace Google.Protobuf.Reflection { public const int DefaultValueFieldNumber = 7; private string defaultValue_ = ""; - [pbr::ProtobufField(7, "default_value")] internal string DefaultValue { get { return defaultValue_; } set { @@ -1384,7 +1358,6 @@ namespace Google.Protobuf.Reflection { public const int OneofIndexFieldNumber = 9; private int oneofIndex_; - [pbr::ProtobufField(9, "oneof_index")] internal int OneofIndex { get { return oneofIndex_; } set { @@ -1395,7 +1368,6 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 8; private global::Google.Protobuf.Reflection.FieldOptions options_; - [pbr::ProtobufField(8, "options")] internal global::Google.Protobuf.Reflection.FieldOptions Options { get { return options_; } set { @@ -1646,8 +1618,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "name" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[4]; } } @@ -1682,7 +1652,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1766,8 +1735,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "name", "options", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 26, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[5]; } } @@ -1806,7 +1773,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1819,14 +1785,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_value_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.EnumValueDescriptorProto.Parser); private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "value")] internal pbc::RepeatedField Value { get { return value_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumOptions options_; - [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.EnumOptions Options { get { return options_; } set { @@ -1941,8 +1905,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "name", "number", "options" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16, 26 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[6]; } } @@ -1980,7 +1942,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -1991,7 +1952,6 @@ namespace Google.Protobuf.Reflection { public const int NumberFieldNumber = 2; private int number_; - [pbr::ProtobufField(2, "number")] internal int Number { get { return number_; } set { @@ -2002,7 +1962,6 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.EnumValueOptions options_; - [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.EnumValueOptions Options { get { return options_; } set { @@ -2124,8 +2083,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "method", "name", "options" }; - private static readonly uint[] _fieldTags = new uint[] { 18, 10, 26 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[7]; } } @@ -2164,7 +2121,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -2177,14 +2133,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_method_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.MethodDescriptorProto.Parser); private readonly pbc::RepeatedField method_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "method")] internal pbc::RepeatedField Method { get { return method_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.Reflection.ServiceOptions options_; - [pbr::ProtobufField(3, "options")] internal global::Google.Protobuf.Reflection.ServiceOptions Options { get { return options_; } set { @@ -2299,8 +2253,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "client_streaming", "input_type", "name", "options", "output_type", "server_streaming" }; - private static readonly uint[] _fieldTags = new uint[] { 40, 18, 10, 34, 26, 48 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[8]; } } @@ -2341,7 +2293,6 @@ namespace Google.Protobuf.Reflection { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] internal string Name { get { return name_; } set { @@ -2352,7 +2303,6 @@ namespace Google.Protobuf.Reflection { public const int InputTypeFieldNumber = 2; private string inputType_ = ""; - [pbr::ProtobufField(2, "input_type")] internal string InputType { get { return inputType_; } set { @@ -2363,7 +2313,6 @@ namespace Google.Protobuf.Reflection { public const int OutputTypeFieldNumber = 3; private string outputType_ = ""; - [pbr::ProtobufField(3, "output_type")] internal string OutputType { get { return outputType_; } set { @@ -2374,7 +2323,6 @@ namespace Google.Protobuf.Reflection { public const int OptionsFieldNumber = 4; private global::Google.Protobuf.Reflection.MethodOptions options_; - [pbr::ProtobufField(4, "options")] internal global::Google.Protobuf.Reflection.MethodOptions Options { get { return options_; } set { @@ -2385,7 +2333,6 @@ namespace Google.Protobuf.Reflection { public const int ClientStreamingFieldNumber = 5; private bool clientStreaming_; - [pbr::ProtobufField(5, "client_streaming")] internal bool ClientStreaming { get { return clientStreaming_; } set { @@ -2396,7 +2343,6 @@ namespace Google.Protobuf.Reflection { public const int ServerStreamingFieldNumber = 6; private bool serverStreaming_; - [pbr::ProtobufField(6, "server_streaming")] internal bool ServerStreaming { get { return serverStreaming_; } set { @@ -2566,8 +2512,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "cc_enable_arenas", "cc_generic_services", "csharp_namespace", "deprecated", "go_package", "java_generate_equals_and_hash", "java_generic_services", "java_multiple_files", "java_outer_classname", "java_package", "java_string_check_utf8", "objc_class_prefix", "optimize_for", "py_generic_services", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 248, 128, 298, 184, 90, 160, 136, 80, 66, 10, 216, 290, 72, 144, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[9]; } } @@ -2617,7 +2561,6 @@ namespace Google.Protobuf.Reflection { public const int JavaPackageFieldNumber = 1; private string javaPackage_ = ""; - [pbr::ProtobufField(1, "java_package")] internal string JavaPackage { get { return javaPackage_; } set { @@ -2628,7 +2571,6 @@ namespace Google.Protobuf.Reflection { public const int JavaOuterClassnameFieldNumber = 8; private string javaOuterClassname_ = ""; - [pbr::ProtobufField(8, "java_outer_classname")] internal string JavaOuterClassname { get { return javaOuterClassname_; } set { @@ -2639,7 +2581,6 @@ namespace Google.Protobuf.Reflection { public const int JavaMultipleFilesFieldNumber = 10; private bool javaMultipleFiles_; - [pbr::ProtobufField(10, "java_multiple_files")] internal bool JavaMultipleFiles { get { return javaMultipleFiles_; } set { @@ -2650,7 +2591,6 @@ namespace Google.Protobuf.Reflection { public const int JavaGenerateEqualsAndHashFieldNumber = 20; private bool javaGenerateEqualsAndHash_; - [pbr::ProtobufField(20, "java_generate_equals_and_hash")] internal bool JavaGenerateEqualsAndHash { get { return javaGenerateEqualsAndHash_; } set { @@ -2661,7 +2601,6 @@ namespace Google.Protobuf.Reflection { public const int JavaStringCheckUtf8FieldNumber = 27; private bool javaStringCheckUtf8_; - [pbr::ProtobufField(27, "java_string_check_utf8")] internal bool JavaStringCheckUtf8 { get { return javaStringCheckUtf8_; } set { @@ -2672,7 +2611,6 @@ namespace Google.Protobuf.Reflection { public const int OptimizeForFieldNumber = 9; private global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode.SPEED; - [pbr::ProtobufField(9, "optimize_for")] internal global::Google.Protobuf.Reflection.FileOptions.Types.OptimizeMode OptimizeFor { get { return optimizeFor_; } set { @@ -2683,7 +2621,6 @@ namespace Google.Protobuf.Reflection { public const int GoPackageFieldNumber = 11; private string goPackage_ = ""; - [pbr::ProtobufField(11, "go_package")] internal string GoPackage { get { return goPackage_; } set { @@ -2694,7 +2631,6 @@ namespace Google.Protobuf.Reflection { public const int CcGenericServicesFieldNumber = 16; private bool ccGenericServices_; - [pbr::ProtobufField(16, "cc_generic_services")] internal bool CcGenericServices { get { return ccGenericServices_; } set { @@ -2705,7 +2641,6 @@ namespace Google.Protobuf.Reflection { public const int JavaGenericServicesFieldNumber = 17; private bool javaGenericServices_; - [pbr::ProtobufField(17, "java_generic_services")] internal bool JavaGenericServices { get { return javaGenericServices_; } set { @@ -2716,7 +2651,6 @@ namespace Google.Protobuf.Reflection { public const int PyGenericServicesFieldNumber = 18; private bool pyGenericServices_; - [pbr::ProtobufField(18, "py_generic_services")] internal bool PyGenericServices { get { return pyGenericServices_; } set { @@ -2727,7 +2661,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 23; private bool deprecated_; - [pbr::ProtobufField(23, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -2738,7 +2671,6 @@ namespace Google.Protobuf.Reflection { public const int CcEnableArenasFieldNumber = 31; private bool ccEnableArenas_; - [pbr::ProtobufField(31, "cc_enable_arenas")] internal bool CcEnableArenas { get { return ccEnableArenas_; } set { @@ -2749,7 +2681,6 @@ namespace Google.Protobuf.Reflection { public const int ObjcClassPrefixFieldNumber = 36; private string objcClassPrefix_ = ""; - [pbr::ProtobufField(36, "objc_class_prefix")] internal string ObjcClassPrefix { get { return objcClassPrefix_; } set { @@ -2760,7 +2691,6 @@ namespace Google.Protobuf.Reflection { public const int CsharpNamespaceFieldNumber = 37; private string csharpNamespace_ = ""; - [pbr::ProtobufField(37, "csharp_namespace")] internal string CsharpNamespace { get { return csharpNamespace_; } set { @@ -2773,7 +2703,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3082,8 +3011,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated", "map_entry", "message_set_wire_format", "no_standard_descriptor_accessor", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 24, 56, 8, 16, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[10]; } } @@ -3123,7 +3050,6 @@ namespace Google.Protobuf.Reflection { public const int MessageSetWireFormatFieldNumber = 1; private bool messageSetWireFormat_; - [pbr::ProtobufField(1, "message_set_wire_format")] internal bool MessageSetWireFormat { get { return messageSetWireFormat_; } set { @@ -3134,7 +3060,6 @@ namespace Google.Protobuf.Reflection { public const int NoStandardDescriptorAccessorFieldNumber = 2; private bool noStandardDescriptorAccessor_; - [pbr::ProtobufField(2, "no_standard_descriptor_accessor")] internal bool NoStandardDescriptorAccessor { get { return noStandardDescriptorAccessor_; } set { @@ -3145,7 +3070,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3156,7 +3080,6 @@ namespace Google.Protobuf.Reflection { public const int MapEntryFieldNumber = 7; private bool mapEntry_; - [pbr::ProtobufField(7, "map_entry")] internal bool MapEntry { get { return mapEntry_; } set { @@ -3169,7 +3092,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3306,8 +3228,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "ctype", "deprecated", "jstype", "lazy", "packed", "uninterpreted_option", "weak" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 24, 48, 40, 16, 7994, 80 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[11]; } } @@ -3349,7 +3269,6 @@ namespace Google.Protobuf.Reflection { public const int CtypeFieldNumber = 1; private global::Google.Protobuf.Reflection.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.CType.STRING; - [pbr::ProtobufField(1, "ctype")] internal global::Google.Protobuf.Reflection.FieldOptions.Types.CType Ctype { get { return ctype_; } set { @@ -3360,7 +3279,6 @@ namespace Google.Protobuf.Reflection { public const int PackedFieldNumber = 2; private bool packed_; - [pbr::ProtobufField(2, "packed")] internal bool Packed { get { return packed_; } set { @@ -3371,7 +3289,6 @@ namespace Google.Protobuf.Reflection { public const int JstypeFieldNumber = 6; private global::Google.Protobuf.Reflection.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.Reflection.FieldOptions.Types.JSType.JS_NORMAL; - [pbr::ProtobufField(6, "jstype")] internal global::Google.Protobuf.Reflection.FieldOptions.Types.JSType Jstype { get { return jstype_; } set { @@ -3382,7 +3299,6 @@ namespace Google.Protobuf.Reflection { public const int LazyFieldNumber = 5; private bool lazy_; - [pbr::ProtobufField(5, "lazy")] internal bool Lazy { get { return lazy_; } set { @@ -3393,7 +3309,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3404,7 +3319,6 @@ namespace Google.Protobuf.Reflection { public const int WeakFieldNumber = 10; private bool weak_; - [pbr::ProtobufField(10, "weak")] internal bool Weak { get { return weak_; } set { @@ -3417,7 +3331,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3604,8 +3517,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "allow_alias", "deprecated", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 24, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[12]; } } @@ -3643,7 +3554,6 @@ namespace Google.Protobuf.Reflection { public const int AllowAliasFieldNumber = 2; private bool allowAlias_; - [pbr::ProtobufField(2, "allow_alias")] internal bool AllowAlias { get { return allowAlias_; } set { @@ -3654,7 +3564,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - [pbr::ProtobufField(3, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3667,7 +3576,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3772,8 +3680,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[13]; } } @@ -3810,7 +3716,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 1; private bool deprecated_; - [pbr::ProtobufField(1, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3823,7 +3728,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3912,8 +3816,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 264, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[14]; } } @@ -3950,7 +3852,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 33; private bool deprecated_; - [pbr::ProtobufField(33, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -3963,7 +3864,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -4052,8 +3952,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodOptions()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; - private static readonly uint[] _fieldTags = new uint[] { 264, 7994 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[15]; } } @@ -4090,7 +3988,6 @@ namespace Google.Protobuf.Reflection { public const int DeprecatedFieldNumber = 33; private bool deprecated_; - [pbr::ProtobufField(33, "deprecated")] internal bool Deprecated { get { return deprecated_; } set { @@ -4103,7 +4000,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.Reflection.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - [pbr::ProtobufField(999, "uninterpreted_option")] internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -4192,8 +4088,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "aggregate_value", "double_value", "identifier_value", "name", "negative_int_value", "positive_int_value", "string_value" }; - private static readonly uint[] _fieldTags = new uint[] { 66, 49, 26, 18, 40, 32, 58 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[16]; } } @@ -4237,14 +4131,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_name_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.Reflection.UninterpretedOption.Types.NamePart.Parser); private readonly pbc::RepeatedField name_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "name")] internal pbc::RepeatedField Name { get { return name_; } } public const int IdentifierValueFieldNumber = 3; private string identifierValue_ = ""; - [pbr::ProtobufField(3, "identifier_value")] internal string IdentifierValue { get { return identifierValue_; } set { @@ -4255,7 +4147,6 @@ namespace Google.Protobuf.Reflection { public const int PositiveIntValueFieldNumber = 4; private ulong positiveIntValue_; - [pbr::ProtobufField(4, "positive_int_value")] internal ulong PositiveIntValue { get { return positiveIntValue_; } set { @@ -4266,7 +4157,6 @@ namespace Google.Protobuf.Reflection { public const int NegativeIntValueFieldNumber = 5; private long negativeIntValue_; - [pbr::ProtobufField(5, "negative_int_value")] internal long NegativeIntValue { get { return negativeIntValue_; } set { @@ -4277,7 +4167,6 @@ namespace Google.Protobuf.Reflection { public const int DoubleValueFieldNumber = 6; private double doubleValue_; - [pbr::ProtobufField(6, "double_value")] internal double DoubleValue { get { return doubleValue_; } set { @@ -4288,7 +4177,6 @@ namespace Google.Protobuf.Reflection { public const int StringValueFieldNumber = 7; private pb::ByteString stringValue_ = pb::ByteString.Empty; - [pbr::ProtobufField(7, "string_value")] internal pb::ByteString StringValue { get { return stringValue_; } set { @@ -4299,7 +4187,6 @@ namespace Google.Protobuf.Reflection { public const int AggregateValueFieldNumber = 8; private string aggregateValue_ = ""; - [pbr::ProtobufField(8, "aggregate_value")] internal string AggregateValue { get { return aggregateValue_; } set { @@ -4473,8 +4360,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "is_extension", "name_part" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.UninterpretedOption.Descriptor.NestedTypes[0]; } } @@ -4510,7 +4395,6 @@ namespace Google.Protobuf.Reflection { public const int NamePart_FieldNumber = 1; private string namePart_ = ""; - [pbr::ProtobufField(1, "name_part")] internal string NamePart_ { get { return namePart_; } set { @@ -4521,7 +4405,6 @@ namespace Google.Protobuf.Reflection { public const int IsExtensionFieldNumber = 2; private bool isExtension_; - [pbr::ProtobufField(2, "is_extension")] internal bool IsExtension { get { return isExtension_; } set { @@ -4626,8 +4509,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "location" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.DescriptorProtoFile.Descriptor.MessageTypes[17]; } } @@ -4665,7 +4546,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_location_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Reflection.SourceCodeInfo.Types.Location.Parser); private readonly pbc::RepeatedField location_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "location")] internal pbc::RepeatedField Location { get { return location_; } } @@ -4739,8 +4619,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Location()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "leading_comments", "leading_detached_comments", "path", "span", "trailing_comments" }; - private static readonly uint[] _fieldTags = new uint[] { 26, 50, 10, 18, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Reflection.SourceCodeInfo.Descriptor.NestedTypes[0]; } } @@ -4784,7 +4662,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_path_codec = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "path")] internal pbc::RepeatedField Path { get { return path_; } } @@ -4793,14 +4670,12 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_span_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField span_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "span")] internal pbc::RepeatedField Span { get { return span_; } } public const int LeadingCommentsFieldNumber = 3; private string leadingComments_ = ""; - [pbr::ProtobufField(3, "leading_comments")] internal string LeadingComments { get { return leadingComments_; } set { @@ -4811,7 +4686,6 @@ namespace Google.Protobuf.Reflection { public const int TrailingCommentsFieldNumber = 4; private string trailingComments_ = ""; - [pbr::ProtobufField(4, "trailing_comments")] internal string TrailingComments { get { return trailingComments_; } set { @@ -4824,7 +4698,6 @@ namespace Google.Protobuf.Reflection { private static readonly pb::FieldCodec _repeated_leadingDetachedComments_codec = pb::FieldCodec.ForString(50); private readonly pbc::RepeatedField leadingDetachedComments_ = new pbc::RepeatedField(); - [pbr::ProtobufField(6, "leading_detached_comments")] internal pbc::RepeatedField LeadingDetachedComments { get { return leadingDetachedComments_; } } diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 57378e4c..a8609b8a 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -46,10 +46,11 @@ namespace Google.Protobuf.Reflection private readonly MessageDescriptor containingType; private readonly OneofDescriptor containingOneof; private FieldType fieldType; + private readonly string propertyName; // Annoyingly, needed in Crosslink. private IFieldAccessor accessor; internal FieldDescriptor(FieldDescriptorProto proto, FileDescriptor file, - MessageDescriptor parent, int index) + MessageDescriptor parent, int index, string propertyName) : base(file, file.ComputeFullName(parent, proto.Name), index) { this.proto = proto; @@ -76,6 +77,12 @@ namespace Google.Protobuf.Reflection } file.DescriptorPool.AddSymbol(this); + // We can't create the accessor until we've cross-linked, unfortunately, as we + // may not know whether the type of the field is a map or not. Remember the property name + // for later. + // We could trust the generated code and check whether the type of the property is + // a MapField, but that feels a tad nasty. + this.propertyName = propertyName; } /// @@ -291,26 +298,19 @@ namespace Google.Protobuf.Reflection { throw new DescriptorValidationException(this, "MessageSet format is not supported."); } - - accessor = CreateAccessor(); + accessor = CreateAccessor(propertyName); } - private IFieldAccessor CreateAccessor() + private IFieldAccessor CreateAccessor(string propertyName) { - // TODO: Check the performance of this with some large protos. Each message is O(N^2) in the number of fields, - // which isn't great... - if (containingType.GeneratedType == null) + if (containingType.GeneratedType == null || propertyName == null) { return null; } - var property = containingType - .GeneratedType - .GetProperties() - .FirstOrDefault(p => p.IsDefined(typeof(ProtobufFieldAttribute), false) && - p.GetCustomAttributes(typeof(ProtobufFieldAttribute), false).Cast().Single().Number == FieldNumber); + var property = containingType.GeneratedType.GetProperty(propertyName); if (property == null) { - return null; + throw new DescriptorValidationException(this, "Property " + propertyName + " not found in " + containingType.GeneratedType); } return IsMap ? new MapFieldAccessor(property, this) : IsRepeated ? new RepeatedFieldAccessor(property, this) diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index ba832b89..041d4711 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -62,12 +62,11 @@ namespace Google.Protobuf.Reflection get { return proto.Syntax == "proto3" ? ProtoSyntax.Proto3 : ProtoSyntax.Proto2; } } - private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, Type[] generatedTypes) + private FileDescriptor(FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo) { this.pool = pool; this.proto = proto; this.dependencies = new ReadOnlyCollection((FileDescriptor[]) dependencies.Clone()); - IEnumerator generatedTypeIterator = generatedTypes == null ? null : ((IEnumerable)generatedTypes).GetEnumerator(); publicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies); @@ -75,21 +74,15 @@ namespace Google.Protobuf.Reflection messageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType, (message, index) => - new MessageDescriptor(message, this, null, index, generatedTypeIterator)); + new MessageDescriptor(message, this, null, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedTypes[index])); enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType, (enumType, index) => - new EnumDescriptor(enumType, this, null, index, ReflectionUtil.GetNextType(generatedTypeIterator))); + new EnumDescriptor(enumType, this, null, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedEnums[index])); services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service, (service, index) => new ServiceDescriptor(service, this, index)); - - // We should now have consumed all the generated types. - if (generatedTypeIterator != null && generatedTypeIterator.MoveNext()) - { - throw new ArgumentException("More generated types left over after consuming all expected ones", "generatedTypes"); - } } /// @@ -260,7 +253,7 @@ namespace Google.Protobuf.Reflection } return null; } - + /// /// Builds a FileDescriptor from its protocol buffer representation. /// @@ -269,10 +262,11 @@ namespace Google.Protobuf.Reflection /// file's dependencies, in the exact order listed in the .proto file. May be null, /// in which case it is treated as an empty array. /// Whether unknown dependencies are ignored (true) or cause an exception to be thrown (false). + /// Reflection information, if any. May be null, specifically for non-generated code. /// If is not /// a valid descriptor. This can occur for a number of reasons, such as a field /// having an undefined type or because two messages were defined with the same name. - private static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, Type[] generatedTypes) + private static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies, GeneratedCodeInfo generatedCodeInfo) { // Building descriptors involves two steps: translating and linking. // In the translation step (implemented by FileDescriptor's @@ -289,7 +283,7 @@ namespace Google.Protobuf.Reflection } DescriptorPool pool = new DescriptorPool(dependencies); - FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies, generatedTypes); + FileDescriptor result = new FileDescriptor(proto, dependencies, pool, allowUnknownDependencies, generatedCodeInfo); // TODO(jonskeet): Reinstate these checks, or get rid of them entirely. They aren't in the Java code, // and fail for the CustomOptions test right now. (We get "descriptor.proto" vs "google/protobuf/descriptor.proto".) @@ -330,19 +324,13 @@ namespace Google.Protobuf.Reflection /// Creates an instance for generated code. /// /// - /// The parameter should be null for descriptors which don't correspond to - /// generated types. Otherwise, the array should represent all the generated types in the file: messages then - /// enums. Within each message, there can be nested messages and enums, which must be specified "inline" in the array: - /// containing message, nested messages, nested enums - and of course each nested message may contain *more* nested messages, - /// etc. All messages within the descriptor should be represented, even if they do not have a generated type - any - /// type without a corresponding generated type (such as map entries) should respond to a null element. - /// For example, a file with a messages OuterMessage and InnerMessage, and enums OuterEnum and InnerEnum (where - /// InnerMessage and InnerEnum are nested within InnerMessage) would result in an array of - /// OuterMessage, InnerMessage, InnerEnum, OuterEnum. + /// The parameter should be null for descriptors which don't correspond to + /// generated types. Otherwise, it should be a with nested types and nested + /// enums corresponding to the types and enums contained within the file descriptor. /// public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, FileDescriptor[] dependencies, - Type[] generatedTypes) + GeneratedCodeInfo generatedCodeInfo) { FileDescriptorProto proto; try @@ -358,7 +346,7 @@ namespace Google.Protobuf.Reflection { // When building descriptors for generated code, we allow unknown // dependencies by default. - return BuildFrom(proto, dependencies, true, generatedTypes); + return BuildFrom(proto, dependencies, true, generatedCodeInfo); } catch (DescriptorValidationException e) { diff --git a/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs b/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs new file mode 100644 index 00000000..8c52cd12 --- /dev/null +++ b/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs @@ -0,0 +1,66 @@ +using System; + +namespace Google.Protobuf.Reflection +{ + /// + /// Extra information provided by generated code when initializing a message or file descriptor. + /// These are constructed as required, and are not long-lived. Hand-written code should + /// never need to use this type. + /// + public sealed class GeneratedCodeInfo + { + private static readonly string[] EmptyNames = new string[0]; + private static readonly GeneratedCodeInfo[] EmptyCodeInfo = new GeneratedCodeInfo[0]; + + /// + /// Irrelevant for file descriptors; the CLR type for the message for message descriptors. + /// + public Type ClrType { get; private set; } + + /// + /// Irrelevant for file descriptors; the CLR property names (in message descriptor field order) + /// for fields in the message for message descriptors. + /// + public string[] PropertyNames { get; private set; } + + /// + /// Irrelevant for file descriptors; the CLR property "base" names (in message descriptor oneof order) + /// for oneofs in the message for message descriptors. It is expected that for a oneof name of "Foo", + /// there will be a "FooCase" property and a "ClearFoo" method. + /// + public string[] OneofNames { get; private set; } + + /// + /// The reflection information for types within this file/message descriptor. Elements may be null + /// if there is no corresponding generated type, e.g. for map entry types. + /// + public GeneratedCodeInfo[] NestedTypes { get; private set; } + + /// + /// The CLR types for enums within this file/message descriptor. + /// + public Type[] NestedEnums { get; private set; } + + /// + /// Creates a GeneratedCodeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names. + /// Each array parameter may be null, to indicate a lack of values. + /// The parameter order is designed to make it feasible to format the generated code readably. + /// + public GeneratedCodeInfo(Type clrType, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes) + { + NestedTypes = nestedTypes ?? EmptyCodeInfo; + NestedEnums = nestedEnums ?? ReflectionUtil.EmptyTypes; + ClrType = clrType; + PropertyNames = propertyNames ?? EmptyNames; + OneofNames = oneofNames ?? EmptyNames; + } + + /// + /// Creates a GeneratedCodeInfo for a file descriptor, with only types and enums. + /// + public GeneratedCodeInfo(Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes) + : this(null, null, null, nestedEnums, nestedTypes) + { + } + } +} \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs index 9413cf61..b29b4b20 100644 --- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs @@ -66,29 +66,33 @@ namespace Google.Protobuf.Reflection private readonly Type generatedType; private IDictionary fieldAccessorsByFieldNumber; - internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, IEnumerator generatedTypeIterator) + internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, GeneratedCodeInfo generatedCodeInfo) : base(file, file.ComputeFullName(parent, proto.Name), typeIndex) { this.proto = proto; - generatedType = ReflectionUtil.GetNextType(generatedTypeIterator); + generatedType = generatedCodeInfo == null ? null : generatedCodeInfo.ClrType; + containingType = parent; - oneofs = DescriptorUtil.ConvertAndMakeReadOnly(proto.OneofDecl, - (oneof, index) => - new OneofDescriptor(oneof, file, this, index)); + oneofs = DescriptorUtil.ConvertAndMakeReadOnly( + proto.OneofDecl, + (oneof, index) => + new OneofDescriptor(oneof, file, this, index, generatedCodeInfo == null ? null : generatedCodeInfo.OneofNames[index])); - nestedTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.NestedType, - (type, index) => - new MessageDescriptor(type, file, this, index, generatedTypeIterator)); + nestedTypes = DescriptorUtil.ConvertAndMakeReadOnly( + proto.NestedType, + (type, index) => + new MessageDescriptor(type, file, this, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedTypes[index])); - enumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType, - (type, index) => - new EnumDescriptor(type, file, this, index, ReflectionUtil.GetNextType(generatedTypeIterator))); + enumTypes = DescriptorUtil.ConvertAndMakeReadOnly( + proto.EnumType, + (type, index) => + new EnumDescriptor(type, file, this, index, generatedCodeInfo == null ? null : generatedCodeInfo.NestedEnums[index])); - // TODO(jonskeet): Sort fields first? - fields = DescriptorUtil.ConvertAndMakeReadOnly(proto.Field, - (field, index) => - new FieldDescriptor(field, file, this, index)); + fields = DescriptorUtil.ConvertAndMakeReadOnly( + proto.Field, + (field, index) => + new FieldDescriptor(field, file, this, index, generatedCodeInfo == null ? null : generatedCodeInfo.PropertyNames[index])); file.DescriptorPool.AddSymbol(this); } @@ -220,6 +224,6 @@ namespace Google.Protobuf.Reflection } fieldAccessorsByFieldNumber = new ReadOnlyDictionary(fields.ToDictionary(field => field.FieldNumber, field => field.Accessor)); - } + } } } \ No newline at end of file diff --git a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs index b4cc0791..a79d9de4 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs @@ -41,15 +41,16 @@ namespace Google.Protobuf.Reflection private readonly OneofDescriptorProto proto; private MessageDescriptor containingType; private IList fields; - private OneofAccessor accessor; + private readonly OneofAccessor accessor; - internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) + internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index, string clrName) : base(file, file.ComputeFullName(parent, proto.Name), index) { this.proto = proto; containingType = parent; file.DescriptorPool.AddSymbol(this); + accessor = CreateAccessor(clrName); } /// @@ -77,33 +78,23 @@ namespace Google.Protobuf.Reflection } } fields = new ReadOnlyCollection(fieldCollection); - accessor = CreateAccessor(); } - private OneofAccessor CreateAccessor() + private OneofAccessor CreateAccessor(string clrName) { - if (containingType.GeneratedType == null) + if (containingType.GeneratedType == null || clrName == null) { return null; } - var caseProperty = containingType - .GeneratedType - .GetProperties() - .FirstOrDefault(p => p.IsDefined(typeof(ProtobufOneofAttribute), false) && - p.GetCustomAttributes(typeof(ProtobufOneofAttribute), false).Cast().Single().Name == Name); + var caseProperty = containingType.GeneratedType.GetProperty(clrName + "Case"); if (caseProperty == null) { - return null; + throw new DescriptorValidationException(this, "Property " + clrName + "Case not found in " + containingType.GeneratedType); } - - var clearMethod = containingType - .GeneratedType - .GetMethods() - .FirstOrDefault(p => p.IsDefined(typeof(ProtobufOneofAttribute), false) && - p.GetCustomAttributes(typeof(ProtobufOneofAttribute), false).Cast().Single().Name == Name); + var clearMethod = containingType.GeneratedType.GetMethod("Clear" + clrName, ReflectionUtil.EmptyTypes); if (clearMethod == null) { - return null; + throw new DescriptorValidationException(this, "Method Clear" + clrName + " not found in " + containingType.GeneratedType); } return new OneofAccessor(caseProperty, clearMethod, this); diff --git a/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs b/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs deleted file mode 100644 index a59caea7..00000000 --- a/csharp/src/Google.Protobuf/Reflection/ProtobufFieldAttribute.cs +++ /dev/null @@ -1,58 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#endregion -using System; - -namespace Google.Protobuf.Reflection -{ - /// - /// Attribute applied to a generated property corresponding to a field in a .proto file. - /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] - public sealed class ProtobufFieldAttribute : Attribute - { - /// - /// The field number in the original .proto file. - /// - public int Number { get; set; } - - /// - /// The field name in the original .proto file. - /// - public string Name { get; set; } - - public ProtobufFieldAttribute(int number, string name) - { - this.Number = number; - this.Name = name; - } - } -} diff --git a/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs b/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs deleted file mode 100644 index 74ad8c53..00000000 --- a/csharp/src/Google.Protobuf/Reflection/ProtobufOneofAttribute.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region Copyright notice and license -// Protocol Buffers - Google's data interchange format -// Copyright 2015 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#endregion -using System; - -namespace Google.Protobuf.Reflection -{ - /// - /// Attribute applied to the "case" property or "clear" method corresponding to a oneof in a .proto file. - /// - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)] - public sealed class ProtobufOneofAttribute : Attribute - { - /// - /// The oneof name in the original .proto file. - /// - public string Name { get; set; } - - public ProtobufOneofAttribute(string name) - { - this.Name = name; - } - } -} diff --git a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs index ec222dc1..5b3cbb36 100644 --- a/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs +++ b/csharp/src/Google.Protobuf/Reflection/ReflectionUtil.cs @@ -102,25 +102,6 @@ namespace Google.Protobuf.Reflection Expression castTarget = Expression.Convert(targetParameter, method.DeclaringType); Expression call = Expression.Call(castTarget, method); return Expression.Lambda>(call, targetParameter).Compile(); - } - - /// - /// Returns the next type from an iterator of types, unless the iterator is a null reference, - /// in which case null is returned. - /// - internal static Type GetNextType(IEnumerator generatedTypeIterator) - { - if (generatedTypeIterator == null) - { - return null; - } - if (!generatedTypeIterator.MoveNext()) - { - // This parameter name corresponds to any public method supplying the generated types to start with. - throw new ArgumentException("More generated types left over after consuming all expected ones", "generatedTypes"); - } - return generatedTypeIterator.Current; - } - + } } } \ No newline at end of file diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.cc b/src/google/protobuf/compiler/csharp/csharp_field_base.cc index d327e267..2459d457 100644 --- a/src/google/protobuf/compiler/csharp/csharp_field_base.cc +++ b/src/google/protobuf/compiler/csharp/csharp_field_base.cc @@ -74,7 +74,6 @@ void FieldGeneratorBase::SetCommonFieldVariables( (*variables)["property_name"] = property_name(); (*variables)["type_name"] = type_name(); - (*variables)["original_name"] = descriptor_->name(); (*variables)["name"] = name(); (*variables)["descriptor_name"] = descriptor_->name(); (*variables)["default_value"] = default_value(); @@ -431,10 +430,6 @@ std::string FieldGeneratorBase::capitalized_type_name() { } } -std::string FieldGeneratorBase::field_ordinal() { - return SimpleItoa(fieldOrdinal_); -} - } // namespace csharp } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.h b/src/google/protobuf/compiler/csharp/csharp_field_base.h index 4761dc49..d83543bd 100644 --- a/src/google/protobuf/compiler/csharp/csharp_field_base.h +++ b/src/google/protobuf/compiler/csharp/csharp_field_base.h @@ -85,7 +85,6 @@ class FieldGeneratorBase : public SourceGeneratorBase { std::string default_value(const FieldDescriptor* descriptor); std::string number(); std::string capitalized_type_name(); - std::string field_ordinal(); private: void SetCommonFieldVariables(map* variables); diff --git a/src/google/protobuf/compiler/csharp/csharp_map_field.cc b/src/google/protobuf/compiler/csharp/csharp_map_field.cc index bdbfd92b..cba24a59 100644 --- a/src/google/protobuf/compiler/csharp/csharp_map_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_map_field.cc @@ -79,7 +79,6 @@ void MapFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::MapField<$key_type_name$, $value_type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index 42fd5065..6a22a336 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -115,19 +115,6 @@ void MessageGenerator::Generate(io::Printer* printer) { vars, "private static readonly pb::MessageParser<$class_name$> _parser = new pb::MessageParser<$class_name$>(() => new $class_name$());\n" "public static pb::MessageParser<$class_name$> Parser { get { return _parser; } }\n\n"); - printer->Print( - "private static readonly string[] _fieldNames = " - "new string[] { $slash$$field_names$$slash$ };\n", - "field_names", JoinStrings(field_names(), "\", \""), - "slash", field_names().size() > 0 ? "\"" : ""); - std::vector tags; - for (int i = 0; i < field_names().size(); i++) { - uint32 tag = FixedMakeTag(descriptor_->FindFieldByName(field_names()[i])); - tags.push_back(SimpleItoa(tag)); - } - printer->Print( - "private static readonly uint[] _fieldTags = new uint[] { $tags$ };\n", - "tags", JoinStrings(tags, ", ")); // Access the message descriptor via the relevant file descriptor or containing message descriptor. if (!descriptor_->containing_type()) { diff --git a/src/google/protobuf/compiler/csharp/csharp_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_message_field.cc index c2b6ff76..d2c3a88b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message_field.cc @@ -64,7 +64,6 @@ void MessageFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -159,7 +158,6 @@ void MessageOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : null; }\n" " set {\n" diff --git a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc index 2c9338bd..4454ef02 100644 --- a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc @@ -71,7 +71,6 @@ void PrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -175,7 +174,6 @@ void PrimitiveOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : $default_value$; }\n" " set {\n" diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc index 60d06154..c1b29e2b 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc @@ -65,7 +65,6 @@ void RepeatedEnumFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc index 921798b0..d939fc79 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc @@ -78,7 +78,6 @@ void RepeatedMessageFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc index bcfb9936..5b5d9b3d 100644 --- a/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc @@ -65,7 +65,6 @@ void RepeatedPrimitiveFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ pbc::RepeatedField<$type_name$> $property_name$ {\n" " get { return $name$_; }\n" "}\n"); diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc index 3f39250e..6eb1547e 100644 --- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc +++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -168,10 +169,10 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) { printer->Print("\"$base64$\", \n", "base64", base64.substr(0, 60)); base64 = base64.substr(60); } - printer->Outdent(); printer->Print("\"$base64$\"));\n", "base64", base64); printer->Outdent(); printer->Outdent(); + printer->Outdent(); // ----------------------------------------------------------------- // Invoke InternalBuildGeneratedFileFrom() to build the file. @@ -184,34 +185,108 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) { "full_umbrella_class_name", GetFullUmbrellaClassName(file_->dependency(i))); } - // Specify all the generated types (messages and enums), recursively, as an array. printer->Print("},\n" - " new global::System.Type[] { "); - for (int i = 0; i < file_->message_type_count(); i++) { - WriteTypeLiterals(file_->message_type(i), printer); + " new pbr::GeneratedCodeInfo("); + // Specify all the generated code information, recursively. + if (file_->enum_type_count() > 0) { + printer->Print("new[] {"); + for (int i = 0; i < file_->enum_type_count(); i++) { + printer->Print("typeof($type_name$), ", "type_name", GetClassName(file_->enum_type(i))); + } + printer->Print("}, "); } - for (int i = 0; i < file_->enum_type_count(); i++) { - printer->Print("typeof($type_name$), ", "type_name", GetClassName(file_->enum_type(i))); + else { + printer->Print("null, "); + } + if (file_->message_type_count() > 0) { + printer->Print("new pbr::GeneratedCodeInfo[] {\n"); + printer->Indent(); + printer->Indent(); + printer->Indent(); + for (int i = 0; i < file_->message_type_count(); i++) { + WriteGeneratedCodeInfo(file_->message_type(i), printer, i == file_->message_type_count() - 1); + } + printer->Outdent(); + printer->Print("\n}));\n"); + printer->Outdent(); + printer->Outdent(); + } + else { + printer->Print("null));\n"); } - printer->Print("});\n"); printer->Outdent(); printer->Print("}\n"); printer->Print("#endregion\n\n"); } -void UmbrellaClassGenerator::WriteTypeLiterals(const Descriptor* descriptor, io::Printer* printer) { - if (IsMapEntryMessage(descriptor)) { - printer->Print("null, "); - return; - } - printer->Print("typeof($type_name$), ", "type_name", GetClassName(descriptor)); - for (int i = 0; i < descriptor->nested_type_count(); i++) { - WriteTypeLiterals(descriptor->nested_type(i), printer); - } - for (int i = 0; i < descriptor->enum_type_count(); i++) { - printer->Print("typeof($type_name$), ", "type_name", GetClassName(descriptor->enum_type(i))); - } +// Write out the generated code for a particular message. This consists of the CLR type, property names +// corresponding to fields, names corresponding to oneofs, nested enums, and nested types. Each array part +// can be specified as null if it would be empty, to make the generated code somewhat simpler to read. +// We write a line break at the end of each generated code info, so that in the final file we'll see all +// the types, pre-ordered depth first, one per line. The indentation will be slightly unusual, +// in that it will look like a single array when it's actually constructing a tree, but it'll be easy to +// read even with multiple levels of nesting. +// The "last" parameter indicates whether this message descriptor is the last one being printed in this immediate +// context. It governs whether or not a trailing comma and newline is written after the constructor, effectively +// just controlling the formatting in the generated code. +void UmbrellaClassGenerator::WriteGeneratedCodeInfo(const Descriptor* descriptor, io::Printer* printer, bool last) { + if (IsMapEntryMessage(descriptor)) { + printer->Print("null, "); + return; + } + // Generated message type + printer->Print("new pbr::GeneratedCodeInfo(typeof($type_name$), ", "type_name", GetClassName(descriptor)); + + // Fields + if (descriptor->field_count() > 0) { + std::vector fields; + for (int i = 0; i < descriptor->field_count(); i++) { + fields.push_back(GetPropertyName(descriptor->field(i))); + } + printer->Print("new[]{ \"$fields$\" }, ", "fields", JoinStrings(fields, "\", \"")); + } + else { + printer->Print("null, "); + } + + // Oneofs + if (descriptor->oneof_decl_count() > 0) { + std::vector oneofs; + for (int i = 0; i < descriptor->oneof_decl_count(); i++) { + oneofs.push_back(UnderscoresToCamelCase(descriptor->oneof_decl(i)->name(), true)); + } + printer->Print("new[]{ \"$oneofs$\" }, ", "oneofs", JoinStrings(oneofs, "\", \"")); + } + else { + printer->Print("null, "); + } + + // Nested enums + if (descriptor->enum_type_count() > 0) { + std::vector enums; + for (int i = 0; i < descriptor->enum_type_count(); i++) { + enums.push_back(GetClassName(descriptor->enum_type(i))); + } + printer->Print("new[]{ typeof($enums$) }, ", "enums", JoinStrings(enums, "), typeof(")); + } + else { + printer->Print("null, "); + } + + // Nested types + if (descriptor->nested_type_count() > 0) { + // Need to specify array type explicitly here, as all elements may be null. + printer->Print("new pbr::GeneratedCodeInfo[] { "); + for (int i = 0; i < descriptor->nested_type_count(); i++) { + WriteGeneratedCodeInfo(descriptor->nested_type(i), printer, i == descriptor->nested_type_count() - 1); + } + printer->Print("}"); + } + else { + printer->Print("null"); + } + printer->Print(last ? ")" : "),\n"); } } // namespace csharp diff --git a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h index db1092a9..b8bd2133 100644 --- a/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h +++ b/src/google/protobuf/compiler/csharp/csharp_umbrella_class.h @@ -57,7 +57,7 @@ class UmbrellaClassGenerator : public SourceGeneratorBase { void WriteIntroduction(io::Printer* printer); void WriteDescriptor(io::Printer* printer); - void WriteTypeLiterals(const Descriptor* descriptor, io::Printer* printer); + void WriteGeneratedCodeInfo(const Descriptor* descriptor, io::Printer* printer, bool last); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(UmbrellaClassGenerator); }; diff --git a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc index d6cd0a10..75ef5e50 100644 --- a/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc +++ b/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc @@ -73,7 +73,6 @@ void WrapperFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $name$_; }\n" " set {\n" @@ -170,7 +169,6 @@ void WrapperOneofFieldGenerator::GenerateMembers(io::Printer* printer) { AddDeprecatedFlag(printer); printer->Print( variables_, - "[pbr::ProtobufField($number$, \"$original_name$\")]\n" "$access_level$ $type_name$ $property_name$ {\n" " get { return $has_property_check$ ? ($type_name$) $oneof_name$_ : ($type_name$) null; }\n" " set {\n" From 47bf49b9fab55b2046398ac0450d6ec97f663e48 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 22 Jul 2015 11:39:38 +0100 Subject: [PATCH 5/8] Generated code for previous commit. --- csharp/src/AddressBook/Addressbook.cs | 20 +- .../TestProtos/MapUnittestProto3.cs | 64 +---- .../TestProtos/UnittestImportProto3.cs | 9 +- .../TestProtos/UnittestImportPublicProto3.cs | 9 +- .../TestProtos/UnittestIssues.cs | 34 +-- .../TestProtos/UnittestProto3.cs | 232 +++--------------- .../TestProtos/UnittestWellKnownTypes.cs | 89 +------ .../src/Google.Protobuf/WellKnownTypes/Any.cs | 10 +- .../src/Google.Protobuf/WellKnownTypes/Api.cs | 22 +- .../WellKnownTypes/Duration.cs | 10 +- .../Google.Protobuf/WellKnownTypes/Empty.cs | 8 +- .../WellKnownTypes/FieldMask.cs | 9 +- .../WellKnownTypes/SourceContext.cs | 9 +- .../Google.Protobuf/WellKnownTypes/Struct.cs | 22 +- .../WellKnownTypes/Timestamp.cs | 10 +- .../Google.Protobuf/WellKnownTypes/Type.cs | 42 +--- .../WellKnownTypes/Wrappers.cs | 41 +--- 17 files changed, 129 insertions(+), 511 deletions(-) diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 92257064..231f1d09 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -29,10 +29,13 @@ namespace Google.Protobuf.Examples.AddressBook { "EggKBEhPTUUQARIICgRXT1JLEAIiLwoLQWRkcmVzc0Jvb2sSIAoGcGVvcGxl", "GAEgAygLMhAudHV0b3JpYWwuUGVyc29uQlAKFGNvbS5leGFtcGxlLnR1dG9y", "aWFsQhFBZGRyZXNzQm9va1Byb3Rvc6oCJEdvb2dsZS5Qcm90b2J1Zi5FeGFt", - "cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); + "cGxlcy5BZGRyZXNzQm9va2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.Examples.AddressBook.Person), typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType), typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person), new[]{ "Name", "Id", "Email", "Phones" }, null, new[]{ typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) }, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), new[]{ "Number", "Type" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), new[]{ "People" }, null, null, null) + })); } #endregion @@ -43,8 +46,6 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Person()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "email", "id", "name", "phones" }; - private static readonly uint[] _fieldTags = new uint[] { 26, 16, 10, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[0]; } } @@ -83,7 +84,6 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -94,7 +94,6 @@ namespace Google.Protobuf.Examples.AddressBook { public const int IdFieldNumber = 2; private int id_; - [pbr::ProtobufField(2, "id")] public int Id { get { return id_; } set { @@ -105,7 +104,6 @@ namespace Google.Protobuf.Examples.AddressBook { public const int EmailFieldNumber = 3; private string email_ = ""; - [pbr::ProtobufField(3, "email")] public string Email { get { return email_; } set { @@ -118,7 +116,6 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_phones_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber.Parser); private readonly pbc::RepeatedField phones_ = new pbc::RepeatedField(); - [pbr::ProtobufField(4, "phones")] public pbc::RepeatedField Phones { get { return phones_; } } @@ -246,8 +243,6 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PhoneNumber()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "number", "type" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } } @@ -283,7 +278,6 @@ namespace Google.Protobuf.Examples.AddressBook { public const int NumberFieldNumber = 1; private string number_ = ""; - [pbr::ProtobufField(1, "number")] public string Number { get { return number_; } set { @@ -294,7 +288,6 @@ namespace Google.Protobuf.Examples.AddressBook { public const int TypeFieldNumber = 2; private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE; - [pbr::ProtobufField(2, "type")] public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { get { return type_; } set { @@ -399,8 +392,6 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AddressBook()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "people" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[1]; } } @@ -438,7 +429,6 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly pb::FieldCodec _repeated_people_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.Examples.AddressBook.Person.Parser); private readonly pbc::RepeatedField people_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "people")] public pbc::RepeatedField People { get { return people_; } } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs index 4eeb7423..7da82bf0 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs @@ -144,10 +144,18 @@ namespace Google.Protobuf.TestProtos { "dHJ5LkVudHJ5RW50cnkaLAoKRW50cnlFbnRyeRILCgNrZXkYASABKAUSDQoF", "dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS", "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", - "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); + "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestMap), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), typeof(global::Google.Protobuf.TestProtos.TestMessageMap), null, typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), null, null, typeof(global::Google.Protobuf.TestProtos.TestArenaMap), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), null, typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.Type), typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), null, typeof(global::Google.Protobuf.TestProtos.MapEnum), }); + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.MapEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMap), new[]{ "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapInt32Bytes", "MapInt32Enum", "MapInt32ForeignMessage" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), new[]{ "TestMap" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMessageMap), new[]{ "MapInt32Message" }, null, null, new pbr::GeneratedCodeInfo[] { null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), new[]{ "Map1", "Map2" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestArenaMap), new[]{ "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapInt32Enum", "MapInt32ForeignMessage" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), new[]{ "Type" }, null, new[]{ typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.Type) }, new pbr::GeneratedCodeInfo[] { null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), new[]{ "Entry" }, null, null, new pbr::GeneratedCodeInfo[] { null, }) + })); } #endregion @@ -167,8 +175,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMap()); 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_bytes", "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_string_string", "map_uint32_uint32", "map_uint64_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 106, 58, 66, 122, 98, 130, 90, 138, 10, 18, 74, 82, 42, 50, 114, 26, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[0]; } } @@ -238,7 +244,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(1, "map_int32_int32")] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -247,7 +252,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(2, "map_int64_int64")] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -256,7 +260,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(3, "map_uint32_uint32")] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -265,7 +268,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(4, "map_uint64_uint64")] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -274,7 +276,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(5, "map_sint32_sint32")] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -283,7 +284,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(6, "map_sint64_sint64")] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -292,7 +292,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(7, "map_fixed32_fixed32")] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -301,7 +300,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(8, "map_fixed64_fixed64")] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -310,7 +308,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(9, "map_sfixed32_sfixed32")] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -319,7 +316,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(10, "map_sfixed64_sfixed64")] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -328,7 +324,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(11, "map_int32_float")] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -337,7 +332,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(12, "map_int32_double")] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -346,7 +340,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(13, "map_bool_bool")] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -355,7 +348,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_mapStringString_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 114); private readonly pbc::MapField mapStringString_ = new pbc::MapField(); - [pbr::ProtobufField(14, "map_string_string")] public pbc::MapField MapStringString { get { return mapStringString_; } } @@ -364,7 +356,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_mapInt32Bytes_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForBytes(18), 122); private readonly pbc::MapField mapInt32Bytes_ = new pbc::MapField(); - [pbr::ProtobufField(15, "map_int32_bytes")] public pbc::MapField MapInt32Bytes { get { return mapInt32Bytes_; } } @@ -373,7 +364,6 @@ namespace Google.Protobuf.TestProtos { 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), 130); private readonly pbc::MapField mapInt32Enum_ = new pbc::MapField(); - [pbr::ProtobufField(16, "map_int32_enum")] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -382,7 +372,6 @@ namespace Google.Protobuf.TestProtos { 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), 138); private readonly pbc::MapField mapInt32ForeignMessage_ = new pbc::MapField(); - [pbr::ProtobufField(17, "map_int32_foreign_message")] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } @@ -599,8 +588,6 @@ namespace Google.Protobuf.TestProtos { 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]; } } @@ -636,7 +623,6 @@ namespace Google.Protobuf.TestProtos { public const int TestMapFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMap testMap_; - [pbr::ProtobufField(1, "test_map")] public global::Google.Protobuf.TestProtos.TestMap TestMap { get { return testMap_; } set { @@ -726,8 +712,6 @@ namespace Google.Protobuf.TestProtos { 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]; } } @@ -765,7 +749,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(1, "map_int32_message")] public pbc::MapField MapInt32Message { get { return mapInt32Message_; } } @@ -838,8 +821,6 @@ namespace Google.Protobuf.TestProtos { 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]; } } @@ -879,7 +860,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(1, "map1")] public pbc::MapField Map1 { get { return map1_; } } @@ -888,7 +868,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(2, "map2")] public pbc::MapField Map2 { get { return map2_; } } @@ -970,8 +949,6 @@ namespace Google.Protobuf.TestProtos { 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]; } } @@ -1037,7 +1014,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(1, "map_int32_int32")] public pbc::MapField MapInt32Int32 { get { return mapInt32Int32_; } } @@ -1046,7 +1022,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(2, "map_int64_int64")] public pbc::MapField MapInt64Int64 { get { return mapInt64Int64_; } } @@ -1055,7 +1030,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(3, "map_uint32_uint32")] public pbc::MapField MapUint32Uint32 { get { return mapUint32Uint32_; } } @@ -1064,7 +1038,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(4, "map_uint64_uint64")] public pbc::MapField MapUint64Uint64 { get { return mapUint64Uint64_; } } @@ -1073,7 +1046,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(5, "map_sint32_sint32")] public pbc::MapField MapSint32Sint32 { get { return mapSint32Sint32_; } } @@ -1082,7 +1054,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(6, "map_sint64_sint64")] public pbc::MapField MapSint64Sint64 { get { return mapSint64Sint64_; } } @@ -1091,7 +1062,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(7, "map_fixed32_fixed32")] public pbc::MapField MapFixed32Fixed32 { get { return mapFixed32Fixed32_; } } @@ -1100,7 +1070,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(8, "map_fixed64_fixed64")] public pbc::MapField MapFixed64Fixed64 { get { return mapFixed64Fixed64_; } } @@ -1109,7 +1078,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(9, "map_sfixed32_sfixed32")] public pbc::MapField MapSfixed32Sfixed32 { get { return mapSfixed32Sfixed32_; } } @@ -1118,7 +1086,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(10, "map_sfixed64_sfixed64")] public pbc::MapField MapSfixed64Sfixed64 { get { return mapSfixed64Sfixed64_; } } @@ -1127,7 +1094,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(11, "map_int32_float")] public pbc::MapField MapInt32Float { get { return mapInt32Float_; } } @@ -1136,7 +1102,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(12, "map_int32_double")] public pbc::MapField MapInt32Double { get { return mapInt32Double_; } } @@ -1145,7 +1110,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(13, "map_bool_bool")] public pbc::MapField MapBoolBool { get { return mapBoolBool_; } } @@ -1154,7 +1118,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(14, "map_int32_enum")] public pbc::MapField MapInt32Enum { get { return mapInt32Enum_; } } @@ -1163,7 +1126,6 @@ namespace Google.Protobuf.TestProtos { 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(); - [pbr::ProtobufField(15, "map_int32_foreign_message")] public pbc::MapField MapInt32ForeignMessage { get { return mapInt32ForeignMessage_; } } @@ -1362,8 +1324,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingEnumCalledType()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "type" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[5]; } } @@ -1401,7 +1361,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_type_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Parser), 10); private readonly pbc::MapField type_ = new pbc::MapField(); - [pbr::ProtobufField(1, "type")] public pbc::MapField Type { get { return type_; } } @@ -1484,8 +1443,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageContainingMapCalledEntry()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "entry" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[6]; } } @@ -1523,7 +1480,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_entry_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForInt32(16), 10); private readonly pbc::MapField entry_ = new pbc::MapField(); - [pbr::ProtobufField(1, "entry")] public pbc::MapField Entry { get { return entry_; } } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index 87bec2af..517225b6 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -28,10 +28,12 @@ namespace Google.Protobuf.TestProtos { "VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB", "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", - "Mw==")); + "Mw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.ImportMessage), typeof(global::Google.Protobuf.TestProtos.ImportEnum), }); + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ImportEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.ImportMessage), new[]{ "D" }, null, null, null) + })); } #endregion @@ -52,8 +54,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImportMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "d" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor.MessageTypes[0]; } } @@ -88,7 +88,6 @@ namespace Google.Protobuf.TestProtos { public const int DFieldNumber = 1; private int d_; - [pbr::ProtobufField(1, "d")] public int D { get { return d_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs index a983dfa8..11ec29dd 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs @@ -24,10 +24,12 @@ namespace Google.Protobuf.TestProtos { "CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90", "bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ", "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", - "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); + "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), new[]{ "E" }, null, null, null) + })); } #endregion @@ -38,8 +40,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PublicImportMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "e" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor.MessageTypes[0]; } } @@ -74,7 +74,6 @@ namespace Google.Protobuf.TestProtos { public const int EFieldNumber = 1; private int e_; - [pbr::ProtobufField(1, "e")] public int E { get { return e_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index 9a656f25..07466650 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -38,10 +38,16 @@ namespace UnitTest.Issues.TestProtos { "dGl2ZUVudW0SFgoSTkVHQVRJVkVfRU5VTV9aRVJPEAASFgoJRml2ZUJlbG93", "EPv//////////wESFQoITWludXNPbmUQ////////////ASouCg5EZXByZWNh", "dGVkRW51bRITCg9ERVBSRUNBVEVEX1pFUk8QABIHCgNvbmUQAUIfSAGqAhpV", - "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); + "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::UnitTest.Issues.TestProtos.Issue307), typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), typeof(global::UnitTest.Issues.TestProtos.ItemField), typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }); + new pbr::GeneratedCodeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), null, null, null, null)})}), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), new[]{ "Value", "Values", "PackedValues" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), new[]{ "Item" }, null, null, null) + })); } #endregion @@ -66,8 +72,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Issue307()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; } } @@ -159,8 +163,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedOnce()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } @@ -252,8 +254,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTwice()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } @@ -354,8 +354,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NegativeEnumMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "packed_values", "value", "values" }; - private static readonly uint[] _fieldTags = new uint[] { 26, 8, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; } } @@ -394,7 +392,6 @@ namespace UnitTest.Issues.TestProtos { public const int ValueFieldNumber = 1; private global::UnitTest.Issues.TestProtos.NegativeEnum value_ = global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO; - [pbr::ProtobufField(1, "value")] public global::UnitTest.Issues.TestProtos.NegativeEnum Value { get { return value_; } set { @@ -407,7 +404,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::FieldCodec _repeated_values_codec = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "values")] public pbc::RepeatedField Values { get { return values_; } } @@ -416,7 +412,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::FieldCodec _repeated_packedValues_codec = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); private readonly pbc::RepeatedField packedValues_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "packed_values")] public pbc::RepeatedField PackedValues { get { return packedValues_; } } @@ -516,8 +511,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedChild()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; } } @@ -608,8 +601,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DeprecatedFieldsMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "EnumArray", "EnumValue", "MessageArray", "MessageValue", "PrimitiveArray", "PrimitiveValue" }; - private static readonly uint[] _fieldTags = new uint[] { 50, 40, 34, 26, 18, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; } } @@ -654,7 +645,6 @@ namespace UnitTest.Issues.TestProtos { public const int PrimitiveValueFieldNumber = 1; private int primitiveValue_; [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(1, "PrimitiveValue")] public int PrimitiveValue { get { return primitiveValue_; } set { @@ -668,7 +658,6 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField primitiveArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(2, "PrimitiveArray")] public pbc::RepeatedField PrimitiveArray { get { return primitiveArray_; } } @@ -676,7 +665,6 @@ namespace UnitTest.Issues.TestProtos { public const int MessageValueFieldNumber = 3; private global::UnitTest.Issues.TestProtos.DeprecatedChild messageValue_; [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(3, "MessageValue")] public global::UnitTest.Issues.TestProtos.DeprecatedChild MessageValue { get { return messageValue_; } set { @@ -690,7 +678,6 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForMessage(34, global::UnitTest.Issues.TestProtos.DeprecatedChild.Parser); private readonly pbc::RepeatedField messageArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(4, "MessageArray")] public pbc::RepeatedField MessageArray { get { return messageArray_; } } @@ -698,7 +685,6 @@ namespace UnitTest.Issues.TestProtos { public const int EnumValueFieldNumber = 5; private global::UnitTest.Issues.TestProtos.DeprecatedEnum enumValue_ = global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO; [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(5, "EnumValue")] public global::UnitTest.Issues.TestProtos.DeprecatedEnum EnumValue { get { return enumValue_; } set { @@ -712,7 +698,6 @@ namespace UnitTest.Issues.TestProtos { = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); private readonly pbc::RepeatedField enumArray_ = new pbc::RepeatedField(); [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(6, "EnumArray")] public pbc::RepeatedField EnumArray { get { return enumArray_; } } @@ -859,8 +844,6 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ItemField()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "item" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; } } @@ -895,7 +878,6 @@ namespace UnitTest.Issues.TestProtos { public const int ItemFieldNumber = 1; private int item_; - [pbr::ProtobufField(1, "item")] public int Item { get { return item_; } set { diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index 55ed08af..01492b29 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -147,10 +147,44 @@ namespace Google.Protobuf.TestProtos { "cXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5Gb29SZXNwb25zZRJECgNCYXIS", "HS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1ZXN0Gh4ucHJvdG9idWZfdW5p", "dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB", - "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); + "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestAllTypes), typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum), typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), typeof(global::Google.Protobuf.TestProtos.ForeignMessage), typeof(global::Google.Protobuf.TestProtos.TestReservedFields), typeof(global::Google.Protobuf.TestProtos.TestForeignNested), typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), typeof(global::Google.Protobuf.TestProtos.OneString), typeof(global::Google.Protobuf.TestProtos.MoreString), typeof(global::Google.Protobuf.TestProtos.OneBytes), typeof(global::Google.Protobuf.TestProtos.MoreBytes), typeof(global::Google.Protobuf.TestProtos.Int32Message), typeof(global::Google.Protobuf.TestProtos.Uint32Message), typeof(global::Google.Protobuf.TestProtos.Int64Message), typeof(global::Google.Protobuf.TestProtos.Uint64Message), typeof(global::Google.Protobuf.TestProtos.BoolMessage), typeof(global::Google.Protobuf.TestProtos.TestOneof), typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), typeof(global::Google.Protobuf.TestProtos.FooRequest), typeof(global::Google.Protobuf.TestProtos.FooResponse), typeof(global::Google.Protobuf.TestProtos.FooClientMessage), typeof(global::Google.Protobuf.TestProtos.FooServerMessage), typeof(global::Google.Protobuf.TestProtos.BarRequest), typeof(global::Google.Protobuf.TestProtos.BarResponse), typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), }); + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestAllTypes), new[]{ "SingleInt32", "SingleInt64", "SingleUint32", "SingleUint64", "SingleSint32", "SingleSint64", "SingleFixed32", "SingleFixed64", "SingleSfixed32", "SingleSfixed64", "SingleFloat", "SingleDouble", "SingleBool", "SingleString", "SingleBytes", "SingleNestedMessage", "SingleForeignMessage", "SingleImportMessage", "SingleNestedEnum", "SingleForeignEnum", "SingleImportEnum", "SinglePublicImportMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedPublicImportMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes" }, new[]{ "OneofField" }, new[]{ typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) }, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), new[]{ "Bb" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), new[]{ "Child", "Payload", "RepeatedChild" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), new[]{ "DeprecatedInt32" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.ForeignMessage), new[]{ "C" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestReservedFields), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestForeignNested), new[]{ "ForeignNested" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), new[]{ "A", "Bb" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), new[]{ "A", "I" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), new[]{ "Bb" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), new[]{ "A", "OptionalInt32" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), new[]{ "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), new[]{ "MyString", "MyInt", "MyFloat", "SingleNestedMessage" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), new[]{ "Oo", "Bb" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), new[]{ "SparseEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneString), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MoreString), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneBytes), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MoreBytes), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Int32Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Uint32Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Int64Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Uint64Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BoolMessage), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestOneof), new[]{ "FooInt", "FooString", "FooMessage" }, new[]{ "Foo" }, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), new[]{ "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), new[]{ "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), new[]{ "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), new[]{ "A" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooRequest), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooResponse), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BarRequest), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BarResponse), null, null, null, null) + })); } #endregion @@ -190,8 +224,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestAllTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "oneof_bytes", "oneof_nested_message", "oneof_string", "oneof_uint32", "repeated_bool", "repeated_bytes", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_public_import_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_uint32", "repeated_uint64", "single_bool", "single_bytes", "single_double", "single_fixed32", "single_fixed64", "single_float", "single_foreign_enum", "single_foreign_message", "single_import_enum", "single_import_message", "single_int32", "single_int64", "single_nested_enum", "single_nested_message", "single_public_import_message", "single_sfixed32", "single_sfixed64", "single_sint32", "single_sint64", "single_string", "single_uint32", "single_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 914, 898, 906, 888, 346, 362, 338, 298, 306, 330, 418, 394, 426, 402, 250, 258, 410, 386, 434, 314, 322, 282, 290, 354, 266, 274, 104, 122, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 210, 77, 81, 40, 48, 114, 24, 32 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[0]; } } @@ -311,7 +343,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt32FieldNumber = 1; private int singleInt32_; - [pbr::ProtobufField(1, "single_int32")] public int SingleInt32 { get { return singleInt32_; } set { @@ -322,7 +353,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleInt64FieldNumber = 2; private long singleInt64_; - [pbr::ProtobufField(2, "single_int64")] public long SingleInt64 { get { return singleInt64_; } set { @@ -333,7 +363,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint32FieldNumber = 3; private uint singleUint32_; - [pbr::ProtobufField(3, "single_uint32")] public uint SingleUint32 { get { return singleUint32_; } set { @@ -344,7 +373,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleUint64FieldNumber = 4; private ulong singleUint64_; - [pbr::ProtobufField(4, "single_uint64")] public ulong SingleUint64 { get { return singleUint64_; } set { @@ -355,7 +383,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint32FieldNumber = 5; private int singleSint32_; - [pbr::ProtobufField(5, "single_sint32")] public int SingleSint32 { get { return singleSint32_; } set { @@ -366,7 +393,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSint64FieldNumber = 6; private long singleSint64_; - [pbr::ProtobufField(6, "single_sint64")] public long SingleSint64 { get { return singleSint64_; } set { @@ -377,7 +403,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed32FieldNumber = 7; private uint singleFixed32_; - [pbr::ProtobufField(7, "single_fixed32")] public uint SingleFixed32 { get { return singleFixed32_; } set { @@ -388,7 +413,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFixed64FieldNumber = 8; private ulong singleFixed64_; - [pbr::ProtobufField(8, "single_fixed64")] public ulong SingleFixed64 { get { return singleFixed64_; } set { @@ -399,7 +423,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed32FieldNumber = 9; private int singleSfixed32_; - [pbr::ProtobufField(9, "single_sfixed32")] public int SingleSfixed32 { get { return singleSfixed32_; } set { @@ -410,7 +433,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleSfixed64FieldNumber = 10; private long singleSfixed64_; - [pbr::ProtobufField(10, "single_sfixed64")] public long SingleSfixed64 { get { return singleSfixed64_; } set { @@ -421,7 +443,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleFloatFieldNumber = 11; private float singleFloat_; - [pbr::ProtobufField(11, "single_float")] public float SingleFloat { get { return singleFloat_; } set { @@ -432,7 +453,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleDoubleFieldNumber = 12; private double singleDouble_; - [pbr::ProtobufField(12, "single_double")] public double SingleDouble { get { return singleDouble_; } set { @@ -443,7 +463,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleBoolFieldNumber = 13; private bool singleBool_; - [pbr::ProtobufField(13, "single_bool")] public bool SingleBool { get { return singleBool_; } set { @@ -454,7 +473,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleStringFieldNumber = 14; private string singleString_ = ""; - [pbr::ProtobufField(14, "single_string")] public string SingleString { get { return singleString_; } set { @@ -465,7 +483,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleBytesFieldNumber = 15; private pb::ByteString singleBytes_ = pb::ByteString.Empty; - [pbr::ProtobufField(15, "single_bytes")] public pb::ByteString SingleBytes { get { return singleBytes_; } set { @@ -476,7 +493,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 18; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage singleNestedMessage_; - [pbr::ProtobufField(18, "single_nested_message")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -487,7 +503,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignMessageFieldNumber = 19; private global::Google.Protobuf.TestProtos.ForeignMessage singleForeignMessage_; - [pbr::ProtobufField(19, "single_foreign_message")] public global::Google.Protobuf.TestProtos.ForeignMessage SingleForeignMessage { get { return singleForeignMessage_; } set { @@ -498,7 +513,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportMessageFieldNumber = 20; private global::Google.Protobuf.TestProtos.ImportMessage singleImportMessage_; - [pbr::ProtobufField(20, "single_import_message")] public global::Google.Protobuf.TestProtos.ImportMessage SingleImportMessage { get { return singleImportMessage_; } set { @@ -509,7 +523,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedEnumFieldNumber = 21; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum singleNestedEnum_ = global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum.NESTED_ENUM_UNSPECIFIED; - [pbr::ProtobufField(21, "single_nested_enum")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum SingleNestedEnum { get { return singleNestedEnum_; } set { @@ -520,7 +533,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleForeignEnumFieldNumber = 22; private global::Google.Protobuf.TestProtos.ForeignEnum singleForeignEnum_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; - [pbr::ProtobufField(22, "single_foreign_enum")] public global::Google.Protobuf.TestProtos.ForeignEnum SingleForeignEnum { get { return singleForeignEnum_; } set { @@ -531,7 +543,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleImportEnumFieldNumber = 23; private global::Google.Protobuf.TestProtos.ImportEnum singleImportEnum_ = global::Google.Protobuf.TestProtos.ImportEnum.IMPORT_ENUM_UNSPECIFIED; - [pbr::ProtobufField(23, "single_import_enum")] public global::Google.Protobuf.TestProtos.ImportEnum SingleImportEnum { get { return singleImportEnum_; } set { @@ -542,7 +553,6 @@ namespace Google.Protobuf.TestProtos { public const int SinglePublicImportMessageFieldNumber = 26; private global::Google.Protobuf.TestProtos.PublicImportMessage singlePublicImportMessage_; - [pbr::ProtobufField(26, "single_public_import_message")] public global::Google.Protobuf.TestProtos.PublicImportMessage SinglePublicImportMessage { get { return singlePublicImportMessage_; } set { @@ -555,7 +565,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(250); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(31, "repeated_int32")] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -564,7 +573,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(258); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(32, "repeated_int64")] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -573,7 +581,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint32_codec = pb::FieldCodec.ForUInt32(266); private readonly pbc::RepeatedField repeatedUint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(33, "repeated_uint32")] public pbc::RepeatedField RepeatedUint32 { get { return repeatedUint32_; } } @@ -582,7 +589,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(274); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(34, "repeated_uint64")] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -591,7 +597,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSint32_codec = pb::FieldCodec.ForSInt32(282); private readonly pbc::RepeatedField repeatedSint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(35, "repeated_sint32")] public pbc::RepeatedField RepeatedSint32 { get { return repeatedSint32_; } } @@ -600,7 +605,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSint64_codec = pb::FieldCodec.ForSInt64(290); private readonly pbc::RepeatedField repeatedSint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(36, "repeated_sint64")] public pbc::RepeatedField RepeatedSint64 { get { return repeatedSint64_; } } @@ -609,7 +613,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(298); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(37, "repeated_fixed32")] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -618,7 +621,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(306); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(38, "repeated_fixed64")] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -627,7 +629,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSfixed32_codec = pb::FieldCodec.ForSFixed32(314); private readonly pbc::RepeatedField repeatedSfixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(39, "repeated_sfixed32")] public pbc::RepeatedField RepeatedSfixed32 { get { return repeatedSfixed32_; } } @@ -636,7 +637,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedSfixed64_codec = pb::FieldCodec.ForSFixed64(322); private readonly pbc::RepeatedField repeatedSfixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(40, "repeated_sfixed64")] public pbc::RepeatedField RepeatedSfixed64 { get { return repeatedSfixed64_; } } @@ -645,7 +645,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(330); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); - [pbr::ProtobufField(41, "repeated_float")] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -654,7 +653,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedDouble_codec = pb::FieldCodec.ForDouble(338); private readonly pbc::RepeatedField repeatedDouble_ = new pbc::RepeatedField(); - [pbr::ProtobufField(42, "repeated_double")] public pbc::RepeatedField RepeatedDouble { get { return repeatedDouble_; } } @@ -663,7 +661,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedBool_codec = pb::FieldCodec.ForBool(346); private readonly pbc::RepeatedField repeatedBool_ = new pbc::RepeatedField(); - [pbr::ProtobufField(43, "repeated_bool")] public pbc::RepeatedField RepeatedBool { get { return repeatedBool_; } } @@ -672,7 +669,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedString_codec = pb::FieldCodec.ForString(354); private readonly pbc::RepeatedField repeatedString_ = new pbc::RepeatedField(); - [pbr::ProtobufField(44, "repeated_string")] public pbc::RepeatedField RepeatedString { get { return repeatedString_; } } @@ -681,7 +677,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedBytes_codec = pb::FieldCodec.ForBytes(362); private readonly pbc::RepeatedField repeatedBytes_ = new pbc::RepeatedField(); - [pbr::ProtobufField(45, "repeated_bytes")] public pbc::RepeatedField RepeatedBytes { get { return repeatedBytes_; } } @@ -690,7 +685,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedNestedMessage_codec = pb::FieldCodec.ForMessage(386, global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage.Parser); private readonly pbc::RepeatedField repeatedNestedMessage_ = new pbc::RepeatedField(); - [pbr::ProtobufField(48, "repeated_nested_message")] public pbc::RepeatedField RepeatedNestedMessage { get { return repeatedNestedMessage_; } } @@ -699,7 +693,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedForeignMessage_codec = pb::FieldCodec.ForMessage(394, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedForeignMessage_ = new pbc::RepeatedField(); - [pbr::ProtobufField(49, "repeated_foreign_message")] public pbc::RepeatedField RepeatedForeignMessage { get { return repeatedForeignMessage_; } } @@ -708,7 +701,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedImportMessage_codec = pb::FieldCodec.ForMessage(402, global::Google.Protobuf.TestProtos.ImportMessage.Parser); private readonly pbc::RepeatedField repeatedImportMessage_ = new pbc::RepeatedField(); - [pbr::ProtobufField(50, "repeated_import_message")] public pbc::RepeatedField RepeatedImportMessage { get { return repeatedImportMessage_; } } @@ -717,7 +709,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedNestedEnum_codec = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); private readonly pbc::RepeatedField repeatedNestedEnum_ = new pbc::RepeatedField(); - [pbr::ProtobufField(51, "repeated_nested_enum")] public pbc::RepeatedField RepeatedNestedEnum { get { return repeatedNestedEnum_; } } @@ -726,7 +717,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedForeignEnum_codec = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedForeignEnum_ = new pbc::RepeatedField(); - [pbr::ProtobufField(52, "repeated_foreign_enum")] public pbc::RepeatedField RepeatedForeignEnum { get { return repeatedForeignEnum_; } } @@ -735,7 +725,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedImportEnum_codec = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); private readonly pbc::RepeatedField repeatedImportEnum_ = new pbc::RepeatedField(); - [pbr::ProtobufField(53, "repeated_import_enum")] public pbc::RepeatedField RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -744,13 +733,11 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedPublicImportMessage_codec = pb::FieldCodec.ForMessage(434, global::Google.Protobuf.TestProtos.PublicImportMessage.Parser); private readonly pbc::RepeatedField repeatedPublicImportMessage_ = new pbc::RepeatedField(); - [pbr::ProtobufField(54, "repeated_public_import_message")] public pbc::RepeatedField RepeatedPublicImportMessage { get { return repeatedPublicImportMessage_; } } public const int OneofUint32FieldNumber = 111; - [pbr::ProtobufField(111, "oneof_uint32")] public uint OneofUint32 { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofUint32 ? (uint) oneofField_ : 0; } set { @@ -761,7 +748,6 @@ namespace Google.Protobuf.TestProtos { } public const int OneofNestedMessageFieldNumber = 112; - [pbr::ProtobufField(112, "oneof_nested_message")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage OneofNestedMessage { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofNestedMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage) oneofField_ : null; } set { @@ -772,7 +758,6 @@ namespace Google.Protobuf.TestProtos { } public const int OneofStringFieldNumber = 113; - [pbr::ProtobufField(113, "oneof_string")] public string OneofString { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofString ? (string) oneofField_ : ""; } set { @@ -783,7 +768,6 @@ namespace Google.Protobuf.TestProtos { } public const int OneofBytesFieldNumber = 114; - [pbr::ProtobufField(114, "oneof_bytes")] public pb::ByteString OneofBytes { get { return oneofFieldCase_ == OneofFieldOneofCase.OneofBytes ? (pb::ByteString) oneofField_ : pb::ByteString.Empty; } set { @@ -1544,8 +1528,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } @@ -1580,7 +1562,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private int bb_; - [pbr::ProtobufField(1, "bb")] public int Bb { get { return bb_; } set { @@ -1669,8 +1650,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedTestAllTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "child", "payload", "repeated_child" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 26 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[1]; } } @@ -1710,7 +1689,6 @@ namespace Google.Protobuf.TestProtos { public const int ChildFieldNumber = 1; private global::Google.Protobuf.TestProtos.NestedTestAllTypes child_; - [pbr::ProtobufField(1, "child")] public global::Google.Protobuf.TestProtos.NestedTestAllTypes Child { get { return child_; } set { @@ -1721,7 +1699,6 @@ namespace Google.Protobuf.TestProtos { public const int PayloadFieldNumber = 2; private global::Google.Protobuf.TestProtos.TestAllTypes payload_; - [pbr::ProtobufField(2, "payload")] public global::Google.Protobuf.TestProtos.TestAllTypes Payload { get { return payload_; } set { @@ -1734,7 +1711,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedChild_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.TestProtos.NestedTestAllTypes.Parser); private readonly pbc::RepeatedField repeatedChild_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "repeated_child")] public pbc::RepeatedField RepeatedChild { get { return repeatedChild_; } } @@ -1851,8 +1827,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestDeprecatedFields()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated_int32" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[2]; } } @@ -1888,7 +1862,6 @@ namespace Google.Protobuf.TestProtos { public const int DeprecatedInt32FieldNumber = 1; private int deprecatedInt32_; [global::System.ObsoleteAttribute()] - [pbr::ProtobufField(1, "deprecated_int32")] public int DeprecatedInt32 { get { return deprecatedInt32_; } set { @@ -1972,8 +1945,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ForeignMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "c" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[3]; } } @@ -2008,7 +1979,6 @@ namespace Google.Protobuf.TestProtos { public const int CFieldNumber = 1; private int c_; - [pbr::ProtobufField(1, "c")] public int C { get { return c_; } set { @@ -2092,8 +2062,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReservedFields()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[4]; } } @@ -2184,8 +2152,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestForeignNested()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "foreign_nested" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[5]; } } @@ -2221,7 +2187,6 @@ namespace Google.Protobuf.TestProtos { public const int ForeignNestedFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage foreignNested_; - [pbr::ProtobufField(1, "foreign_nested")] public global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage ForeignNested { get { return foreignNested_; } set { @@ -2311,8 +2276,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestReallyLargeTagNumber()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 2147483640 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[6]; } } @@ -2348,7 +2311,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private int a_; - [pbr::ProtobufField(1, "a")] public int A { get { return a_; } set { @@ -2359,7 +2321,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 268435455; private int bb_; - [pbr::ProtobufField(268435455, "bb")] public int Bb { get { return bb_; } set { @@ -2459,8 +2420,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRecursiveMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "i" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[7]; } } @@ -2497,7 +2456,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestRecursiveMessage a_; - [pbr::ProtobufField(1, "a")] public global::Google.Protobuf.TestProtos.TestRecursiveMessage A { get { return a_; } set { @@ -2508,7 +2466,6 @@ namespace Google.Protobuf.TestProtos { public const int IFieldNumber = 2; private int i_; - [pbr::ProtobufField(2, "i")] public int I { get { return i_; } set { @@ -2614,8 +2571,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionA()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[8]; } } @@ -2651,7 +2606,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionB bb_; - [pbr::ProtobufField(1, "bb")] public global::Google.Protobuf.TestProtos.TestMutualRecursionB Bb { get { return bb_; } set { @@ -2741,8 +2695,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestMutualRecursionB()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "optional_int32" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[9]; } } @@ -2779,7 +2731,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestMutualRecursionA a_; - [pbr::ProtobufField(1, "a")] public global::Google.Protobuf.TestProtos.TestMutualRecursionA A { get { return a_; } set { @@ -2790,7 +2741,6 @@ namespace Google.Protobuf.TestProtos { public const int OptionalInt32FieldNumber = 2; private int optionalInt32_; - [pbr::ProtobufField(2, "optional_int32")] public int OptionalInt32 { get { return optionalInt32_; } set { @@ -2896,8 +2846,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCamelCaseFieldNames()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "EnumField", "MessageField", "PrimitiveField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedPrimitiveField", "RepeatedStringField", "StringField" }; - private static readonly uint[] _fieldTags = new uint[] { 24, 34, 8, 74, 82, 58, 66, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[10]; } } @@ -2944,7 +2892,6 @@ namespace Google.Protobuf.TestProtos { public const int PrimitiveFieldFieldNumber = 1; private int primitiveField_; - [pbr::ProtobufField(1, "PrimitiveField")] public int PrimitiveField { get { return primitiveField_; } set { @@ -2955,7 +2902,6 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 2; private string stringField_ = ""; - [pbr::ProtobufField(2, "StringField")] public string StringField { get { return stringField_; } set { @@ -2966,7 +2912,6 @@ namespace Google.Protobuf.TestProtos { public const int EnumFieldFieldNumber = 3; private global::Google.Protobuf.TestProtos.ForeignEnum enumField_ = global::Google.Protobuf.TestProtos.ForeignEnum.FOREIGN_UNSPECIFIED; - [pbr::ProtobufField(3, "EnumField")] public global::Google.Protobuf.TestProtos.ForeignEnum EnumField { get { return enumField_; } set { @@ -2977,7 +2922,6 @@ namespace Google.Protobuf.TestProtos { public const int MessageFieldFieldNumber = 4; private global::Google.Protobuf.TestProtos.ForeignMessage messageField_; - [pbr::ProtobufField(4, "MessageField")] public global::Google.Protobuf.TestProtos.ForeignMessage MessageField { get { return messageField_; } set { @@ -2990,7 +2934,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedPrimitiveField_codec = pb::FieldCodec.ForInt32(58); private readonly pbc::RepeatedField repeatedPrimitiveField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(7, "RepeatedPrimitiveField")] public pbc::RepeatedField RepeatedPrimitiveField { get { return repeatedPrimitiveField_; } } @@ -2999,7 +2942,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedStringField_codec = pb::FieldCodec.ForString(66); private readonly pbc::RepeatedField repeatedStringField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(8, "RepeatedStringField")] public pbc::RepeatedField RepeatedStringField { get { return repeatedStringField_; } } @@ -3008,7 +2950,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedEnumField_codec = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField repeatedEnumField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(9, "RepeatedEnumField")] public pbc::RepeatedField RepeatedEnumField { get { return repeatedEnumField_; } } @@ -3017,7 +2958,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedMessageField_codec = pb::FieldCodec.ForMessage(82, global::Google.Protobuf.TestProtos.ForeignMessage.Parser); private readonly pbc::RepeatedField repeatedMessageField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(10, "RepeatedMessageField")] public pbc::RepeatedField RepeatedMessageField { get { return repeatedMessageField_; } } @@ -3189,8 +3129,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestFieldOrderings()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "my_float", "my_int", "my_string", "single_nested_message" }; - private static readonly uint[] _fieldTags = new uint[] { 813, 8, 90, 1602 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[11]; } } @@ -3229,7 +3167,6 @@ namespace Google.Protobuf.TestProtos { public const int MyStringFieldNumber = 11; private string myString_ = ""; - [pbr::ProtobufField(11, "my_string")] public string MyString { get { return myString_; } set { @@ -3240,7 +3177,6 @@ namespace Google.Protobuf.TestProtos { public const int MyIntFieldNumber = 1; private long myInt_; - [pbr::ProtobufField(1, "my_int")] public long MyInt { get { return myInt_; } set { @@ -3251,7 +3187,6 @@ namespace Google.Protobuf.TestProtos { public const int MyFloatFieldNumber = 101; private float myFloat_; - [pbr::ProtobufField(101, "my_float")] public float MyFloat { get { return myFloat_; } set { @@ -3262,7 +3197,6 @@ namespace Google.Protobuf.TestProtos { public const int SingleNestedMessageFieldNumber = 200; private global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage singleNestedMessage_; - [pbr::ProtobufField(200, "single_nested_message")] public global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage SingleNestedMessage { get { return singleNestedMessage_; } set { @@ -3401,8 +3335,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NestedMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb", "oo" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } @@ -3438,7 +3370,6 @@ namespace Google.Protobuf.TestProtos { public const int OoFieldNumber = 2; private long oo_; - [pbr::ProtobufField(2, "oo")] public long Oo { get { return oo_; } set { @@ -3449,7 +3380,6 @@ namespace Google.Protobuf.TestProtos { public const int BbFieldNumber = 1; private int bb_; - [pbr::ProtobufField(1, "bb")] public int Bb { get { return bb_; } set { @@ -3554,8 +3484,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SparseEnumMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "sparse_enum" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[12]; } } @@ -3590,7 +3518,6 @@ namespace Google.Protobuf.TestProtos { public const int SparseEnumFieldNumber = 1; private global::Google.Protobuf.TestProtos.TestSparseEnum sparseEnum_ = global::Google.Protobuf.TestProtos.TestSparseEnum.TEST_SPARSE_ENUM_UNSPECIFIED; - [pbr::ProtobufField(1, "sparse_enum")] public global::Google.Protobuf.TestProtos.TestSparseEnum SparseEnum { get { return sparseEnum_; } set { @@ -3674,8 +3601,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneString()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[13]; } } @@ -3710,7 +3635,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private string data_ = ""; - [pbr::ProtobufField(1, "data")] public string Data { get { return data_; } set { @@ -3794,8 +3718,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreString()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[14]; } } @@ -3833,7 +3755,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_data_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField data_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "data")] public pbc::RepeatedField Data { get { return data_; } } @@ -3906,8 +3827,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneBytes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[15]; } } @@ -3942,7 +3861,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; - [pbr::ProtobufField(1, "data")] public pb::ByteString Data { get { return data_; } set { @@ -4026,8 +3944,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MoreBytes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[16]; } } @@ -4062,7 +3978,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private pb::ByteString data_ = pb::ByteString.Empty; - [pbr::ProtobufField(1, "data")] public pb::ByteString Data { get { return data_; } set { @@ -4146,8 +4061,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int32Message()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[17]; } } @@ -4182,7 +4095,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private int data_; - [pbr::ProtobufField(1, "data")] public int Data { get { return data_; } set { @@ -4266,8 +4178,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint32Message()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[18]; } } @@ -4302,7 +4212,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private uint data_; - [pbr::ProtobufField(1, "data")] public uint Data { get { return data_; } set { @@ -4386,8 +4295,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Int64Message()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[19]; } } @@ -4422,7 +4329,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private long data_; - [pbr::ProtobufField(1, "data")] public long Data { get { return data_; } set { @@ -4506,8 +4412,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Uint64Message()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[20]; } } @@ -4542,7 +4446,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private ulong data_; - [pbr::ProtobufField(1, "data")] public ulong Data { get { return data_; } set { @@ -4626,8 +4529,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[21]; } } @@ -4662,7 +4563,6 @@ namespace Google.Protobuf.TestProtos { public const int DataFieldNumber = 1; private bool data_; - [pbr::ProtobufField(1, "data")] public bool Data { get { return data_; } set { @@ -4746,8 +4646,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestOneof()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "foo_int", "foo_message", "foo_string" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 26, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[22]; } } @@ -4793,7 +4691,6 @@ namespace Google.Protobuf.TestProtos { } public const int FooIntFieldNumber = 1; - [pbr::ProtobufField(1, "foo_int")] public int FooInt { get { return fooCase_ == FooOneofCase.FooInt ? (int) foo_ : 0; } set { @@ -4804,7 +4701,6 @@ namespace Google.Protobuf.TestProtos { } public const int FooStringFieldNumber = 2; - [pbr::ProtobufField(2, "foo_string")] public string FooString { get { return fooCase_ == FooOneofCase.FooString ? (string) foo_ : ""; } set { @@ -4815,7 +4711,6 @@ namespace Google.Protobuf.TestProtos { } public const int FooMessageFieldNumber = 3; - [pbr::ProtobufField(3, "foo_message")] public global::Google.Protobuf.TestProtos.TestAllTypes FooMessage { get { return fooCase_ == FooOneofCase.FooMessage ? (global::Google.Protobuf.TestProtos.TestAllTypes) foo_ : null; } set { @@ -4960,8 +4855,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestPackedTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[23]; } } @@ -5025,7 +4918,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedInt32_codec = pb::FieldCodec.ForInt32(722); private readonly pbc::RepeatedField packedInt32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(90, "packed_int32")] public pbc::RepeatedField PackedInt32 { get { return packedInt32_; } } @@ -5034,7 +4926,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedInt64_codec = pb::FieldCodec.ForInt64(730); private readonly pbc::RepeatedField packedInt64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(91, "packed_int64")] public pbc::RepeatedField PackedInt64 { get { return packedInt64_; } } @@ -5043,7 +4934,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedUint32_codec = pb::FieldCodec.ForUInt32(738); private readonly pbc::RepeatedField packedUint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(92, "packed_uint32")] public pbc::RepeatedField PackedUint32 { get { return packedUint32_; } } @@ -5052,7 +4942,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedUint64_codec = pb::FieldCodec.ForUInt64(746); private readonly pbc::RepeatedField packedUint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(93, "packed_uint64")] public pbc::RepeatedField PackedUint64 { get { return packedUint64_; } } @@ -5061,7 +4950,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSint32_codec = pb::FieldCodec.ForSInt32(754); private readonly pbc::RepeatedField packedSint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(94, "packed_sint32")] public pbc::RepeatedField PackedSint32 { get { return packedSint32_; } } @@ -5070,7 +4958,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSint64_codec = pb::FieldCodec.ForSInt64(762); private readonly pbc::RepeatedField packedSint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(95, "packed_sint64")] public pbc::RepeatedField PackedSint64 { get { return packedSint64_; } } @@ -5079,7 +4966,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFixed32_codec = pb::FieldCodec.ForFixed32(770); private readonly pbc::RepeatedField packedFixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(96, "packed_fixed32")] public pbc::RepeatedField PackedFixed32 { get { return packedFixed32_; } } @@ -5088,7 +4974,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFixed64_codec = pb::FieldCodec.ForFixed64(778); private readonly pbc::RepeatedField packedFixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(97, "packed_fixed64")] public pbc::RepeatedField PackedFixed64 { get { return packedFixed64_; } } @@ -5097,7 +4982,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSfixed32_codec = pb::FieldCodec.ForSFixed32(786); private readonly pbc::RepeatedField packedSfixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(98, "packed_sfixed32")] public pbc::RepeatedField PackedSfixed32 { get { return packedSfixed32_; } } @@ -5106,7 +4990,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedSfixed64_codec = pb::FieldCodec.ForSFixed64(794); private readonly pbc::RepeatedField packedSfixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(99, "packed_sfixed64")] public pbc::RepeatedField PackedSfixed64 { get { return packedSfixed64_; } } @@ -5115,7 +4998,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedFloat_codec = pb::FieldCodec.ForFloat(802); private readonly pbc::RepeatedField packedFloat_ = new pbc::RepeatedField(); - [pbr::ProtobufField(100, "packed_float")] public pbc::RepeatedField PackedFloat { get { return packedFloat_; } } @@ -5124,7 +5006,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedDouble_codec = pb::FieldCodec.ForDouble(810); private readonly pbc::RepeatedField packedDouble_ = new pbc::RepeatedField(); - [pbr::ProtobufField(101, "packed_double")] public pbc::RepeatedField PackedDouble { get { return packedDouble_; } } @@ -5133,7 +5014,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedBool_codec = pb::FieldCodec.ForBool(818); private readonly pbc::RepeatedField packedBool_ = new pbc::RepeatedField(); - [pbr::ProtobufField(102, "packed_bool")] public pbc::RepeatedField PackedBool { get { return packedBool_; } } @@ -5142,7 +5022,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_packedEnum_codec = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField packedEnum_ = new pbc::RepeatedField(); - [pbr::ProtobufField(103, "packed_enum")] public pbc::RepeatedField PackedEnum { get { return packedEnum_; } } @@ -5346,8 +5225,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestUnpackedTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[24]; } } @@ -5411,7 +5288,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedInt32_codec = pb::FieldCodec.ForInt32(720); private readonly pbc::RepeatedField unpackedInt32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(90, "unpacked_int32")] public pbc::RepeatedField UnpackedInt32 { get { return unpackedInt32_; } } @@ -5420,7 +5296,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedInt64_codec = pb::FieldCodec.ForInt64(728); private readonly pbc::RepeatedField unpackedInt64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(91, "unpacked_int64")] public pbc::RepeatedField UnpackedInt64 { get { return unpackedInt64_; } } @@ -5429,7 +5304,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedUint32_codec = pb::FieldCodec.ForUInt32(736); private readonly pbc::RepeatedField unpackedUint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(92, "unpacked_uint32")] public pbc::RepeatedField UnpackedUint32 { get { return unpackedUint32_; } } @@ -5438,7 +5312,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedUint64_codec = pb::FieldCodec.ForUInt64(744); private readonly pbc::RepeatedField unpackedUint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(93, "unpacked_uint64")] public pbc::RepeatedField UnpackedUint64 { get { return unpackedUint64_; } } @@ -5447,7 +5320,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSint32_codec = pb::FieldCodec.ForSInt32(752); private readonly pbc::RepeatedField unpackedSint32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(94, "unpacked_sint32")] public pbc::RepeatedField UnpackedSint32 { get { return unpackedSint32_; } } @@ -5456,7 +5328,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSint64_codec = pb::FieldCodec.ForSInt64(760); private readonly pbc::RepeatedField unpackedSint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(95, "unpacked_sint64")] public pbc::RepeatedField UnpackedSint64 { get { return unpackedSint64_; } } @@ -5465,7 +5336,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFixed32_codec = pb::FieldCodec.ForFixed32(773); private readonly pbc::RepeatedField unpackedFixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(96, "unpacked_fixed32")] public pbc::RepeatedField UnpackedFixed32 { get { return unpackedFixed32_; } } @@ -5474,7 +5344,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFixed64_codec = pb::FieldCodec.ForFixed64(777); private readonly pbc::RepeatedField unpackedFixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(97, "unpacked_fixed64")] public pbc::RepeatedField UnpackedFixed64 { get { return unpackedFixed64_; } } @@ -5483,7 +5352,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSfixed32_codec = pb::FieldCodec.ForSFixed32(789); private readonly pbc::RepeatedField unpackedSfixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(98, "unpacked_sfixed32")] public pbc::RepeatedField UnpackedSfixed32 { get { return unpackedSfixed32_; } } @@ -5492,7 +5360,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedSfixed64_codec = pb::FieldCodec.ForSFixed64(793); private readonly pbc::RepeatedField unpackedSfixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(99, "unpacked_sfixed64")] public pbc::RepeatedField UnpackedSfixed64 { get { return unpackedSfixed64_; } } @@ -5501,7 +5368,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedFloat_codec = pb::FieldCodec.ForFloat(805); private readonly pbc::RepeatedField unpackedFloat_ = new pbc::RepeatedField(); - [pbr::ProtobufField(100, "unpacked_float")] public pbc::RepeatedField UnpackedFloat { get { return unpackedFloat_; } } @@ -5510,7 +5376,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedDouble_codec = pb::FieldCodec.ForDouble(809); private readonly pbc::RepeatedField unpackedDouble_ = new pbc::RepeatedField(); - [pbr::ProtobufField(101, "unpacked_double")] public pbc::RepeatedField UnpackedDouble { get { return unpackedDouble_; } } @@ -5519,7 +5384,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedBool_codec = pb::FieldCodec.ForBool(816); private readonly pbc::RepeatedField unpackedBool_ = new pbc::RepeatedField(); - [pbr::ProtobufField(102, "unpacked_bool")] public pbc::RepeatedField UnpackedBool { get { return unpackedBool_; } } @@ -5528,7 +5392,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_unpackedEnum_codec = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); private readonly pbc::RepeatedField unpackedEnum_ = new pbc::RepeatedField(); - [pbr::ProtobufField(103, "unpacked_enum")] public pbc::RepeatedField UnpackedEnum { get { return unpackedEnum_; } } @@ -5732,8 +5595,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestRepeatedScalarDifferentTagSizes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_int32", "repeated_int64", "repeated_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 98, 16370, 2097138, 106, 16378, 2097146 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[25]; } } @@ -5781,7 +5642,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed32_codec = pb::FieldCodec.ForFixed32(98); private readonly pbc::RepeatedField repeatedFixed32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(12, "repeated_fixed32")] public pbc::RepeatedField RepeatedFixed32 { get { return repeatedFixed32_; } } @@ -5790,7 +5650,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt32_codec = pb::FieldCodec.ForInt32(106); private readonly pbc::RepeatedField repeatedInt32_ = new pbc::RepeatedField(); - [pbr::ProtobufField(13, "repeated_int32")] public pbc::RepeatedField RepeatedInt32 { get { return repeatedInt32_; } } @@ -5799,7 +5658,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFixed64_codec = pb::FieldCodec.ForFixed64(16370); private readonly pbc::RepeatedField repeatedFixed64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2046, "repeated_fixed64")] public pbc::RepeatedField RepeatedFixed64 { get { return repeatedFixed64_; } } @@ -5808,7 +5666,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedInt64_codec = pb::FieldCodec.ForInt64(16378); private readonly pbc::RepeatedField repeatedInt64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2047, "repeated_int64")] public pbc::RepeatedField RepeatedInt64 { get { return repeatedInt64_; } } @@ -5817,7 +5674,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedFloat_codec = pb::FieldCodec.ForFloat(2097138); private readonly pbc::RepeatedField repeatedFloat_ = new pbc::RepeatedField(); - [pbr::ProtobufField(262142, "repeated_float")] public pbc::RepeatedField RepeatedFloat { get { return repeatedFloat_; } } @@ -5826,7 +5682,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_repeatedUint64_codec = pb::FieldCodec.ForUInt64(2097146); private readonly pbc::RepeatedField repeatedUint64_ = new pbc::RepeatedField(); - [pbr::ProtobufField(262143, "repeated_uint64")] public pbc::RepeatedField RepeatedUint64 { get { return repeatedUint64_; } } @@ -5950,8 +5805,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestCommentInjectionMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[26]; } } @@ -5986,7 +5839,6 @@ namespace Google.Protobuf.TestProtos { public const int AFieldNumber = 1; private string a_ = ""; - [pbr::ProtobufField(1, "a")] public string A { get { return a_; } set { @@ -6070,8 +5922,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooRequest()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[27]; } } @@ -6162,8 +6012,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooResponse()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[28]; } } @@ -6254,8 +6102,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooClientMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[29]; } } @@ -6346,8 +6192,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FooServerMessage()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[30]; } } @@ -6438,8 +6282,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarRequest()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[31]; } } @@ -6530,8 +6372,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BarResponse()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[32]; } } diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index cbfa2d5e..3de1cbb7 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -156,10 +156,15 @@ namespace Google.Protobuf.TestProtos { "AjgBGk4KD0J5dGVzRmllbGRFbnRyeRILCgNrZXkYASABKAUSKgoFdmFsdWUY", "AiABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZToCOAFCOQoYY29t", "Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz", - "dFByb3Rvc2IGcHJvdG8z")); + "dFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, new[]{ "OneofField" }, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }) + })); } #endregion @@ -170,8 +175,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TestWellKnownTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[0]; } } @@ -232,7 +235,6 @@ namespace Google.Protobuf.TestProtos { public const int AnyFieldFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Any anyField_; - [pbr::ProtobufField(1, "any_field")] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return anyField_; } set { @@ -243,7 +245,6 @@ namespace Google.Protobuf.TestProtos { public const int ApiFieldFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Api apiField_; - [pbr::ProtobufField(2, "api_field")] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return apiField_; } set { @@ -254,7 +255,6 @@ namespace Google.Protobuf.TestProtos { public const int DurationFieldFieldNumber = 3; private global::Google.Protobuf.WellKnownTypes.Duration durationField_; - [pbr::ProtobufField(3, "duration_field")] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return durationField_; } set { @@ -265,7 +265,6 @@ namespace Google.Protobuf.TestProtos { public const int EmptyFieldFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.Empty emptyField_; - [pbr::ProtobufField(4, "empty_field")] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return emptyField_; } set { @@ -276,7 +275,6 @@ namespace Google.Protobuf.TestProtos { public const int FieldMaskFieldFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.FieldMask fieldMaskField_; - [pbr::ProtobufField(5, "field_mask_field")] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return fieldMaskField_; } set { @@ -287,7 +285,6 @@ namespace Google.Protobuf.TestProtos { public const int SourceContextFieldFieldNumber = 6; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContextField_; - [pbr::ProtobufField(6, "source_context_field")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return sourceContextField_; } set { @@ -298,7 +295,6 @@ namespace Google.Protobuf.TestProtos { public const int StructFieldFieldNumber = 7; private global::Google.Protobuf.WellKnownTypes.Struct structField_; - [pbr::ProtobufField(7, "struct_field")] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return structField_; } set { @@ -309,7 +305,6 @@ namespace Google.Protobuf.TestProtos { public const int TimestampFieldFieldNumber = 8; private global::Google.Protobuf.WellKnownTypes.Timestamp timestampField_; - [pbr::ProtobufField(8, "timestamp_field")] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return timestampField_; } set { @@ -320,7 +315,6 @@ namespace Google.Protobuf.TestProtos { public const int TypeFieldFieldNumber = 9; private global::Google.Protobuf.WellKnownTypes.Type typeField_; - [pbr::ProtobufField(9, "type_field")] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return typeField_; } set { @@ -332,7 +326,6 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _single_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private double? doubleField_; - [pbr::ProtobufField(10, "double_field")] public double? DoubleField { get { return doubleField_; } set { @@ -344,7 +337,6 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _single_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private float? floatField_; - [pbr::ProtobufField(11, "float_field")] public float? FloatField { get { return floatField_; } set { @@ -356,7 +348,6 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _single_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private long? int64Field_; - [pbr::ProtobufField(12, "int64_field")] public long? Int64Field { get { return int64Field_; } set { @@ -368,7 +359,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _single_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private ulong? uint64Field_; - [pbr::ProtobufField(13, "uint64_field")] public ulong? Uint64Field { get { return uint64Field_; } set { @@ -380,7 +370,6 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _single_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private int? int32Field_; - [pbr::ProtobufField(14, "int32_field")] public int? Int32Field { get { return int32Field_; } set { @@ -392,7 +381,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _single_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private uint? uint32Field_; - [pbr::ProtobufField(15, "uint32_field")] public uint? Uint32Field { get { return uint32Field_; } set { @@ -404,7 +392,6 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _single_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private bool? boolField_; - [pbr::ProtobufField(16, "bool_field")] public bool? BoolField { get { return boolField_; } set { @@ -416,7 +403,6 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _single_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private string stringField_; - [pbr::ProtobufField(17, "string_field")] public string StringField { get { return stringField_; } set { @@ -428,7 +414,6 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _single_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private pb::ByteString bytesField_; - [pbr::ProtobufField(18, "bytes_field")] public pb::ByteString BytesField { get { return bytesField_; } set { @@ -874,8 +859,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RepeatedWellKnownTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[1]; } } @@ -947,7 +930,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_anyField_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Any.Parser); private readonly pbc::RepeatedField anyField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "any_field")] public pbc::RepeatedField AnyField { get { return anyField_; } } @@ -956,7 +938,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_apiField_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser); private readonly pbc::RepeatedField apiField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "api_field")] public pbc::RepeatedField ApiField { get { return apiField_; } } @@ -965,7 +946,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_durationField_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Duration.Parser); private readonly pbc::RepeatedField durationField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "duration_field")] public pbc::RepeatedField DurationField { get { return durationField_; } } @@ -974,7 +954,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_emptyField_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Empty.Parser); private readonly pbc::RepeatedField emptyField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(4, "empty_field")] public pbc::RepeatedField EmptyField { get { return emptyField_; } } @@ -983,7 +962,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_fieldMaskField_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser); private readonly pbc::RepeatedField fieldMaskField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(5, "field_mask_field")] public pbc::RepeatedField FieldMaskField { get { return fieldMaskField_; } } @@ -992,7 +970,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_sourceContextField_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser); private readonly pbc::RepeatedField sourceContextField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(6, "source_context_field")] public pbc::RepeatedField SourceContextField { get { return sourceContextField_; } } @@ -1001,7 +978,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_structField_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.WellKnownTypes.Struct.Parser); private readonly pbc::RepeatedField structField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(7, "struct_field")] public pbc::RepeatedField StructField { get { return structField_; } } @@ -1010,7 +986,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_timestampField_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser); private readonly pbc::RepeatedField timestampField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(8, "timestamp_field")] public pbc::RepeatedField TimestampField { get { return timestampField_; } } @@ -1019,7 +994,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_typeField_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Type.Parser); private readonly pbc::RepeatedField typeField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(9, "type_field")] public pbc::RepeatedField TypeField { get { return typeField_; } } @@ -1028,7 +1002,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); private readonly pbc::RepeatedField doubleField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(10, "double_field")] public pbc::RepeatedField DoubleField { get { return doubleField_; } } @@ -1037,7 +1010,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_floatField_codec = pb::FieldCodec.ForStructWrapper(90); private readonly pbc::RepeatedField floatField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(11, "float_field")] public pbc::RepeatedField FloatField { get { return floatField_; } } @@ -1046,7 +1018,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); private readonly pbc::RepeatedField int64Field_ = new pbc::RepeatedField(); - [pbr::ProtobufField(12, "int64_field")] public pbc::RepeatedField Int64Field { get { return int64Field_; } } @@ -1055,7 +1026,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); private readonly pbc::RepeatedField uint64Field_ = new pbc::RepeatedField(); - [pbr::ProtobufField(13, "uint64_field")] public pbc::RepeatedField Uint64Field { get { return uint64Field_; } } @@ -1064,7 +1034,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); private readonly pbc::RepeatedField int32Field_ = new pbc::RepeatedField(); - [pbr::ProtobufField(14, "int32_field")] public pbc::RepeatedField Int32Field { get { return int32Field_; } } @@ -1073,7 +1042,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); private readonly pbc::RepeatedField uint32Field_ = new pbc::RepeatedField(); - [pbr::ProtobufField(15, "uint32_field")] public pbc::RepeatedField Uint32Field { get { return uint32Field_; } } @@ -1082,7 +1050,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_boolField_codec = pb::FieldCodec.ForStructWrapper(130); private readonly pbc::RepeatedField boolField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(16, "bool_field")] public pbc::RepeatedField BoolField { get { return boolField_; } } @@ -1091,7 +1058,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_stringField_codec = pb::FieldCodec.ForClassWrapper(138); private readonly pbc::RepeatedField stringField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(17, "string_field")] public pbc::RepeatedField StringField { get { return stringField_; } } @@ -1100,7 +1066,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::FieldCodec _repeated_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); private readonly pbc::RepeatedField bytesField_ = new pbc::RepeatedField(); - [pbr::ProtobufField(18, "bytes_field")] public pbc::RepeatedField BytesField { get { return bytesField_; } } @@ -1326,8 +1291,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofWellKnownTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[2]; } } @@ -1418,7 +1381,6 @@ namespace Google.Protobuf.TestProtos { } public const int AnyFieldFieldNumber = 1; - [pbr::ProtobufField(1, "any_field")] public global::Google.Protobuf.WellKnownTypes.Any AnyField { get { return oneofFieldCase_ == OneofFieldOneofCase.AnyField ? (global::Google.Protobuf.WellKnownTypes.Any) oneofField_ : null; } set { @@ -1429,7 +1391,6 @@ namespace Google.Protobuf.TestProtos { } public const int ApiFieldFieldNumber = 2; - [pbr::ProtobufField(2, "api_field")] public global::Google.Protobuf.WellKnownTypes.Api ApiField { get { return oneofFieldCase_ == OneofFieldOneofCase.ApiField ? (global::Google.Protobuf.WellKnownTypes.Api) oneofField_ : null; } set { @@ -1440,7 +1401,6 @@ namespace Google.Protobuf.TestProtos { } public const int DurationFieldFieldNumber = 3; - [pbr::ProtobufField(3, "duration_field")] public global::Google.Protobuf.WellKnownTypes.Duration DurationField { get { return oneofFieldCase_ == OneofFieldOneofCase.DurationField ? (global::Google.Protobuf.WellKnownTypes.Duration) oneofField_ : null; } set { @@ -1451,7 +1411,6 @@ namespace Google.Protobuf.TestProtos { } public const int EmptyFieldFieldNumber = 4; - [pbr::ProtobufField(4, "empty_field")] public global::Google.Protobuf.WellKnownTypes.Empty EmptyField { get { return oneofFieldCase_ == OneofFieldOneofCase.EmptyField ? (global::Google.Protobuf.WellKnownTypes.Empty) oneofField_ : null; } set { @@ -1462,7 +1421,6 @@ namespace Google.Protobuf.TestProtos { } public const int FieldMaskFieldFieldNumber = 5; - [pbr::ProtobufField(5, "field_mask_field")] public global::Google.Protobuf.WellKnownTypes.FieldMask FieldMaskField { get { return oneofFieldCase_ == OneofFieldOneofCase.FieldMaskField ? (global::Google.Protobuf.WellKnownTypes.FieldMask) oneofField_ : null; } set { @@ -1473,7 +1431,6 @@ namespace Google.Protobuf.TestProtos { } public const int SourceContextFieldFieldNumber = 6; - [pbr::ProtobufField(6, "source_context_field")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContextField { get { return oneofFieldCase_ == OneofFieldOneofCase.SourceContextField ? (global::Google.Protobuf.WellKnownTypes.SourceContext) oneofField_ : null; } set { @@ -1484,7 +1441,6 @@ namespace Google.Protobuf.TestProtos { } public const int StructFieldFieldNumber = 7; - [pbr::ProtobufField(7, "struct_field")] public global::Google.Protobuf.WellKnownTypes.Struct StructField { get { return oneofFieldCase_ == OneofFieldOneofCase.StructField ? (global::Google.Protobuf.WellKnownTypes.Struct) oneofField_ : null; } set { @@ -1495,7 +1451,6 @@ namespace Google.Protobuf.TestProtos { } public const int TimestampFieldFieldNumber = 8; - [pbr::ProtobufField(8, "timestamp_field")] public global::Google.Protobuf.WellKnownTypes.Timestamp TimestampField { get { return oneofFieldCase_ == OneofFieldOneofCase.TimestampField ? (global::Google.Protobuf.WellKnownTypes.Timestamp) oneofField_ : null; } set { @@ -1506,7 +1461,6 @@ namespace Google.Protobuf.TestProtos { } public const int TypeFieldFieldNumber = 9; - [pbr::ProtobufField(9, "type_field")] public global::Google.Protobuf.WellKnownTypes.Type TypeField { get { return oneofFieldCase_ == OneofFieldOneofCase.TypeField ? (global::Google.Protobuf.WellKnownTypes.Type) oneofField_ : null; } set { @@ -1518,7 +1472,6 @@ namespace Google.Protobuf.TestProtos { public const int DoubleFieldFieldNumber = 10; private static readonly pb::FieldCodec _oneof_doubleField_codec = pb::FieldCodec.ForStructWrapper(82); - [pbr::ProtobufField(10, "double_field")] public double? DoubleField { get { return oneofFieldCase_ == OneofFieldOneofCase.DoubleField ? (double?) oneofField_ : (double?) null; } set { @@ -1530,7 +1483,6 @@ namespace Google.Protobuf.TestProtos { public const int FloatFieldFieldNumber = 11; private static readonly pb::FieldCodec _oneof_floatField_codec = pb::FieldCodec.ForStructWrapper(90); - [pbr::ProtobufField(11, "float_field")] public float? FloatField { get { return oneofFieldCase_ == OneofFieldOneofCase.FloatField ? (float?) oneofField_ : (float?) null; } set { @@ -1542,7 +1494,6 @@ namespace Google.Protobuf.TestProtos { public const int Int64FieldFieldNumber = 12; private static readonly pb::FieldCodec _oneof_int64Field_codec = pb::FieldCodec.ForStructWrapper(98); - [pbr::ProtobufField(12, "int64_field")] public long? Int64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int64Field ? (long?) oneofField_ : (long?) null; } set { @@ -1554,7 +1505,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint64FieldFieldNumber = 13; private static readonly pb::FieldCodec _oneof_uint64Field_codec = pb::FieldCodec.ForStructWrapper(106); - [pbr::ProtobufField(13, "uint64_field")] public ulong? Uint64Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint64Field ? (ulong?) oneofField_ : (ulong?) null; } set { @@ -1566,7 +1516,6 @@ namespace Google.Protobuf.TestProtos { public const int Int32FieldFieldNumber = 14; private static readonly pb::FieldCodec _oneof_int32Field_codec = pb::FieldCodec.ForStructWrapper(114); - [pbr::ProtobufField(14, "int32_field")] public int? Int32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Int32Field ? (int?) oneofField_ : (int?) null; } set { @@ -1578,7 +1527,6 @@ namespace Google.Protobuf.TestProtos { public const int Uint32FieldFieldNumber = 15; private static readonly pb::FieldCodec _oneof_uint32Field_codec = pb::FieldCodec.ForStructWrapper(122); - [pbr::ProtobufField(15, "uint32_field")] public uint? Uint32Field { get { return oneofFieldCase_ == OneofFieldOneofCase.Uint32Field ? (uint?) oneofField_ : (uint?) null; } set { @@ -1590,7 +1538,6 @@ namespace Google.Protobuf.TestProtos { public const int BoolFieldFieldNumber = 16; private static readonly pb::FieldCodec _oneof_boolField_codec = pb::FieldCodec.ForStructWrapper(130); - [pbr::ProtobufField(16, "bool_field")] public bool? BoolField { get { return oneofFieldCase_ == OneofFieldOneofCase.BoolField ? (bool?) oneofField_ : (bool?) null; } set { @@ -1602,7 +1549,6 @@ namespace Google.Protobuf.TestProtos { public const int StringFieldFieldNumber = 17; private static readonly pb::FieldCodec _oneof_stringField_codec = pb::FieldCodec.ForClassWrapper(138); - [pbr::ProtobufField(17, "string_field")] public string StringField { get { return oneofFieldCase_ == OneofFieldOneofCase.StringField ? (string) oneofField_ : (string) null; } set { @@ -1614,7 +1560,6 @@ namespace Google.Protobuf.TestProtos { public const int BytesFieldFieldNumber = 18; private static readonly pb::FieldCodec _oneof_bytesField_codec = pb::FieldCodec.ForClassWrapper(146); - [pbr::ProtobufField(18, "bytes_field")] public pb::ByteString BytesField { get { return oneofFieldCase_ == OneofFieldOneofCase.BytesField ? (pb::ByteString) oneofField_ : (pb::ByteString) null; } set { @@ -2045,8 +1990,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapWellKnownTypes()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[3]; } } @@ -2118,7 +2061,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_anyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Any.Parser), 10); private readonly pbc::MapField anyField_ = new pbc::MapField(); - [pbr::ProtobufField(1, "any_field")] public pbc::MapField AnyField { get { return anyField_; } } @@ -2127,7 +2069,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_apiField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Api.Parser), 18); private readonly pbc::MapField apiField_ = new pbc::MapField(); - [pbr::ProtobufField(2, "api_field")] public pbc::MapField ApiField { get { return apiField_; } } @@ -2136,7 +2077,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_durationField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Duration.Parser), 26); private readonly pbc::MapField durationField_ = new pbc::MapField(); - [pbr::ProtobufField(3, "duration_field")] public pbc::MapField DurationField { get { return durationField_; } } @@ -2145,7 +2085,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_emptyField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Empty.Parser), 34); private readonly pbc::MapField emptyField_ = new pbc::MapField(); - [pbr::ProtobufField(4, "empty_field")] public pbc::MapField EmptyField { get { return emptyField_; } } @@ -2154,7 +2093,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_fieldMaskField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.FieldMask.Parser), 42); private readonly pbc::MapField fieldMaskField_ = new pbc::MapField(); - [pbr::ProtobufField(5, "field_mask_field")] public pbc::MapField FieldMaskField { get { return fieldMaskField_; } } @@ -2163,7 +2101,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_sourceContextField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.SourceContext.Parser), 50); private readonly pbc::MapField sourceContextField_ = new pbc::MapField(); - [pbr::ProtobufField(6, "source_context_field")] public pbc::MapField SourceContextField { get { return sourceContextField_; } } @@ -2172,7 +2109,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_structField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Struct.Parser), 58); private readonly pbc::MapField structField_ = new pbc::MapField(); - [pbr::ProtobufField(7, "struct_field")] public pbc::MapField StructField { get { return structField_; } } @@ -2181,7 +2117,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_timestampField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Timestamp.Parser), 66); private readonly pbc::MapField timestampField_ = new pbc::MapField(); - [pbr::ProtobufField(8, "timestamp_field")] public pbc::MapField TimestampField { get { return timestampField_; } } @@ -2190,7 +2125,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_typeField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Type.Parser), 74); private readonly pbc::MapField typeField_ = new pbc::MapField(); - [pbr::ProtobufField(9, "type_field")] public pbc::MapField TypeField { get { return typeField_; } } @@ -2199,7 +2133,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_doubleField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 82); private readonly pbc::MapField doubleField_ = new pbc::MapField(true); - [pbr::ProtobufField(10, "double_field")] public pbc::MapField DoubleField { get { return doubleField_; } } @@ -2208,7 +2141,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_floatField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 90); private readonly pbc::MapField floatField_ = new pbc::MapField(true); - [pbr::ProtobufField(11, "float_field")] public pbc::MapField FloatField { get { return floatField_; } } @@ -2217,7 +2149,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_int64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 98); private readonly pbc::MapField int64Field_ = new pbc::MapField(true); - [pbr::ProtobufField(12, "int64_field")] public pbc::MapField Int64Field { get { return int64Field_; } } @@ -2226,7 +2157,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_uint64Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 106); private readonly pbc::MapField uint64Field_ = new pbc::MapField(true); - [pbr::ProtobufField(13, "uint64_field")] public pbc::MapField Uint64Field { get { return uint64Field_; } } @@ -2235,7 +2165,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_int32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 114); private readonly pbc::MapField int32Field_ = new pbc::MapField(true); - [pbr::ProtobufField(14, "int32_field")] public pbc::MapField Int32Field { get { return int32Field_; } } @@ -2244,7 +2173,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_uint32Field_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 122); private readonly pbc::MapField uint32Field_ = new pbc::MapField(true); - [pbr::ProtobufField(15, "uint32_field")] public pbc::MapField Uint32Field { get { return uint32Field_; } } @@ -2253,7 +2181,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_boolField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForStructWrapper(18), 130); private readonly pbc::MapField boolField_ = new pbc::MapField(true); - [pbr::ProtobufField(16, "bool_field")] public pbc::MapField BoolField { get { return boolField_; } } @@ -2262,7 +2189,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_stringField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 138); private readonly pbc::MapField stringField_ = new pbc::MapField(true); - [pbr::ProtobufField(17, "string_field")] public pbc::MapField StringField { get { return stringField_; } } @@ -2271,7 +2197,6 @@ namespace Google.Protobuf.TestProtos { private static readonly pbc::MapField.Codec _map_bytesField_codec = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForClassWrapper(18), 146); private readonly pbc::MapField bytesField_ = new pbc::MapField(true); - [pbr::ProtobufField(18, "bytes_field")] public pbc::MapField BytesField { get { return bytesField_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index 41fd892b..d92f148d 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -26,10 +26,12 @@ namespace Google.Protobuf.WellKnownTypes { "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi", "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv", "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n", - "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); + "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Any), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), new[]{ "TypeUrl", "Value" }, null, null, null) + })); } #endregion @@ -41,8 +43,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Any()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "type_url", "value" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor.MessageTypes[0]; } } @@ -78,7 +78,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int TypeUrlFieldNumber = 1; private string typeUrl_ = ""; - [pbr::ProtobufField(1, "type_url")] public string TypeUrl { get { return typeUrl_; } set { @@ -89,7 +88,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int ValueFieldNumber = 2; private pb::ByteString value_ = pb::ByteString.Empty; - [pbr::ProtobufField(2, "value")] public pb::ByteString Value { get { return value_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index 65f6d9b5..e0a9e276 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -35,10 +35,13 @@ namespace Google.Protobuf.WellKnownTypes { "ZV9zdHJlYW1pbmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5w", "cm90b2J1Zi5PcHRpb25CSAoTY29tLmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJv", "dG9QAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", - "cHJvdG8z")); + "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Api), typeof(global::Google.Protobuf.WellKnownTypes.Method), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options" }, null, null, null) + })); } #endregion @@ -50,8 +53,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "methods", "name", "options", "source_context", "version" }; - private static readonly uint[] _fieldTags = new uint[] { 18, 10, 26, 42, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[0]; } } @@ -93,7 +94,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -106,7 +106,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_methods_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "methods")] public pbc::RepeatedField Methods { get { return methods_; } } @@ -115,14 +114,12 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int VersionFieldNumber = 4; private string version_ = ""; - [pbr::ProtobufField(4, "version")] public string Version { get { return version_; } set { @@ -133,7 +130,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - [pbr::ProtobufField(5, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -273,8 +269,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "name", "options", "request_streaming", "request_type_url", "response_streaming", "response_type_url" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 50, 24, 18, 40, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[1]; } } @@ -315,7 +309,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -326,7 +319,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int RequestTypeUrlFieldNumber = 2; private string requestTypeUrl_ = ""; - [pbr::ProtobufField(2, "request_type_url")] public string RequestTypeUrl { get { return requestTypeUrl_; } set { @@ -337,7 +329,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int RequestStreamingFieldNumber = 3; private bool requestStreaming_; - [pbr::ProtobufField(3, "request_streaming")] public bool RequestStreaming { get { return requestStreaming_; } set { @@ -348,7 +339,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int ResponseTypeUrlFieldNumber = 4; private string responseTypeUrl_ = ""; - [pbr::ProtobufField(4, "response_type_url")] public string ResponseTypeUrl { get { return responseTypeUrl_; } set { @@ -359,7 +349,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int ResponseStreamingFieldNumber = 5; private bool responseStreaming_; - [pbr::ProtobufField(5, "response_streaming")] public bool ResponseStreaming { get { return responseStreaming_; } set { @@ -372,7 +361,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(6, "options")] public pbc::RepeatedField Options { get { return options_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs index d00e8b74..487911a7 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs @@ -27,10 +27,12 @@ namespace Google.Protobuf.WellKnownTypes { "b2J1ZiIqCghEdXJhdGlvbhIPCgdzZWNvbmRzGAEgASgDEg0KBW5hbm9zGAIg", "ASgFQlAKE2NvbS5nb29nbGUucHJvdG9idWZCDUR1cmF0aW9uUHJvdG9QAaAB", "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", - "dG8z")); + "dG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Duration), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Duration), new[]{ "Seconds", "Nanos" }, null, null, null) + })); } #endregion @@ -42,8 +44,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Duration()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "nanos", "seconds" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor.MessageTypes[0]; } } @@ -79,7 +79,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int SecondsFieldNumber = 1; private long seconds_; - [pbr::ProtobufField(1, "seconds")] public long Seconds { get { return seconds_; } set { @@ -90,7 +89,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NanosFieldNumber = 2; private int nanos_; - [pbr::ProtobufField(2, "nanos")] public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs index eb7dd937..c9048b58 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs @@ -26,10 +26,12 @@ namespace Google.Protobuf.WellKnownTypes { "Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1", "ZiIHCgVFbXB0eUJKChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3Rv", "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Empty), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Empty), null, null, null, null) + })); } #endregion @@ -41,8 +43,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor.MessageTypes[0]; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs index 16c961ed..39d1c1f5 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs @@ -26,10 +26,12 @@ namespace Google.Protobuf.WellKnownTypes { "CiBnb29nbGUvcHJvdG9idWYvZmllbGRfbWFzay5wcm90bxIPZ29vZ2xlLnBy", "b3RvYnVmIhoKCUZpZWxkTWFzaxINCgVwYXRocxgBIAMoCUJOChNjb20uZ29v", "Z2xlLnByb3RvYnVmQg5GaWVsZE1hc2tQcm90b1ABogIDR1BCqgIeR29vZ2xl", - "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); + "LlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.FieldMask), new[]{ "Paths" }, null, null, null) + })); } #endregion @@ -41,8 +43,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldMask()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "paths" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor.MessageTypes[0]; } } @@ -80,7 +80,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_paths_codec = pb::FieldCodec.ForString(10); private readonly pbc::RepeatedField paths_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "paths")] public pbc::RepeatedField Paths { get { return paths_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs index b94fe072..8bce86d4 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs @@ -27,10 +27,12 @@ namespace Google.Protobuf.WellKnownTypes { "ZS5wcm90b2J1ZiIiCg1Tb3VyY2VDb250ZXh0EhEKCWZpbGVfbmFtZRgBIAEo", "CUJSChNjb20uZ29vZ2xlLnByb3RvYnVmQhJTb3VyY2VDb250ZXh0UHJvdG9Q", "AaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJv", - "dG8z")); + "dG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.SourceContext), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.SourceContext), new[]{ "FileName" }, null, null, null) + })); } #endregion @@ -42,8 +44,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceContext()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "file_name" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor.MessageTypes[0]; } } @@ -78,7 +78,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int FileNameFieldNumber = 1; private string fileName_ = ""; - [pbr::ProtobufField(1, "file_name")] public string FileName { get { return fileName_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 860a9925..0ac47b26 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -36,10 +36,14 @@ namespace Google.Protobuf.WellKnownTypes { "Lmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9W", "QUxVRRAAQk4KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAGg", "AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Struct), null, typeof(global::Google.Protobuf.WellKnownTypes.Value), typeof(global::Google.Protobuf.WellKnownTypes.ListValue), typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }); + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.WellKnownTypes.NullValue), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Struct), new[]{ "Fields" }, null, null, new pbr::GeneratedCodeInfo[] { null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Value), new[]{ "NullValue", "NumberValue", "StringValue", "BoolValue", "StructValue", "ListValue" }, new[]{ "Kind" }, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.ListValue), new[]{ "Values" }, null, null, null) + })); } #endregion @@ -58,8 +62,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Struct()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "fields" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[0]; } } @@ -97,7 +99,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pbc::MapField.Codec _map_fields_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Value.Parser), 10); private readonly pbc::MapField fields_ = new pbc::MapField(); - [pbr::ProtobufField(1, "fields")] public pbc::MapField Fields { get { return fields_; } } @@ -170,8 +171,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Value()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bool_value", "list_value", "null_value", "number_value", "string_value", "struct_value" }; - private static readonly uint[] _fieldTags = new uint[] { 32, 50, 8, 17, 26, 42 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[1]; } } @@ -226,7 +225,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int NullValueFieldNumber = 1; - [pbr::ProtobufField(1, "null_value")] public global::Google.Protobuf.WellKnownTypes.NullValue NullValue { get { return kindCase_ == KindOneofCase.NullValue ? (global::Google.Protobuf.WellKnownTypes.NullValue) kind_ : global::Google.Protobuf.WellKnownTypes.NullValue.NULL_VALUE; } set { @@ -237,7 +235,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int NumberValueFieldNumber = 2; - [pbr::ProtobufField(2, "number_value")] public double NumberValue { get { return kindCase_ == KindOneofCase.NumberValue ? (double) kind_ : 0D; } set { @@ -248,7 +245,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int StringValueFieldNumber = 3; - [pbr::ProtobufField(3, "string_value")] public string StringValue { get { return kindCase_ == KindOneofCase.StringValue ? (string) kind_ : ""; } set { @@ -259,7 +255,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int BoolValueFieldNumber = 4; - [pbr::ProtobufField(4, "bool_value")] public bool BoolValue { get { return kindCase_ == KindOneofCase.BoolValue ? (bool) kind_ : false; } set { @@ -270,7 +265,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int StructValueFieldNumber = 5; - [pbr::ProtobufField(5, "struct_value")] public global::Google.Protobuf.WellKnownTypes.Struct StructValue { get { return kindCase_ == KindOneofCase.StructValue ? (global::Google.Protobuf.WellKnownTypes.Struct) kind_ : null; } set { @@ -281,7 +275,6 @@ namespace Google.Protobuf.WellKnownTypes { } public const int ListValueFieldNumber = 6; - [pbr::ProtobufField(6, "list_value")] public global::Google.Protobuf.WellKnownTypes.ListValue ListValue { get { return kindCase_ == KindOneofCase.ListValue ? (global::Google.Protobuf.WellKnownTypes.ListValue) kind_ : null; } set { @@ -483,8 +476,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ListValue()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "values" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor.MessageTypes[2]; } } @@ -522,7 +513,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_values_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.WellKnownTypes.Value.Parser); private readonly pbc::RepeatedField values_ = new pbc::RepeatedField(); - [pbr::ProtobufField(1, "values")] public pbc::RepeatedField Values { get { return values_; } } diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs index bfc2f37a..f874065b 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs @@ -27,10 +27,12 @@ namespace Google.Protobuf.WellKnownTypes { "dG9idWYiKwoJVGltZXN0YW1wEg8KB3NlY29uZHMYASABKAMSDQoFbmFub3MY", "AiABKAVCUQoTY29tLmdvb2dsZS5wcm90b2J1ZkIOVGltZXN0YW1wUHJvdG9Q", "AaABAaICA0dQQqoCHkdvb2dsZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IG", - "cHJvdG8z")); + "cHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Timestamp), new[]{ "Seconds", "Nanos" }, null, null, null) + })); } #endregion @@ -42,8 +44,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Timestamp()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "nanos", "seconds" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor.MessageTypes[0]; } } @@ -79,7 +79,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int SecondsFieldNumber = 1; private long seconds_; - [pbr::ProtobufField(1, "seconds")] public long Seconds { get { return seconds_; } set { @@ -90,7 +89,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NanosFieldNumber = 2; private int nanos_; - [pbr::ProtobufField(2, "nanos")] public int Nanos { get { return nanos_; } set { diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs index 53b8f6be..c6573aa4 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Type.cs @@ -53,10 +53,16 @@ namespace Google.Protobuf.WellKnownTypes { "cHRpb24SDAoEbmFtZRgBIAEoCRIjCgV2YWx1ZRgCIAEoCzIULmdvb2dsZS5w", "cm90b2J1Zi5BbnlCSQoTY29tLmdvb2dsZS5wcm90b2J1ZkIJVHlwZVByb3Rv", "UAGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnBy", - "b3RvMw==")); + "b3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, }, - new global::System.Type[] { typeof(global::Google.Protobuf.WellKnownTypes.Type), typeof(global::Google.Protobuf.WellKnownTypes.Field), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality), typeof(global::Google.Protobuf.WellKnownTypes.Enum), typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), typeof(global::Google.Protobuf.WellKnownTypes.Option), }); + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Type), new[]{ "Name", "Fields", "Oneofs", "Options", "SourceContext" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Field), new[]{ "Kind", "Cardinality", "Number", "Name", "TypeUrl", "OneofIndex", "Packed", "Options" }, null, new[]{ typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Kind), typeof(global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality) }, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Enum), new[]{ "Name", "Enumvalue", "Options", "SourceContext" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.EnumValue), new[]{ "Name", "Number", "Options" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Option), new[]{ "Name", "Value" }, null, null, null) + })); } #endregion @@ -68,8 +74,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Type()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "fields", "name", "oneofs", "options", "source_context" }; - private static readonly uint[] _fieldTags = new uint[] { 18, 10, 26, 34, 42 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[0]; } } @@ -112,7 +116,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -125,7 +128,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_fields_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Field.Parser); private readonly pbc::RepeatedField fields_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "fields")] public pbc::RepeatedField Fields { get { return fields_; } } @@ -134,7 +136,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_oneofs_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField oneofs_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "oneofs")] public pbc::RepeatedField Oneofs { get { return oneofs_; } } @@ -143,14 +144,12 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(4, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int SourceContextFieldNumber = 5; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - [pbr::ProtobufField(5, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -283,8 +282,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Field()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "cardinality", "kind", "name", "number", "oneof_index", "options", "packed", "type_url" }; - private static readonly uint[] _fieldTags = new uint[] { 16, 8, 34, 24, 56, 74, 64, 50 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[1]; } } @@ -327,7 +324,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int KindFieldNumber = 1; private global::Google.Protobuf.WellKnownTypes.Field.Types.Kind kind_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Kind.TYPE_UNKNOWN; - [pbr::ProtobufField(1, "kind")] public global::Google.Protobuf.WellKnownTypes.Field.Types.Kind Kind { get { return kind_; } set { @@ -338,7 +334,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int CardinalityFieldNumber = 2; private global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality cardinality_ = global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality.CARDINALITY_UNKNOWN; - [pbr::ProtobufField(2, "cardinality")] public global::Google.Protobuf.WellKnownTypes.Field.Types.Cardinality Cardinality { get { return cardinality_; } set { @@ -349,7 +344,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NumberFieldNumber = 3; private int number_; - [pbr::ProtobufField(3, "number")] public int Number { get { return number_; } set { @@ -360,7 +354,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 4; private string name_ = ""; - [pbr::ProtobufField(4, "name")] public string Name { get { return name_; } set { @@ -371,7 +364,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int TypeUrlFieldNumber = 6; private string typeUrl_ = ""; - [pbr::ProtobufField(6, "type_url")] public string TypeUrl { get { return typeUrl_; } set { @@ -382,7 +374,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int OneofIndexFieldNumber = 7; private int oneofIndex_; - [pbr::ProtobufField(7, "oneof_index")] public int OneofIndex { get { return oneofIndex_; } set { @@ -393,7 +384,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int PackedFieldNumber = 8; private bool packed_; - [pbr::ProtobufField(8, "packed")] public bool Packed { get { return packed_; } set { @@ -406,7 +396,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(9, "options")] public pbc::RepeatedField Options { get { return options_; } } @@ -625,8 +614,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Enum()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "enumvalue", "name", "options", "source_context" }; - private static readonly uint[] _fieldTags = new uint[] { 18, 10, 26, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[2]; } } @@ -667,7 +654,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -680,7 +666,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_enumvalue_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.EnumValue.Parser); private readonly pbc::RepeatedField enumvalue_ = new pbc::RepeatedField(); - [pbr::ProtobufField(2, "enumvalue")] public pbc::RepeatedField Enumvalue { get { return enumvalue_; } } @@ -689,14 +674,12 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } public const int SourceContextFieldNumber = 4; private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; - [pbr::ProtobufField(4, "source_context")] public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { get { return sourceContext_; } set { @@ -820,8 +803,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValue()); public static pb::MessageParser Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "name", "number", "options" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16, 26 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor.MessageTypes[3]; } } @@ -859,7 +840,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; - [pbr::ProtobufField(1, "name")] public string Name { get { return name_; } set { @@ -870,7 +850,6 @@ namespace Google.Protobuf.WellKnownTypes { public const int NumberFieldNumber = 2; private int number_; - [pbr::ProtobufField(2, "number")] public int Number { get { return number_; } set { @@ -883,7 +862,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::FieldCodec _repeated_options_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); - [pbr::ProtobufField(3, "options")] public pbc::RepeatedField Options { get { return options_; } } @@ -988,8 +966,6 @@ namespace Google.Protobuf.WellKnownTypes { private static readonly pb::MessageParser