From 78ea98f56f7a0a028e378aee6394549707e199bc Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 1 Jul 2015 14:47:03 +0100 Subject: Implement reflection properly for fields. - FieldAccessorTable is now non-generic - We don't have a static field per message type in the umbrella class. (Message descriptors are accessed via the file descriptor.) - Removed the "descriptor assigner" complication from the descriptor fixup; without extensions, we don't need it - MapField implements IDictionary (more tests would be good...) - RepeatedField implements IList (more tests would be good) - Use expression trees to build accessors. (Will need to test this on various platforms... probably need a fallback strategy just using reflection directly.) - Added FieldDescriptor.IsMap - Added tests for reflection with generated messages Changes to generated code coming in next commit. --- csharp/src/ProtocolBuffers/Collections/MapField.cs | 69 ++++++++++++- .../ProtocolBuffers/Collections/RepeatedField.cs | 63 +++++++++++- .../ProtocolBuffers/Descriptors/FieldDescriptor.cs | 5 + .../ProtocolBuffers/Descriptors/FileDescriptor.cs | 33 +------ .../FieldAccess/FieldAccessorBase.cs | 23 +++-- .../FieldAccess/FieldAccessorTable.cs | 32 +++--- .../ProtocolBuffers/FieldAccess/IFieldAccessor.cs | 32 +++--- .../FieldAccess/MapFieldAccessor.cs | 59 +++++++++++ .../ProtocolBuffers/FieldAccess/ReflectionUtil.cs | 110 +++++---------------- .../FieldAccess/RepeatedFieldAccessor.cs | 17 ++-- .../FieldAccess/SingleFieldAccessor.cs | 64 ++++-------- csharp/src/ProtocolBuffers/IMessage.cs | 7 +- csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 1 + 13 files changed, 296 insertions(+), 219 deletions(-) create mode 100644 csharp/src/ProtocolBuffers/FieldAccess/MapFieldAccessor.cs (limited to 'csharp/src/ProtocolBuffers') diff --git a/csharp/src/ProtocolBuffers/Collections/MapField.cs b/csharp/src/ProtocolBuffers/Collections/MapField.cs index 6d1097a6..779ff061 100644 --- a/csharp/src/ProtocolBuffers/Collections/MapField.cs +++ b/csharp/src/ProtocolBuffers/Collections/MapField.cs @@ -48,7 +48,7 @@ namespace Google.Protobuf.Collections /// /// Key type in the map. Must be a type supported by Protocol Buffer map keys. /// Value type in the map. Must be a type supported by Protocol Buffers. - public sealed class MapField : IDeepCloneable>, IFreezable, IDictionary, IEquatable> + public sealed class MapField : IDeepCloneable>, IFreezable, IDictionary, IEquatable>, IDictionary { // TODO: Don't create the map/list until we have an entry. (Assume many maps will be empty.) private bool frozen; @@ -64,7 +64,7 @@ namespace Google.Protobuf.Collections { foreach (var pair in list) { - clone.Add(pair.Key, pair.Value == null ? pair.Value : ((IDeepCloneable) pair.Value).Clone()); + clone.Add(pair.Key, pair.Value == null ? pair.Value : ((IDeepCloneable)pair.Value).Clone()); } } else @@ -309,7 +309,7 @@ namespace Google.Protobuf.Collections /// /// Stream to read from /// Codec describing how the key/value pairs are encoded - public void AddEntriesFrom(CodedInputStream input, Codec codec) + public void AddEntriesFrom(CodedInputStream input, Codec codec) { var adapter = new Codec.MessageAdapter(codec); do @@ -318,7 +318,7 @@ namespace Google.Protobuf.Collections input.ReadMessage(adapter); this[adapter.Key] = adapter.Value; } while (input.MaybeConsumeTag(codec.MapTag)); - } + } public void WriteTo(CodedOutputStream output, Codec codec) { @@ -350,6 +350,67 @@ namespace Google.Protobuf.Collections return size; } + #region IDictionary explicit interface implementation + void IDictionary.Add(object key, object value) + { + Add((TKey)key, (TValue)value); + } + + bool IDictionary.Contains(object key) + { + if (!(key is TKey)) + { + return false; + } + return ContainsKey((TKey)key); + } + + IDictionaryEnumerator IDictionary.GetEnumerator() + { + throw new NotImplementedException(); + } + + void IDictionary.Remove(object key) + { + if (!(key is TKey)) + { + return; + } + Remove((TKey)key); + } + + void ICollection.CopyTo(Array array, int index) + { + throw new NotImplementedException(); + } + + bool IDictionary.IsFixedSize { get { return IsFrozen; } } + + ICollection IDictionary.Keys { get { return (ICollection)Keys; } } + + ICollection IDictionary.Values { get { return (ICollection)Values; } } + + bool ICollection.IsSynchronized { get { return false; } } + + object ICollection.SyncRoot { get { return null; } } + + object IDictionary.this[object key] + { + get + { + if (!(key is TKey)) + { + return null; + } + TValue value; + TryGetValue((TKey)key, out value); + return value; + } + + set { this[(TKey)key] = (TValue)value; } + } + #endregion + /// /// A codec for a specific map field. This contains all the information required to encoded and /// decode the nested messages. diff --git a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs index ed311494..ebc711de 100644 --- a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs +++ b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs @@ -41,7 +41,7 @@ namespace Google.Protobuf.Collections /// restrictions (no null values) and capabilities (deep cloning and freezing). /// /// The element type of the repeated field. - public sealed class RepeatedField : IList, IDeepCloneable>, IEquatable>, IFreezable + public sealed class RepeatedField : IList, IList, IDeepCloneable>, IEquatable>, IFreezable { private static readonly T[] EmptyArray = new T[0]; @@ -415,7 +415,66 @@ namespace Google.Protobuf.Collections array[index] = value; } } - + + #region Explicit interface implementation for IList and ICollection. + bool IList.IsFixedSize { get { return IsFrozen; } } + + void ICollection.CopyTo(Array array, int index) + { + ThrowHelper.ThrowIfNull(array, "array"); + T[] strongArray = array as T[]; + if (strongArray == null) + { + throw new ArgumentException("Array is of incorrect type", "array"); + } + CopyTo(strongArray, index); + } + + bool ICollection.IsSynchronized { get { return false; } } + + object ICollection.SyncRoot { get { return null; } } + + object IList.this[int index] + { + get { return this[index]; } + set { this[index] = (T)value; } + } + + int IList.Add(object value) + { + Add((T) value); + return count - 1; + } + + bool IList.Contains(object value) + { + return (value is T && Contains((T)value)); + } + + int IList.IndexOf(object value) + { + if (!(value is T)) + { + return -1; + } + return IndexOf((T)value); + } + + void IList.Insert(int index, object value) + { + Insert(index, (T) value); + } + + void IList.Remove(object value) + { + if (!(value is T)) + { + return; + } + Remove((T)value); + } + #endregion + public struct Enumerator : IEnumerator { private int index; diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 2f2c5806..3b36a280 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -131,6 +131,11 @@ namespace Google.Protobuf.Descriptors get { return Proto.Label == FieldDescriptorProto.Types.Label.LABEL_REPEATED; } } + public bool IsMap + { + get { return fieldType == FieldType.Message && messageType.Options != null && messageType.Options.MapEntry; } + } + public bool IsPacked { get { return Proto.Options.Packed; } diff --git a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs index 7da14a54..a6320a31 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs @@ -336,33 +336,8 @@ namespace Google.Protobuf.Descriptors } } - /// - /// This method is to be called by generated code only. It is equivalent - /// to BuildFrom except that the FileDescriptorProto is encoded in - /// protocol buffer wire format. This overload is maintained for backward - /// compatibility with source code generated before the custom options were available - /// (and working). - /// - public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, FileDescriptor[] dependencies) - { - return InternalBuildGeneratedFileFrom(descriptorData, dependencies, x => { }); - } - - /// - /// This delegate should be used by generated code only. When calling - /// FileDescriptor.InternalBuildGeneratedFileFrom, the caller can provide - /// a callback which assigns the global variables defined in the generated code - /// which point at parts of the FileDescriptor. The callback returns an - /// Extension Registry which contains any extensions which might be used in - /// the descriptor - that is, extensions of the various "Options" messages defined - /// in descriptor.proto. The callback may also return null to indicate that - /// no extensions are used in the descriptor. - /// - public delegate void InternalDescriptorAssigner(FileDescriptor descriptor); - public static FileDescriptor InternalBuildGeneratedFileFrom(byte[] descriptorData, - FileDescriptor[] dependencies, - InternalDescriptorAssigner descriptorAssigner) + FileDescriptor[] dependencies) { FileDescriptorProto proto; try @@ -374,20 +349,16 @@ namespace Google.Protobuf.Descriptors throw new ArgumentException("Failed to parse protocol buffer descriptor for generated code.", e); } - FileDescriptor result; try { // When building descriptors for generated code, we allow unknown // dependencies by default. - result = BuildFrom(proto, dependencies, true); + return BuildFrom(proto, dependencies, true); } catch (DescriptorValidationException e) { throw new ArgumentException("Invalid embedded descriptor for \"" + proto.Name + "\".", e); } - - descriptorAssigner(result); - return result; } public override string ToString() diff --git a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorBase.cs b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorBase.cs index 73d777b2..2a3e5b8b 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorBase.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorBase.cs @@ -32,34 +32,37 @@ using System; using System.Reflection; +using Google.Protobuf.Descriptors; namespace Google.Protobuf.FieldAccess { /// /// Base class for field accessors. /// - /// Type of message containing the field - internal abstract class FieldAccessorBase : IFieldAccessor where T : IMessage + internal abstract class FieldAccessorBase : IFieldAccessor { - private readonly Func getValueDelegate; + private readonly Func getValueDelegate; + private readonly FieldDescriptor descriptor; - internal FieldAccessorBase(string name) + internal FieldAccessorBase(Type type, string propertyName, FieldDescriptor descriptor) { - PropertyInfo property = typeof(T).GetProperty(name); + PropertyInfo property = type.GetProperty(propertyName); if (property == null || !property.CanRead) { throw new ArgumentException("Not all required properties/methods available"); } - getValueDelegate = ReflectionUtil.CreateUpcastDelegate(property.GetGetMethod()); + this.descriptor = descriptor; + getValueDelegate = ReflectionUtil.CreateFuncObjectObject(property.GetGetMethod()); } - public object GetValue(T message) + public FieldDescriptor Descriptor { get { return descriptor; } } + + public object GetValue(object message) { return getValueDelegate(message); } - public abstract bool HasValue(T message); - public abstract void Clear(T message); - public abstract void SetValue(T message, object value); + public abstract void Clear(object message); + public abstract void SetValue(object message, object value); } } diff --git a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs index 6379ff25..57ea9c87 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/FieldAccessorTable.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.Collections.ObjectModel; using Google.Protobuf.Descriptors; namespace Google.Protobuf.FieldAccess @@ -38,34 +39,43 @@ namespace Google.Protobuf.FieldAccess /// /// Provides access to fields in generated messages via reflection. /// - public sealed class FieldAccessorTable where T : IMessage + public sealed class FieldAccessorTable { - private readonly IFieldAccessor[] accessors; + private readonly ReadOnlyCollection accessors; 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(MessageDescriptor descriptor, string[] propertyNames) + public FieldAccessorTable(Type type, MessageDescriptor descriptor, string[] propertyNames) { this.descriptor = descriptor; - accessors = new IFieldAccessor[descriptor.Fields.Count]; - bool supportFieldPresence = descriptor.File.Syntax == FileDescriptor.ProtoSyntax.Proto2; - for (int i = 0; i < accessors.Length; i++) + var accessorsArray = new IFieldAccessor[descriptor.Fields.Count]; + for (int i = 0; i < accessorsArray.Length; i++) { var field = descriptor.Fields[i]; var name = propertyNames[i]; - accessors[i] = field.IsRepeated - ? (IFieldAccessor) new RepeatedFieldAccessor(propertyNames[i]) - : new SingleFieldAccessor(field, name, supportFieldPresence); + 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); // TODO(jonskeet): Oneof support } - internal IFieldAccessor this[int fieldNumber] + // 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 IFieldAccessor this[int fieldNumber] { get { @@ -74,7 +84,7 @@ namespace Google.Protobuf.FieldAccess } } - internal IFieldAccessor this[FieldDescriptor field] + internal IFieldAccessor this[FieldDescriptor field] { get { diff --git a/csharp/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs index 61838543..77e7146d 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/IFieldAccessor.cs @@ -30,39 +30,41 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using Google.Protobuf.Descriptors; + namespace Google.Protobuf.FieldAccess { /// - /// Allows fields to be reflectively accessed in a smart manner. - /// The property descriptors for each field are created once and then cached. - /// In addition, this interface holds knowledge of repeated fields, builders etc. + /// Allows fields to be reflectively accessed. /// - internal interface IFieldAccessor where T : IMessage + public interface IFieldAccessor { /// - /// Indicates whether the specified message contains the field. For primitive fields - /// declared in proto3-syntax messages, this simply checks whether the value is the default one. + /// Returns the descriptor associated with this field. /// - /// The field is a repeated field, or a single primitive field. - bool HasValue(T message); + FieldDescriptor Descriptor { get; } /// /// Clears the field in the specified message. (For repeated fields, /// this clears the list.) /// - void Clear(T message); + void Clear(object message); /// /// Fetches the field value. For repeated values, this will be an - /// implementation. + /// implementation. For map values, this will be an + /// implementation. /// - object GetValue(T message); + object GetValue(object message); /// - /// Mutator for single fields only. (Repeated fields must be mutated - /// by fetching the list, then mutating that.) + /// Mutator for single "simple" fields only. /// - /// The field is a repeated field. - void SetValue(T message, object value); + /// + /// Repeated fields are mutated by fetching the value and manipulating it as a list. + /// Map fields are mutated by fetching the value and manipulating it as a dictionary. + /// + /// The field is not a "simple" field, or the message is frozen. + void SetValue(object message, object value); } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/FieldAccess/MapFieldAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/MapFieldAccessor.cs new file mode 100644 index 00000000..100dbb37 --- /dev/null +++ b/csharp/src/ProtocolBuffers/FieldAccess/MapFieldAccessor.cs @@ -0,0 +1,59 @@ +#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; +using System.Collections; +using Google.Protobuf.Descriptors; + +namespace Google.Protobuf.FieldAccess +{ + /// + /// Accessor for map fields. + /// + internal sealed class MapFieldAccessor : FieldAccessorBase + { + internal MapFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) + { + } + + public override void Clear(object message) + { + IDictionary list = (IDictionary) GetValue(message); + list.Clear(); + } + + public override void SetValue(object message, object value) + { + throw new InvalidOperationException("SetValue is not implemented for map fields"); + } + } +} diff --git a/csharp/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs b/csharp/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs index 29399b0c..d3053920 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs @@ -31,6 +31,7 @@ #endregion using System; +using System.Linq.Expressions; using System.Reflection; namespace Google.Protobuf.FieldAccess @@ -51,101 +52,42 @@ namespace Google.Protobuf.FieldAccess internal static readonly Type[] EmptyTypes = new Type[0]; /// - /// Creates a delegate which will execute the given method and then return - /// the result as an object. + /// Creates a delegate which will cast the argument to the appropriate method target type, + /// call the method on it, then convert the result to object. /// - public static Func CreateUpcastDelegate(MethodInfo method) + internal static Func CreateFuncObjectObject(MethodInfo method) { - // The tricky bit is invoking CreateCreateUpcastDelegateImpl with the right type parameters - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateUpcastDelegateImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.ReturnType); - return (Func) closedImpl.Invoke(null, new object[] {method}); + ParameterExpression parameter = Expression.Parameter(typeof(object), "p"); + Expression downcast = Expression.Convert(parameter, method.DeclaringType); + Expression call = Expression.Call(downcast, method); + Expression upcast = Expression.Convert(call, typeof(object)); + return Expression.Lambda>(upcast, parameter).Compile(); } - + /// - /// Method used solely for implementing CreateUpcastDelegate. Public to avoid trust issues - /// in low-trust scenarios. + /// Creates a delegate which will execute the given method after casting the first argument to + /// the target type of the method, and the second argument to the first parameter type of the method. /// - public static Func CreateUpcastDelegateImpl(MethodInfo method) + internal static Action CreateActionObjectObject(MethodInfo method) { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method() - // we'll call getter(x). - Func getter = ReflectionUtil.CreateDelegateFunc(method); - - // Implicit upcast to object (within the delegate) - return source => getter(source); + ParameterExpression targetParameter = Expression.Parameter(typeof(object), "target"); + ParameterExpression argParameter = Expression.Parameter(typeof(object), "arg"); + Expression castTarget = Expression.Convert(targetParameter, method.DeclaringType); + Expression castArgument = Expression.Convert(argParameter, method.GetParameters()[0].ParameterType); + Expression call = Expression.Call(castTarget, method, castArgument); + return Expression.Lambda>(call, targetParameter, argParameter).Compile(); } /// - /// Creates a delegate which will execute the given method after casting the parameter - /// down from object to the required parameter type. + /// Creates a delegate which will execute the given method after casting the first argument to + /// the target type of the method. /// - public static Action CreateDowncastDelegate(MethodInfo method) - { - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType); - return (Action) closedImpl.Invoke(null, new object[] {method}); - } - - public static Action CreateDowncastDelegateImpl(MethodInfo method) - { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll - // call Method(x, y) - Action call = ReflectionUtil.CreateDelegateAction(method); - - return (source, parameter) => call(source, (TParam) parameter); - } - - /// - /// Creates a delegate which will execute the given method after casting the parameter - /// down from object to the required parameter type. - /// - public static Action CreateDowncastDelegateIgnoringReturn(MethodInfo method) - { - MethodInfo openImpl = typeof(ReflectionUtil).GetMethod("CreateDowncastDelegateIgnoringReturnImpl"); - MethodInfo closedImpl = openImpl.MakeGenericMethod(typeof(T), method.GetParameters()[0].ParameterType, - method.ReturnType); - return (Action) closedImpl.Invoke(null, new object[] {method}); - } - - public static Action CreateDowncastDelegateIgnoringReturnImpl( - MethodInfo method) - { - // Convert the reflection call into an open delegate, i.e. instead of calling x.Method(y) we'll - // call Method(x, y) - Func call = ReflectionUtil.CreateDelegateFunc(method); - - return delegate(TSource source, object parameter) { call(source, (TParam) parameter); }; - } - - internal static Func CreateDelegateFunc(MethodInfo method) - { - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; - } - - internal static Func CreateDelegateFunc(MethodInfo method) - { - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; - } - - internal static Func CreateDelegateFunc(MethodInfo method) - { - object tdelegate = Delegate.CreateDelegate(typeof(Func), null, method); - return (Func)tdelegate; - } - - internal static Action CreateDelegateAction(MethodInfo method) - { - object tdelegate = Delegate.CreateDelegate(typeof(Action), null, method); - return (Action)tdelegate; - } - - internal static Action CreateDelegateAction(MethodInfo method) + internal static Action CreateActionObject(MethodInfo method) { - object tdelegate = Delegate.CreateDelegate(typeof(Action), null, method); - return (Action)tdelegate; + ParameterExpression targetParameter = Expression.Parameter(typeof(object), "target"); + Expression castTarget = Expression.Convert(targetParameter, method.DeclaringType); + Expression call = Expression.Call(castTarget, method); + return Expression.Lambda>(call, targetParameter).Compile(); } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/FieldAccess/RepeatedFieldAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/RepeatedFieldAccessor.cs index b12278f9..8d7ecbaf 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/RepeatedFieldAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/RepeatedFieldAccessor.cs @@ -32,33 +32,28 @@ using System; using System.Collections; +using Google.Protobuf.Descriptors; namespace Google.Protobuf.FieldAccess { /// /// Accessor for repeated fields. /// - /// The type of message containing the field. - internal sealed class RepeatedFieldAccessor : FieldAccessorBase where T : IMessage + internal sealed class RepeatedFieldAccessor : FieldAccessorBase { - internal RepeatedFieldAccessor(string name) : base(name) + internal RepeatedFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) { } - public override void Clear(T message) + public override void Clear(object message) { IList list = (IList) GetValue(message); list.Clear(); } - public override bool HasValue(T message) + public override void SetValue(object message, object value) { - throw new NotImplementedException("HasValue is not implemented for repeated fields"); - } - - public override void SetValue(T message, object value) - { - throw new NotImplementedException("SetValue is not implemented for repeated fields"); + throw new InvalidOperationException("SetValue is not implemented for repeated fields"); } } diff --git a/csharp/src/ProtocolBuffers/FieldAccess/SingleFieldAccessor.cs b/csharp/src/ProtocolBuffers/FieldAccess/SingleFieldAccessor.cs index 7a8f726e..cdc89e8d 100644 --- a/csharp/src/ProtocolBuffers/FieldAccess/SingleFieldAccessor.cs +++ b/csharp/src/ProtocolBuffers/FieldAccess/SingleFieldAccessor.cs @@ -39,76 +39,46 @@ namespace Google.Protobuf.FieldAccess /// /// Accessor for single fields. /// - /// The type of message containing the field. - internal sealed class SingleFieldAccessor : FieldAccessorBase where T : IMessage + internal sealed class SingleFieldAccessor : FieldAccessorBase { // All the work here is actually done in the constructor - it creates the appropriate delegates. // There are various cases to consider, based on the property type (message, string/bytes, or "genuine" primitive) // and proto2 vs proto3 for non-message types, as proto3 doesn't support "full" presence detection or default // values. - private readonly Action setValueDelegate; - private readonly Action clearDelegate; - private readonly Func hasValueDelegate; + private readonly Action setValueDelegate; + private readonly Action clearDelegate; - internal SingleFieldAccessor(FieldDescriptor descriptor, string name, bool supportsFieldPresence) : base(name) + internal SingleFieldAccessor(Type type, string propertyName, FieldDescriptor descriptor) : base(type, propertyName, descriptor) { - PropertyInfo property = typeof(T).GetProperty(name); + 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"); } - setValueDelegate = ReflectionUtil.CreateDowncastDelegate(property.GetSetMethod()); + setValueDelegate = ReflectionUtil.CreateActionObjectObject(property.GetSetMethod()); var clrType = property.PropertyType; + + // TODO: What should clear on a oneof member do? Clear the oneof? - if (typeof(IMessage).IsAssignableFrom(clrType)) - { - // Message types are simple - we only need to detect nullity. - clearDelegate = message => SetValue(message, null); - hasValueDelegate = message => GetValue(message) == null; - } - - if (supportsFieldPresence) - { - // Proto2: we expect a HasFoo property and a ClearFoo method. - // For strings and byte arrays, setting the property to null would have the equivalent effect, - // but we generate the method for consistency, which makes this simpler. - PropertyInfo hasProperty = typeof(T).GetProperty("Has" + name); - MethodInfo clearMethod = typeof(T).GetMethod("Clear" + name); - if (hasProperty == null || clearMethod == null || !hasProperty.CanRead) - { - throw new ArgumentException("Not all required properties/methods available"); - } - hasValueDelegate = ReflectionUtil.CreateDelegateFunc(hasProperty.GetGetMethod()); - clearDelegate = ReflectionUtil.CreateDelegateAction(clearMethod); - } - else - { - /* - // TODO(jonskeet): Reimplement. We need a better way of working out default values. - // Proto3: for field detection, we just need the default value of the field (0, "", byte[0] etc) - // To clear a field, we set the value to that default. - object defaultValue = descriptor.DefaultValue; - hasValueDelegate = message => GetValue(message).Equals(defaultValue); - clearDelegate = message => SetValue(message, defaultValue); - */ - } - } - - public override bool HasValue(T message) - { - return hasValueDelegate(message); + // TODO: Validate that this is a reasonable single field? (Should be a value type, a message type, or string/ByteString.) + object defaultValue = + typeof(IMessage).IsAssignableFrom(clrType) ? null + : clrType == typeof(string) ? "" + : clrType == typeof(ByteString) ? ByteString.Empty + : Activator.CreateInstance(clrType); + clearDelegate = message => SetValue(message, defaultValue); } - public override void Clear(T message) + public override void Clear(object message) { clearDelegate(message); } - public override void SetValue(T message, object value) + public override void SetValue(object message, object value) { setValueDelegate(message, value); } diff --git a/csharp/src/ProtocolBuffers/IMessage.cs b/csharp/src/ProtocolBuffers/IMessage.cs index 27bcc117..ad44668c 100644 --- a/csharp/src/ProtocolBuffers/IMessage.cs +++ b/csharp/src/ProtocolBuffers/IMessage.cs @@ -40,12 +40,11 @@ namespace Google.Protobuf // TODO(jonskeet): Split these interfaces into separate files when we're happy with them. /// - /// Reflection support for a specific message type. message + /// Reflection support for a specific message type. /// - /// The message type being reflected. - public interface IReflectedMessage where T : IMessage + public interface IReflectedMessage { - FieldAccessorTable Fields { get; } + FieldAccessorTable Fields { get; } // TODO(jonskeet): Descriptor? Or a single property which has "all you need for reflection"? } diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index 1e7408ea..4078589e 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -79,6 +79,7 @@ + -- cgit v1.2.3 From 462d569ec0eb8f6a7b81f0423566cba20fb2bf9f Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 1 Jul 2015 14:47:36 +0100 Subject: Changes to generated code due to previous commit. --- csharp/src/AddressBook/Addressbook.cs | 49 +- .../TestProtos/MapUnittestProto3.cs | 623 +++++++++------------ .../TestProtos/UnittestImportProto3.cs | 21 +- .../TestProtos/UnittestImportPublicProto3.cs | 21 +- .../TestProtos/UnittestIssues.cs | 105 ++-- .../TestProtos/UnittestProto3.cs | 497 +++++++--------- .../DescriptorProtos/DescriptorProtoFile.cs | 315 +++++------ 7 files changed, 692 insertions(+), 939 deletions(-) (limited to 'csharp/src/ProtocolBuffers') diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 4fd46471..0b77ebf1 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -13,12 +13,9 @@ namespace Google.Protobuf.Examples.AddressBook { public static partial class Addressbook { #region Static variables - internal static pbd::MessageDescriptor internal__static_tutorial_Person__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_Person_PhoneNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_tutorial_AddressBook__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_tutorial_AddressBook__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -38,24 +35,18 @@ namespace Google.Protobuf.Examples.AddressBook { "ZXJzb24YASADKAsyEC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUu", "dHV0b3JpYWxCEUFkZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVm", "LkV4YW1wbGVzLkFkZHJlc3NCb29r")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_tutorial_Person__Descriptor = Descriptor.MessageTypes[0]; - internal__static_tutorial_Person__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person__Descriptor, - new string[] { "Name", "Id", "Email", "Phone", }); - internal__static_tutorial_Person_PhoneNumber__Descriptor = internal__static_tutorial_Person__Descriptor.NestedTypes[0]; - internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_Person_PhoneNumber__Descriptor, - new string[] { "Number", "Type", }); - internal__static_tutorial_AddressBook__Descriptor = Descriptor.MessageTypes[1]; - internal__static_tutorial_AddressBook__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_tutorial_AddressBook__Descriptor, - new string[] { "Person", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { - }, assigner); + }); + internal__static_tutorial_Person__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.Person), descriptor.MessageTypes[0], + new string[] { "Name", "Id", "Email", "Phone", }); + internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneNumber), descriptor.MessageTypes[0].NestedTypes[0], + new string[] { "Number", "Type", }); + internal__static_tutorial_AddressBook__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.Examples.AddressBook.AddressBook), descriptor.MessageTypes[1], + new string[] { "Person", }); } #endregion @@ -69,10 +60,10 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly string[] _fieldNames = new string[] { "email", "id", "name", "phone" }; private static readonly uint[] _fieldTags = new uint[] { 26, 16, 10, 34 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person__Descriptor; } + get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person__FieldAccessorTable; } } @@ -260,10 +251,10 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly string[] _fieldNames = new string[] { "number", "type" }; private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person_PhoneNumber__Descriptor; } + get { return global::Google.Protobuf.Examples.AddressBook.Person.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_Person_PhoneNumber__FieldAccessorTable; } } @@ -403,10 +394,10 @@ namespace Google.Protobuf.Examples.AddressBook { private static readonly string[] _fieldNames = new string[] { "person" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_AddressBook__Descriptor; } + get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.Descriptor.MessageTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.Examples.AddressBook.Addressbook.internal__static_tutorial_AddressBook__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs index 54c8880c..365c03a7 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs @@ -13,94 +13,50 @@ namespace Google.Protobuf.TestProtos { public static partial class MapUnittestProto3 { #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapStringStringEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMapSubmessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageMap__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestSameTypeMap__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MessageContainingEnumCalledType__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MessageContainingMapCalledEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -235,189 +191,142 @@ namespace Google.Protobuf.TestProtos { "dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS", "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestMap__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestMap__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap__Descriptor, - new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapInt32Bytes", "MapInt32Enum", "MapInt32ForeignMessage", }); - internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[2]; - internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[3]; - internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[4]; - internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[5]; - internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[6]; - internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[7]; - internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[8]; - internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[9]; - internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[10]; - internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[11]; - internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[12]; - internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapStringStringEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[13]; - internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapStringStringEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[14]; - internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[15]; - internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__Descriptor = internal__static_protobuf_unittest_TestMap__Descriptor.NestedTypes[16]; - internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestMapSubmessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMapSubmessage__Descriptor, - new string[] { "TestMap", }); - internal__static_protobuf_unittest_TestMessageMap__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageMap__Descriptor, - new string[] { "MapInt32Message", }); - internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__Descriptor = internal__static_protobuf_unittest_TestMessageMap__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestSameTypeMap__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestSameTypeMap__Descriptor, - new string[] { "Map1", "Map2", }); - internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__Descriptor = internal__static_protobuf_unittest_TestSameTypeMap__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__Descriptor = internal__static_protobuf_unittest_TestSameTypeMap__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap__Descriptor, - new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapInt32Enum", "MapInt32ForeignMessage", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[1]; - internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[2]; - internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[3]; - internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[4]; - internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[5]; - internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[6]; - internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[7]; - internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[8]; - internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[9]; - internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[10]; - internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[11]; - internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[12]; - internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[13]; - internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__Descriptor = internal__static_protobuf_unittest_TestArenaMap__Descriptor.NestedTypes[14]; - internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_MessageContainingEnumCalledType__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MessageContainingEnumCalledType__Descriptor, - new string[] { "Type", }); - internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__Descriptor = internal__static_protobuf_unittest_MessageContainingEnumCalledType__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__Descriptor, - new string[] { "Key", "Value", }); - internal__static_protobuf_unittest_MessageContainingMapCalledEntry__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MessageContainingMapCalledEntry__Descriptor, - new string[] { "Entry", }); - internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__Descriptor = internal__static_protobuf_unittest_MessageContainingMapCalledEntry__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__Descriptor, - new string[] { "Key", "Value", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, - }, assigner); + }); + internal__static_protobuf_unittest_TestMap__FieldAccessorTable = + new pb::FieldAccess.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", }); + internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32Int32Entry), descriptor.MessageTypes[0].NestedTypes[0], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt64Int64Entry), descriptor.MessageTypes[0].NestedTypes[1], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapUint32Uint32Entry), descriptor.MessageTypes[0].NestedTypes[2], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapUint64Uint64Entry), descriptor.MessageTypes[0].NestedTypes[3], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSint32Sint32Entry), descriptor.MessageTypes[0].NestedTypes[4], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSint64Sint64Entry), descriptor.MessageTypes[0].NestedTypes[5], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapFixed32Fixed32Entry), descriptor.MessageTypes[0].NestedTypes[6], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapFixed64Fixed64Entry), descriptor.MessageTypes[0].NestedTypes[7], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSfixed32Sfixed32Entry), descriptor.MessageTypes[0].NestedTypes[8], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapSfixed64Sfixed64Entry), descriptor.MessageTypes[0].NestedTypes[9], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32FloatEntry), descriptor.MessageTypes[0].NestedTypes[10], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32DoubleEntry), descriptor.MessageTypes[0].NestedTypes[11], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapBoolBoolEntry), descriptor.MessageTypes[0].NestedTypes[12], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapStringStringEntry), descriptor.MessageTypes[0].NestedTypes[13], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32BytesEntry), descriptor.MessageTypes[0].NestedTypes[14], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32EnumEntry), descriptor.MessageTypes[0].NestedTypes[15], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap.Types.MapInt32ForeignMessageEntry), descriptor.MessageTypes[0].NestedTypes[16], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), descriptor.MessageTypes[1], + new string[] { "TestMap", }); + internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMessageMap), descriptor.MessageTypes[2], + new string[] { "MapInt32Message", }); + internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMessageMap.Types.MapInt32MessageEntry), descriptor.MessageTypes[2].NestedTypes[0], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), descriptor.MessageTypes[3], + new string[] { "Map1", "Map2", }); + internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap.Types.Map1Entry), descriptor.MessageTypes[3].NestedTypes[0], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap.Types.Map2Entry), descriptor.MessageTypes[3].NestedTypes[1], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable = + new pb::FieldAccess.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", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32Int32Entry), descriptor.MessageTypes[4].NestedTypes[0], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt64Int64Entry), descriptor.MessageTypes[4].NestedTypes[1], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapUint32Uint32Entry), descriptor.MessageTypes[4].NestedTypes[2], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapUint64Uint64Entry), descriptor.MessageTypes[4].NestedTypes[3], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSint32Sint32Entry), descriptor.MessageTypes[4].NestedTypes[4], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSint64Sint64Entry), descriptor.MessageTypes[4].NestedTypes[5], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapFixed32Fixed32Entry), descriptor.MessageTypes[4].NestedTypes[6], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapFixed64Fixed64Entry), descriptor.MessageTypes[4].NestedTypes[7], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSfixed32Sfixed32Entry), descriptor.MessageTypes[4].NestedTypes[8], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapSfixed64Sfixed64Entry), descriptor.MessageTypes[4].NestedTypes[9], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32FloatEntry), descriptor.MessageTypes[4].NestedTypes[10], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32DoubleEntry), descriptor.MessageTypes[4].NestedTypes[11], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapBoolBoolEntry), descriptor.MessageTypes[4].NestedTypes[12], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32EnumEntry), descriptor.MessageTypes[4].NestedTypes[13], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap.Types.MapInt32ForeignMessageEntry), descriptor.MessageTypes[4].NestedTypes[14], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), descriptor.MessageTypes[5], + new string[] { "Type", }); + internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.TypeEntry), descriptor.MessageTypes[5].NestedTypes[0], + new string[] { "Key", "Value", }); + internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), descriptor.MessageTypes[6], + new string[] { "Entry", }); + internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry.Types.EntryEntry), descriptor.MessageTypes[6].NestedTypes[0], + new string[] { "Key", "Value", }); } #endregion @@ -440,10 +349,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap__FieldAccessorTable; } } @@ -848,10 +757,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32Int32Entry__FieldAccessorTable; } } @@ -986,10 +895,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt64Int64Entry__FieldAccessorTable; } } @@ -1124,10 +1033,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint32Uint32Entry__FieldAccessorTable; } } @@ -1262,10 +1171,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapUint64Uint64Entry__FieldAccessorTable; } } @@ -1400,10 +1309,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint32Sint32Entry__FieldAccessorTable; } } @@ -1538,10 +1447,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[5]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSint64Sint64Entry__FieldAccessorTable; } } @@ -1676,10 +1585,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[6]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed32Fixed32Entry__FieldAccessorTable; } } @@ -1814,10 +1723,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[7]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapFixed64Fixed64Entry__FieldAccessorTable; } } @@ -1952,10 +1861,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[8]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; } } @@ -2090,10 +1999,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[9]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; } } @@ -2228,10 +2137,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[10]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32FloatEntry__FieldAccessorTable; } } @@ -2366,10 +2275,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[11]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32DoubleEntry__FieldAccessorTable; } } @@ -2504,10 +2413,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[12]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapBoolBoolEntry__FieldAccessorTable; } } @@ -2642,10 +2551,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapStringStringEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[13]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapStringStringEntry__FieldAccessorTable; } } @@ -2780,10 +2689,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[14]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32BytesEntry__FieldAccessorTable; } } @@ -2918,10 +2827,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[15]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32EnumEntry__FieldAccessorTable; } } @@ -3056,10 +2965,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMap.Descriptor.NestedTypes[16]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap_MapInt32ForeignMessageEntry__FieldAccessorTable; } } @@ -3206,10 +3115,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "test_map" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMapSubmessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; } } @@ -3324,10 +3233,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "map_int32_message" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; } } @@ -3428,10 +3337,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestMessageMap.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap_MapInt32MessageEntry__FieldAccessorTable; } } @@ -3578,10 +3487,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "map1", "map2" }; private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; } } @@ -3701,10 +3610,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestSameTypeMap.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map1Entry__FieldAccessorTable; } } @@ -3839,10 +3748,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestSameTypeMap.Descriptor.NestedTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap_Map2Entry__FieldAccessorTable; } } @@ -3982,10 +3891,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; } } @@ -4352,10 +4261,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32Int32Entry__FieldAccessorTable; } } @@ -4490,10 +4399,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt64Int64Entry__FieldAccessorTable; } } @@ -4628,10 +4537,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint32Uint32Entry__FieldAccessorTable; } } @@ -4766,10 +4675,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapUint64Uint64Entry__FieldAccessorTable; } } @@ -4904,10 +4813,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint32Sint32Entry__FieldAccessorTable; } } @@ -5042,10 +4951,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[5]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSint64Sint64Entry__FieldAccessorTable; } } @@ -5180,10 +5089,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[6]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed32Fixed32Entry__FieldAccessorTable; } } @@ -5318,10 +5227,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[7]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapFixed64Fixed64Entry__FieldAccessorTable; } } @@ -5456,10 +5365,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 13, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[8]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed32Sfixed32Entry__FieldAccessorTable; } } @@ -5594,10 +5503,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 9, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[9]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapSfixed64Sfixed64Entry__FieldAccessorTable; } } @@ -5732,10 +5641,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 21 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[10]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32FloatEntry__FieldAccessorTable; } } @@ -5870,10 +5779,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 17 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[11]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32DoubleEntry__FieldAccessorTable; } } @@ -6008,10 +5917,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[12]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapBoolBoolEntry__FieldAccessorTable; } } @@ -6146,10 +6055,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[13]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32EnumEntry__FieldAccessorTable; } } @@ -6284,10 +6193,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestArenaMap.Descriptor.NestedTypes[14]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap_MapInt32ForeignMessageEntry__FieldAccessorTable; } } @@ -6434,10 +6343,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "type" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[5]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; } } @@ -6542,10 +6451,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType_TypeEntry__FieldAccessorTable; } } @@ -6692,10 +6601,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "entry" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[6]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; } } @@ -6796,10 +6705,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "key", "value" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__Descriptor; } + get { return global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry_EntryEntry__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs index 939be74a..5afcb4e0 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs @@ -13,8 +13,7 @@ namespace Google.Protobuf.TestProtos { public static partial class UnittestImportProto3 { #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_ImportMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -33,17 +32,13 @@ namespace Google.Protobuf.TestProtos { "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", "Mw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_import_ImportMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_ImportMessage__Descriptor, - new string[] { "D", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, - }, assigner); + }); + internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ImportMessage), descriptor.MessageTypes[0], + new string[] { "D", }); } #endregion @@ -67,10 +62,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "d" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.internal__static_protobuf_unittest_import_ImportMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs index a5a33ea7..79c0876e 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs @@ -13,8 +13,7 @@ namespace Google.Protobuf.TestProtos { public static partial class UnittestImportPublicProto3 { #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -29,16 +28,12 @@ namespace Google.Protobuf.TestProtos { "bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ", "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor, - new string[] { "E", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { - }, assigner); + }); + internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), descriptor.MessageTypes[0], + new string[] { "E", }); } #endregion @@ -52,10 +47,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "e" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.internal__static_protobuf_unittest_import_PublicImportMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs index 16bdb3f2..124f2de7 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs @@ -13,20 +13,13 @@ namespace UnitTest.Issues.TestProtos { public static partial class UnittestIssues { #region Static variables - internal static pbd::MessageDescriptor internal__static_unittest_issues_Issue307__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_Issue307_NestedOnce__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_NegativeEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedChild__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_unittest_issues_ItemField__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -55,40 +48,30 @@ namespace UnitTest.Issues.TestProtos { "EPv//////////wESFQoITWludXNPbmUQ////////////ASouCg5EZXByZWNh", "dGVkRW51bRITCg9ERVBSRUNBVEVEX1pFUk8QABIHCgNvbmUQAUIfSAGqAhpV", "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_unittest_issues_Issue307__Descriptor = Descriptor.MessageTypes[0]; - internal__static_unittest_issues_Issue307__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_Issue307__Descriptor, - new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce__Descriptor = internal__static_unittest_issues_Issue307__Descriptor.NestedTypes[0]; - internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_Issue307_NestedOnce__Descriptor, - new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__Descriptor = internal__static_unittest_issues_Issue307_NestedOnce__Descriptor.NestedTypes[0]; - internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__Descriptor, - new string[] { }); - internal__static_unittest_issues_NegativeEnumMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_NegativeEnumMessage__Descriptor, - new string[] { "Value", "Values", "PackedValues", }); - internal__static_unittest_issues_DeprecatedChild__Descriptor = Descriptor.MessageTypes[2]; - internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedChild__Descriptor, - new string[] { }); - internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor, - new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }); - internal__static_unittest_issues_ItemField__Descriptor = Descriptor.MessageTypes[4]; - internal__static_unittest_issues_ItemField__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_unittest_issues_ItemField__Descriptor, - new string[] { "Item", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { - }, assigner); + }); + internal__static_unittest_issues_Issue307__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307), descriptor.MessageTypes[0], + new string[] { }); + internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), descriptor.MessageTypes[0].NestedTypes[0], + new string[] { }); + internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), descriptor.MessageTypes[0].NestedTypes[0].NestedTypes[0], + new string[] { }); + internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), descriptor.MessageTypes[1], + new string[] { "Value", "Values", "PackedValues", }); + internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), descriptor.MessageTypes[2], + new string[] { }); + internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), descriptor.MessageTypes[3], + new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }); + internal__static_unittest_issues_ItemField__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.ItemField), descriptor.MessageTypes[4], + new string[] { "Item", }); } #endregion @@ -116,10 +99,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307__FieldAccessorTable; } } @@ -201,10 +184,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; } } @@ -286,10 +269,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; } } @@ -380,10 +363,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { "packed_values", "value", "values" }; private static readonly uint[] _fieldTags = new uint[] { 26, 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; } } @@ -529,10 +512,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; } } @@ -613,10 +596,10 @@ namespace UnitTest.Issues.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; } } @@ -849,10 +832,10 @@ namespace UnitTest.Issues.TestProtos { private static readonly string[] _fieldNames = new string[] { "item" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__Descriptor; } + get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs index ea486fcc..c9aed740 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs @@ -13,76 +13,41 @@ namespace Google.Protobuf.TestProtos { public static partial class UnittestProto3 { #region Static variables - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_NestedTestAllTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_ForeignMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestReservedFields__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestForeignNested__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneString__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MoreString__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MoreString__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_OneBytes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_MoreBytes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_Int32Message__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_Uint32Message__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_Int64Message__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_Uint64Message__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BoolMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestOneof__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestPackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_TestCommentInjectionMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooClientMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_FooServerMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_protobuf_unittest_BarResponse__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MoreString__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -220,153 +185,115 @@ namespace Google.Protobuf.TestProtos { "HS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1ZXN0Gh4ucHJvdG9idWZfdW5p", "dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB", "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_protobuf_unittest_TestAllTypes__Descriptor = Descriptor.MessageTypes[0]; - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes__Descriptor, - 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", "OneofField", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestAllTypes__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_NestedTestAllTypes__Descriptor = Descriptor.MessageTypes[1]; - internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_NestedTestAllTypes__Descriptor, - new string[] { "Child", "Payload", "RepeatedChild", }); - internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor = Descriptor.MessageTypes[2]; - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor, - new string[] { "DeprecatedInt32", }); - internal__static_protobuf_unittest_ForeignMessage__Descriptor = Descriptor.MessageTypes[3]; - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_ForeignMessage__Descriptor, - new string[] { "C", }); - internal__static_protobuf_unittest_TestReservedFields__Descriptor = Descriptor.MessageTypes[4]; - internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestReservedFields__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_TestForeignNested__Descriptor = Descriptor.MessageTypes[5]; - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestForeignNested__Descriptor, - new string[] { "ForeignNested", }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor = Descriptor.MessageTypes[6]; - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor, - new string[] { "A", "Bb", }); - internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor = Descriptor.MessageTypes[7]; - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor, - new string[] { "A", "I", }); - internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor = Descriptor.MessageTypes[8]; - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor, - new string[] { "Bb", }); - internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor = Descriptor.MessageTypes[9]; - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor, - new string[] { "A", "OptionalInt32", }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor = Descriptor.MessageTypes[10]; - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor, - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", }); - internal__static_protobuf_unittest_TestFieldOrderings__Descriptor = Descriptor.MessageTypes[11]; - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestFieldOrderings__Descriptor, - new string[] { "MyString", "MyInt", "MyFloat", "SingleNestedMessage", }); - internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__Descriptor = internal__static_protobuf_unittest_TestFieldOrderings__Descriptor.NestedTypes[0]; - internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__Descriptor, - new string[] { "Oo", "Bb", }); - internal__static_protobuf_unittest_SparseEnumMessage__Descriptor = Descriptor.MessageTypes[12]; - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_SparseEnumMessage__Descriptor, - new string[] { "SparseEnum", }); - internal__static_protobuf_unittest_OneString__Descriptor = Descriptor.MessageTypes[13]; - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneString__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_MoreString__Descriptor = Descriptor.MessageTypes[14]; - internal__static_protobuf_unittest_MoreString__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MoreString__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_OneBytes__Descriptor = Descriptor.MessageTypes[15]; - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_OneBytes__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_MoreBytes__Descriptor = Descriptor.MessageTypes[16]; - internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_MoreBytes__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_Int32Message__Descriptor = Descriptor.MessageTypes[17]; - internal__static_protobuf_unittest_Int32Message__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_Int32Message__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_Uint32Message__Descriptor = Descriptor.MessageTypes[18]; - internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_Uint32Message__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_Int64Message__Descriptor = Descriptor.MessageTypes[19]; - internal__static_protobuf_unittest_Int64Message__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_Int64Message__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_Uint64Message__Descriptor = Descriptor.MessageTypes[20]; - internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_Uint64Message__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_BoolMessage__Descriptor = Descriptor.MessageTypes[21]; - internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BoolMessage__Descriptor, - new string[] { "Data", }); - internal__static_protobuf_unittest_TestOneof__Descriptor = Descriptor.MessageTypes[22]; - internal__static_protobuf_unittest_TestOneof__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOneof__Descriptor, - new string[] { "FooInt", "FooString", "FooMessage", "Foo", }); - internal__static_protobuf_unittest_TestPackedTypes__Descriptor = Descriptor.MessageTypes[23]; - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestPackedTypes__Descriptor, - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }); - internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor = Descriptor.MessageTypes[24]; - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor, - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor = Descriptor.MessageTypes[25]; - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor, - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }); - internal__static_protobuf_unittest_TestCommentInjectionMessage__Descriptor = Descriptor.MessageTypes[26]; - internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestCommentInjectionMessage__Descriptor, - new string[] { "A", }); - internal__static_protobuf_unittest_FooRequest__Descriptor = Descriptor.MessageTypes[27]; - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooResponse__Descriptor = Descriptor.MessageTypes[28]; - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooResponse__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooClientMessage__Descriptor = Descriptor.MessageTypes[29]; - internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooClientMessage__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_FooServerMessage__Descriptor = Descriptor.MessageTypes[30]; - internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_FooServerMessage__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarRequest__Descriptor = Descriptor.MessageTypes[31]; - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarRequest__Descriptor, - new string[] { }); - internal__static_protobuf_unittest_BarResponse__Descriptor = Descriptor.MessageTypes[32]; - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_BarResponse__Descriptor, - new string[] { }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, - }, assigner); + }); + internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = + new pb::FieldAccess.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", "OneofField", }); + internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), descriptor.MessageTypes[0].NestedTypes[0], + new string[] { "Bb", }); + internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), descriptor.MessageTypes[1], + new string[] { "Child", "Payload", "RepeatedChild", }); + internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), descriptor.MessageTypes[2], + new string[] { "DeprecatedInt32", }); + internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ForeignMessage), descriptor.MessageTypes[3], + new string[] { "C", }); + internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReservedFields), descriptor.MessageTypes[4], + new string[] { }); + internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestForeignNested), descriptor.MessageTypes[5], + new string[] { "ForeignNested", }); + internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), descriptor.MessageTypes[6], + new string[] { "A", "Bb", }); + internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), descriptor.MessageTypes[7], + new string[] { "A", "I", }); + internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), descriptor.MessageTypes[8], + new string[] { "Bb", }); + internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), descriptor.MessageTypes[9], + new string[] { "A", "OptionalInt32", }); + internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), descriptor.MessageTypes[10], + new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", }); + internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), descriptor.MessageTypes[11], + new string[] { "MyString", "MyInt", "MyFloat", "SingleNestedMessage", }); + internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), descriptor.MessageTypes[11].NestedTypes[0], + new string[] { "Oo", "Bb", }); + internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), descriptor.MessageTypes[12], + new string[] { "SparseEnum", }); + internal__static_protobuf_unittest_OneString__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneString), descriptor.MessageTypes[13], + new string[] { "Data", }); + internal__static_protobuf_unittest_MoreString__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreString), descriptor.MessageTypes[14], + new string[] { "Data", }); + internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneBytes), descriptor.MessageTypes[15], + new string[] { "Data", }); + internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreBytes), descriptor.MessageTypes[16], + new string[] { "Data", }); + internal__static_protobuf_unittest_Int32Message__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int32Message), descriptor.MessageTypes[17], + new string[] { "Data", }); + internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint32Message), descriptor.MessageTypes[18], + new string[] { "Data", }); + internal__static_protobuf_unittest_Int64Message__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int64Message), descriptor.MessageTypes[19], + new string[] { "Data", }); + internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint64Message), descriptor.MessageTypes[20], + new string[] { "Data", }); + internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BoolMessage), descriptor.MessageTypes[21], + new string[] { "Data", }); + internal__static_protobuf_unittest_TestOneof__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestOneof), descriptor.MessageTypes[22], + new string[] { "FooInt", "FooString", "FooMessage", "Foo", }); + internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = + new pb::FieldAccess.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", }); + internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = + new pb::FieldAccess.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", }); + internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), descriptor.MessageTypes[25], + new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }); + internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), descriptor.MessageTypes[26], + new string[] { "A", }); + internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooRequest), descriptor.MessageTypes[27], + new string[] { }); + internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooResponse), descriptor.MessageTypes[28], + new string[] { }); + internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), descriptor.MessageTypes[29], + new string[] { }); + internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), descriptor.MessageTypes[30], + new string[] { }); + internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarRequest), descriptor.MessageTypes[31], + new string[] { }); + internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarResponse), descriptor.MessageTypes[32], + new string[] { }); } #endregion @@ -409,10 +336,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } } @@ -1702,10 +1629,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "bb" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } } @@ -1818,10 +1745,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "child", "payload", "repeated_child" }; private static readonly uint[] _fieldTags = new uint[] { 10, 18, 26 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_NestedTestAllTypes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; } } @@ -1989,10 +1916,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "deprecated_int32" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestDeprecatedFields__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } } @@ -2101,10 +2028,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "c" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_ForeignMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } } @@ -2212,10 +2139,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReservedFields__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; } } @@ -2296,10 +2223,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "foreign_nested" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestForeignNested__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[5]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } } @@ -2414,10 +2341,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "a", "bb" }; private static readonly uint[] _fieldTags = new uint[] { 8, 2147483640 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReallyLargeTagNumber__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[6]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } } @@ -2552,10 +2479,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "a", "i" }; private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRecursiveMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[7]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } } @@ -2697,10 +2624,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "bb" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionA__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[8]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } } @@ -2815,10 +2742,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "a", "optional_int32" }; private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionB__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[9]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } } @@ -2960,10 +2887,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCamelCaseFieldNames__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[10]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } } @@ -3236,10 +3163,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[11]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } } @@ -3436,10 +3363,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "bb", "oo" }; private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; } } @@ -3579,10 +3506,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "sparse_enum" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_SparseEnumMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[12]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } } @@ -3690,10 +3617,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneString__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[13]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } } @@ -3801,10 +3728,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreString__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[14]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreString__FieldAccessorTable; } } @@ -3904,10 +3831,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneBytes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[15]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } } @@ -4015,10 +3942,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreBytes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[16]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; } } @@ -4126,10 +4053,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int32Message__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[17]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; } } @@ -4237,10 +4164,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint32Message__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[18]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; } } @@ -4348,10 +4275,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int64Message__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[19]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; } } @@ -4459,10 +4386,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint64Message__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[20]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; } } @@ -4570,10 +4497,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "data" }; private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BoolMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[21]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; } } @@ -4681,10 +4608,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestOneof__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[22]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; } } @@ -4882,10 +4809,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestPackedTypes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[23]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } } @@ -5245,10 +5172,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestUnpackedTypes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[24]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } } @@ -5608,10 +5535,10 @@ namespace Google.Protobuf.TestProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[25]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } } @@ -5812,10 +5739,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { "a" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCommentInjectionMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[26]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; } } @@ -5923,10 +5850,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooRequest__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[27]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } } @@ -6007,10 +5934,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooResponse__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[28]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } } @@ -6091,10 +6018,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooClientMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[29]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; } } @@ -6175,10 +6102,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooServerMessage__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[30]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; } } @@ -6259,10 +6186,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarRequest__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[31]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } } @@ -6343,10 +6270,10 @@ namespace Google.Protobuf.TestProtos { private static readonly string[] _fieldNames = new string[] { }; private static readonly uint[] _fieldTags = new uint[] { }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarResponse__Descriptor; } + get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[32]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } } diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs index 80166a34..3be7c4a9 100644 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs +++ b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs @@ -13,50 +13,28 @@ namespace Google.Protobuf.DescriptorProtos { public static partial class DescriptorProtoFile { #region Static variables - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_DescriptorProto_ReservedRange__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_OneofDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodDescriptorProto__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FileOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MessageOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_FieldOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_EnumValueOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_ServiceOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_MethodOptions__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MessageOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FieldOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_MethodOptions__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; + internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; #endregion #region Descriptor public static pbd::FileDescriptor Descriptor { @@ -178,100 +156,75 @@ namespace Google.Protobuf.DescriptorProtos { "bWVudHMYBiADKAlCXgoTY29tLmdvb2dsZS5wcm90b2J1ZkIQRGVzY3JpcHRv", "clByb3Rvc0gBWgpkZXNjcmlwdG9yogIDR1BCqgIgR29vZ2xlLlByb3RvYnVm", "LkRlc2NyaXB0b3JQcm90b3M=")); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_google_protobuf_FileDescriptorSet__Descriptor = Descriptor.MessageTypes[0]; - internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorSet__Descriptor, - new string[] { "File", }); - internal__static_google_protobuf_FileDescriptorProto__Descriptor = Descriptor.MessageTypes[1]; - internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileDescriptorProto__Descriptor, - new string[] { "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax", }); - internal__static_google_protobuf_DescriptorProto__Descriptor = Descriptor.MessageTypes[2]; - internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto__Descriptor, - new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName", }); - internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor, - new string[] { "Start", "End", }); - internal__static_google_protobuf_DescriptorProto_ReservedRange__Descriptor = internal__static_google_protobuf_DescriptorProto__Descriptor.NestedTypes[1]; - internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_DescriptorProto_ReservedRange__Descriptor, - new string[] { "Start", "End", }); - internal__static_google_protobuf_FieldDescriptorProto__Descriptor = Descriptor.MessageTypes[3]; - internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "Options", }); - internal__static_google_protobuf_OneofDescriptorProto__Descriptor = Descriptor.MessageTypes[4]; - internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_OneofDescriptorProto__Descriptor, - new string[] { "Name", }); - internal__static_google_protobuf_EnumDescriptorProto__Descriptor = Descriptor.MessageTypes[5]; - internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumDescriptorProto__Descriptor, - new string[] { "Name", "Value", "Options", }); - internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor = Descriptor.MessageTypes[6]; - internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor, - new string[] { "Name", "Number", "Options", }); - internal__static_google_protobuf_ServiceDescriptorProto__Descriptor = Descriptor.MessageTypes[7]; - internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceDescriptorProto__Descriptor, - new string[] { "Name", "Method", "Options", }); - internal__static_google_protobuf_MethodDescriptorProto__Descriptor = Descriptor.MessageTypes[8]; - internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodDescriptorProto__Descriptor, - new string[] { "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming", }); - internal__static_google_protobuf_FileOptions__Descriptor = Descriptor.MessageTypes[9]; - internal__static_google_protobuf_FileOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FileOptions__Descriptor, - new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "UninterpretedOption", }); - internal__static_google_protobuf_MessageOptions__Descriptor = Descriptor.MessageTypes[10]; - internal__static_google_protobuf_MessageOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MessageOptions__Descriptor, - new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption", }); - internal__static_google_protobuf_FieldOptions__Descriptor = Descriptor.MessageTypes[11]; - internal__static_google_protobuf_FieldOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_FieldOptions__Descriptor, - new string[] { "Ctype", "Packed", "Jstype", "Lazy", "Deprecated", "Weak", "UninterpretedOption", }); - internal__static_google_protobuf_EnumOptions__Descriptor = Descriptor.MessageTypes[12]; - internal__static_google_protobuf_EnumOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumOptions__Descriptor, - new string[] { "AllowAlias", "Deprecated", "UninterpretedOption", }); - internal__static_google_protobuf_EnumValueOptions__Descriptor = Descriptor.MessageTypes[13]; - internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_EnumValueOptions__Descriptor, - new string[] { "Deprecated", "UninterpretedOption", }); - internal__static_google_protobuf_ServiceOptions__Descriptor = Descriptor.MessageTypes[14]; - internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_ServiceOptions__Descriptor, - new string[] { "Deprecated", "UninterpretedOption", }); - internal__static_google_protobuf_MethodOptions__Descriptor = Descriptor.MessageTypes[15]; - internal__static_google_protobuf_MethodOptions__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_MethodOptions__Descriptor, - new string[] { "Deprecated", "UninterpretedOption", }); - internal__static_google_protobuf_UninterpretedOption__Descriptor = Descriptor.MessageTypes[16]; - internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption__Descriptor, - new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }); - internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor = internal__static_google_protobuf_UninterpretedOption__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor, - new string[] { "NamePart_", "IsExtension", }); - internal__static_google_protobuf_SourceCodeInfo__Descriptor = Descriptor.MessageTypes[17]; - internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo__Descriptor, - new string[] { "Location", }); - internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor = internal__static_google_protobuf_SourceCodeInfo__Descriptor.NestedTypes[0]; - internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor, - new string[] { "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments", }); - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { - }, assigner); + }); + internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.FileDescriptorSet), descriptor.MessageTypes[0], + new string[] { "File", }); + internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.FileDescriptorProto), descriptor.MessageTypes[1], + new string[] { "Name", "Package", "Dependency", "PublicDependency", "WeakDependency", "MessageType", "EnumType", "Service", "Extension", "Options", "SourceCodeInfo", "Syntax", }); + internal__static_google_protobuf_DescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.DescriptorProto), descriptor.MessageTypes[2], + new string[] { "Name", "Field", "Extension", "NestedType", "EnumType", "ExtensionRange", "OneofDecl", "Options", "ReservedRange", "ReservedName", }); + internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ExtensionRange), descriptor.MessageTypes[2].NestedTypes[0], + new string[] { "Start", "End", }); + internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ReservedRange), descriptor.MessageTypes[2].NestedTypes[1], + new string[] { "Start", "End", }); + internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto), descriptor.MessageTypes[3], + new string[] { "Name", "Number", "Label", "Type", "TypeName", "Extendee", "DefaultValue", "OneofIndex", "Options", }); + internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.OneofDescriptorProto), descriptor.MessageTypes[4], + new string[] { "Name", }); + internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto), descriptor.MessageTypes[5], + new string[] { "Name", "Value", "Options", }); + internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.EnumValueDescriptorProto), descriptor.MessageTypes[6], + new string[] { "Name", "Number", "Options", }); + internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.ServiceDescriptorProto), descriptor.MessageTypes[7], + new string[] { "Name", "Method", "Options", }); + internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.MethodDescriptorProto), descriptor.MessageTypes[8], + new string[] { "Name", "InputType", "OutputType", "Options", "ClientStreaming", "ServerStreaming", }); + internal__static_google_protobuf_FileOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.FileOptions), descriptor.MessageTypes[9], + new string[] { "JavaPackage", "JavaOuterClassname", "JavaMultipleFiles", "JavaGenerateEqualsAndHash", "JavaStringCheckUtf8", "OptimizeFor", "GoPackage", "CcGenericServices", "JavaGenericServices", "PyGenericServices", "Deprecated", "CcEnableArenas", "ObjcClassPrefix", "CsharpNamespace", "UninterpretedOption", }); + internal__static_google_protobuf_MessageOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.MessageOptions), descriptor.MessageTypes[10], + new string[] { "MessageSetWireFormat", "NoStandardDescriptorAccessor", "Deprecated", "MapEntry", "UninterpretedOption", }); + internal__static_google_protobuf_FieldOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.FieldOptions), descriptor.MessageTypes[11], + new string[] { "Ctype", "Packed", "Jstype", "Lazy", "Deprecated", "Weak", "UninterpretedOption", }); + internal__static_google_protobuf_EnumOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.EnumOptions), descriptor.MessageTypes[12], + new string[] { "AllowAlias", "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.EnumValueOptions), descriptor.MessageTypes[13], + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_ServiceOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.ServiceOptions), descriptor.MessageTypes[14], + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_MethodOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.MethodOptions), descriptor.MessageTypes[15], + new string[] { "Deprecated", "UninterpretedOption", }); + internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.UninterpretedOption), descriptor.MessageTypes[16], + new string[] { "Name", "IdentifierValue", "PositiveIntValue", "NegativeIntValue", "DoubleValue", "StringValue", "AggregateValue", }); + internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Types.NamePart), descriptor.MessageTypes[16].NestedTypes[0], + new string[] { "NamePart_", "IsExtension", }); + internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.SourceCodeInfo), descriptor.MessageTypes[17], + new string[] { "Location", }); + internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(typeof(global::Google.Protobuf.DescriptorProtos.SourceCodeInfo.Types.Location), descriptor.MessageTypes[17].NestedTypes[0], + new string[] { "Path", "Span", "LeadingComments", "TrailingComments", "LeadingDetachedComments", }); } #endregion @@ -285,10 +238,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "file" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; } } @@ -388,10 +341,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileDescriptorProto__FieldAccessorTable; } } @@ -756,10 +709,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[2]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto__FieldAccessorTable; } } @@ -1054,10 +1007,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "end", "start" }; private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProto.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ExtensionRange__FieldAccessorTable; } } @@ -1192,10 +1145,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "end", "start" }; private static readonly uint[] _fieldTags = new uint[] { 16, 8 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ReservedRange__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProto.Descriptor.NestedTypes[1]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_DescriptorProto_ReservedRange__FieldAccessorTable; } } @@ -1335,10 +1288,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[3]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldDescriptorProto__FieldAccessorTable; } } @@ -1702,10 +1655,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "name" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_OneofDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[4]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_OneofDescriptorProto__FieldAccessorTable; } } @@ -1813,10 +1766,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "name", "options", "value" }; private static readonly uint[] _fieldTags = new uint[] { 10, 26, 18 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[5]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumDescriptorProto__FieldAccessorTable; } } @@ -1977,10 +1930,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "name", "number", "options" }; private static readonly uint[] _fieldTags = new uint[] { 10, 16, 26 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[6]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueDescriptorProto__FieldAccessorTable; } } @@ -2149,10 +2102,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "method", "name", "options" }; private static readonly uint[] _fieldTags = new uint[] { 18, 10, 26 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[7]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceDescriptorProto__FieldAccessorTable; } } @@ -2313,10 +2266,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[8]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodDescriptorProto__FieldAccessorTable; } } @@ -2566,10 +2519,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[9]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FileOptions__FieldAccessorTable; } } @@ -3059,10 +3012,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[10]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MessageOptions__FieldAccessorTable; } } @@ -3270,10 +3223,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[11]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_FieldOptions__FieldAccessorTable; } } @@ -3553,10 +3506,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "allow_alias", "deprecated", "uninterpreted_option" }; private static readonly uint[] _fieldTags = new uint[] { 16, 24, 7994 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[12]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumOptions__FieldAccessorTable; } } @@ -3710,10 +3663,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; private static readonly uint[] _fieldTags = new uint[] { 8, 7994 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[13]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_EnumValueOptions__FieldAccessorTable; } } @@ -3840,10 +3793,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; private static readonly uint[] _fieldTags = new uint[] { 264, 7994 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[14]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_ServiceOptions__FieldAccessorTable; } } @@ -3970,10 +3923,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "deprecated", "uninterpreted_option" }; private static readonly uint[] _fieldTags = new uint[] { 264, 7994 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[15]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_MethodOptions__FieldAccessorTable; } } @@ -4100,10 +4053,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[16]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption__FieldAccessorTable; } } @@ -4366,10 +4319,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "is_extension", "name_part" }; private static readonly uint[] _fieldTags = new uint[] { 16, 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_UninterpretedOption_NamePart__FieldAccessorTable; } } @@ -4509,10 +4462,10 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly string[] _fieldNames = new string[] { "location" }; private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.Descriptor.MessageTypes[17]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo__FieldAccessorTable; } } @@ -4613,10 +4566,10 @@ namespace Google.Protobuf.DescriptorProtos { 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 pbd::MessageDescriptor Descriptor { - get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__Descriptor; } + get { return global::Google.Protobuf.DescriptorProtos.SourceCodeInfo.Descriptor.NestedTypes[0]; } } - public pb::FieldAccess.FieldAccessorTable Fields { + public pb::FieldAccess.FieldAccessorTable Fields { get { return global::Google.Protobuf.DescriptorProtos.DescriptorProtoFile.internal__static_google_protobuf_SourceCodeInfo_Location__FieldAccessorTable; } } -- cgit v1.2.3 From 5350822b0a923287bc23375a10c2f3cb07cff5fb Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 1 Jul 2015 17:16:55 +0100 Subject: Regenerated code due to previous commit. Note that now we need a proto3 version of addressbook.proto. This may affect other platforms, and could do with an overhaul to follow proto3 conventions anyway (e.g. repeated field names). Will need to think about that carefully before merging into master. Raised issue #565 for this. --- csharp/src/AddressBook/Addressbook.cs | 52 ++- .../TestProtos/MapUnittestProto3.cs | 352 ++++++++++++----- .../TestProtos/UnittestImportProto3.cs | 8 +- .../TestProtos/UnittestImportPublicProto3.cs | 8 +- .../TestProtos/UnittestIssues.cs | 56 ++- .../TestProtos/UnittestProto3.cs | 280 +++++++++---- .../DescriptorProtos/DescriptorProtoFile.cs | 438 +++++++++++++-------- examples/addressbook.proto | 12 +- 8 files changed, 829 insertions(+), 377 deletions(-) (limited to 'csharp/src/ProtocolBuffers') diff --git a/csharp/src/AddressBook/Addressbook.cs b/csharp/src/AddressBook/Addressbook.cs index 0b77ebf1..5f4a5139 100644 --- a/csharp/src/AddressBook/Addressbook.cs +++ b/csharp/src/AddressBook/Addressbook.cs @@ -26,15 +26,15 @@ namespace Google.Protobuf.Examples.AddressBook { static Addressbook() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi2gEKBlBlcnNvbhIMCgRu", - "YW1lGAEgAigJEgoKAmlkGAIgAigFEg0KBWVtYWlsGAMgASgJEisKBXBob25l", - "GAQgAygLMhwudHV0b3JpYWwuUGVyc29uLlBob25lTnVtYmVyGk0KC1Bob25l", - "TnVtYmVyEg4KBm51bWJlchgBIAIoCRIuCgR0eXBlGAIgASgOMhoudHV0b3Jp", - "YWwuUGVyc29uLlBob25lVHlwZToESE9NRSIrCglQaG9uZVR5cGUSCgoGTU9C", - "SUxFEAASCAoESE9NRRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZw", - "ZXJzb24YASADKAsyEC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUu", - "dHV0b3JpYWxCEUFkZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVm", - "LkV4YW1wbGVzLkFkZHJlc3NCb29r")); + "ChFhZGRyZXNzYm9vay5wcm90bxIIdHV0b3JpYWwi1AEKBlBlcnNvbhIMCgRu", + "YW1lGAEgASgJEgoKAmlkGAIgASgFEg0KBWVtYWlsGAMgASgJEisKBXBob25l", + "GAQgAygLMhwudHV0b3JpYWwuUGVyc29uLlBob25lTnVtYmVyGkcKC1Bob25l", + "TnVtYmVyEg4KBm51bWJlchgBIAEoCRIoCgR0eXBlGAIgASgOMhoudHV0b3Jp", + "YWwuUGVyc29uLlBob25lVHlwZSIrCglQaG9uZVR5cGUSCgoGTU9CSUxFEAAS", + "CAoESE9NRRABEggKBFdPUksQAiIvCgtBZGRyZXNzQm9vaxIgCgZwZXJzb24Y", + "ASADKAsyEC50dXRvcmlhbC5QZXJzb25CUAoUY29tLmV4YW1wbGUudHV0b3Jp", + "YWxCEUFkZHJlc3NCb29rUHJvdG9zqgIkR29vZ2xlLlByb3RvYnVmLkV4YW1w", + "bGVzLkFkZHJlc3NCb29rYgZwcm90bzM=")); descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, new pbd::FileDescriptor[] { }); @@ -70,9 +70,13 @@ namespace Google.Protobuf.Examples.AddressBook { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Person() { } + public Person() { + OnConstruction(); + } + + partial void OnConstruction(); - public Person(Person other) { + public Person(Person other) : this() { name_ = other.name_; id_ = other.id_; email_ = other.email_; @@ -261,9 +265,13 @@ namespace Google.Protobuf.Examples.AddressBook { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public PhoneNumber() { } + public PhoneNumber() { + OnConstruction(); + } + + partial void OnConstruction(); - public PhoneNumber(PhoneNumber other) { + public PhoneNumber(PhoneNumber other) : this() { number_ = other.number_; type_ = other.type_; } @@ -290,7 +298,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.HOME; + private global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType type_ = global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE; public global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType Type { get { return type_; } set { @@ -318,7 +326,7 @@ namespace Google.Protobuf.Examples.AddressBook { public override int GetHashCode() { int hash = 1; if (Number.Length != 0) hash ^= Number.GetHashCode(); - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode(); + if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) hash ^= Type.GetHashCode(); return hash; } @@ -327,7 +335,7 @@ namespace Google.Protobuf.Examples.AddressBook { output.WriteRawTag(10); output.WriteString(Number); } - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { + if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) { output.WriteRawTag(16); output.WriteEnum((int) Type); } @@ -338,7 +346,7 @@ namespace Google.Protobuf.Examples.AddressBook { if (Number.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Number); } - if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { + if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); } return size; @@ -351,7 +359,7 @@ namespace Google.Protobuf.Examples.AddressBook { if (other.Number.Length != 0) { Number = other.Number; } - if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.HOME) { + if (other.Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.MOBILE) { Type = other.Type; } } @@ -404,9 +412,13 @@ namespace Google.Protobuf.Examples.AddressBook { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public AddressBook() { } + public AddressBook() { + OnConstruction(); + } + + partial void OnConstruction(); - public AddressBook(AddressBook other) { + public AddressBook(AddressBook other) : this() { person_ = other.person_.Clone(); } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs index 365c03a7..55434c53 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/MapUnittestProto3.cs @@ -359,9 +359,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestMap() { } + public TestMap() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestMap(TestMap other) { + public TestMap(TestMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); mapUint32Uint32_ = other.mapUint32Uint32_.Clone(); @@ -767,9 +771,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32Int32Entry() { } + public MapInt32Int32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32Int32Entry(MapInt32Int32Entry other) { + public MapInt32Int32Entry(MapInt32Int32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -905,9 +913,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt64Int64Entry() { } + public MapInt64Int64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt64Int64Entry(MapInt64Int64Entry other) { + public MapInt64Int64Entry(MapInt64Int64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1043,9 +1055,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapUint32Uint32Entry() { } + public MapUint32Uint32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapUint32Uint32Entry(MapUint32Uint32Entry other) { + public MapUint32Uint32Entry(MapUint32Uint32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1181,9 +1197,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapUint64Uint64Entry() { } + public MapUint64Uint64Entry() { + OnConstruction(); + } - public MapUint64Uint64Entry(MapUint64Uint64Entry other) { + partial void OnConstruction(); + + public MapUint64Uint64Entry(MapUint64Uint64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1319,9 +1339,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSint32Sint32Entry() { } + public MapSint32Sint32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSint32Sint32Entry(MapSint32Sint32Entry other) { + public MapSint32Sint32Entry(MapSint32Sint32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1457,9 +1481,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSint64Sint64Entry() { } + public MapSint64Sint64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSint64Sint64Entry(MapSint64Sint64Entry other) { + public MapSint64Sint64Entry(MapSint64Sint64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1595,9 +1623,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapFixed32Fixed32Entry() { } + public MapFixed32Fixed32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) { + public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1733,9 +1765,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapFixed64Fixed64Entry() { } + public MapFixed64Fixed64Entry() { + OnConstruction(); + } - public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) { + partial void OnConstruction(); + + public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -1871,9 +1907,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSfixed32Sfixed32Entry() { } + public MapSfixed32Sfixed32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) { + public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2009,9 +2049,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSfixed64Sfixed64Entry() { } + public MapSfixed64Sfixed64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) { + public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2147,9 +2191,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32FloatEntry() { } + public MapInt32FloatEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32FloatEntry(MapInt32FloatEntry other) { + public MapInt32FloatEntry(MapInt32FloatEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2285,9 +2333,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32DoubleEntry() { } + public MapInt32DoubleEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32DoubleEntry(MapInt32DoubleEntry other) { + public MapInt32DoubleEntry(MapInt32DoubleEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2423,9 +2475,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapBoolBoolEntry() { } + public MapBoolBoolEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapBoolBoolEntry(MapBoolBoolEntry other) { + public MapBoolBoolEntry(MapBoolBoolEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2561,9 +2617,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapStringStringEntry() { } + public MapStringStringEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapStringStringEntry(MapStringStringEntry other) { + public MapStringStringEntry(MapStringStringEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2699,9 +2759,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32BytesEntry() { } + public MapInt32BytesEntry() { + OnConstruction(); + } - public MapInt32BytesEntry(MapInt32BytesEntry other) { + partial void OnConstruction(); + + public MapInt32BytesEntry(MapInt32BytesEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2837,9 +2901,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32EnumEntry() { } + public MapInt32EnumEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32EnumEntry(MapInt32EnumEntry other) { + public MapInt32EnumEntry(MapInt32EnumEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -2975,9 +3043,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32ForeignMessageEntry() { } + public MapInt32ForeignMessageEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) { + public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) : this() { key_ = other.key_; Value = other.value_ != null ? other.Value.Clone() : null; } @@ -3125,9 +3197,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestMapSubmessage() { } + public TestMapSubmessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestMapSubmessage(TestMapSubmessage other) { + public TestMapSubmessage(TestMapSubmessage other) : this() { TestMap = other.testMap_ != null ? other.TestMap.Clone() : null; } @@ -3243,9 +3319,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestMessageMap() { } + public TestMessageMap() { + OnConstruction(); + } - public TestMessageMap(TestMessageMap other) { + partial void OnConstruction(); + + public TestMessageMap(TestMessageMap other) : this() { mapInt32Message_ = other.mapInt32Message_.Clone(); } @@ -3347,9 +3427,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32MessageEntry() { } + public MapInt32MessageEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32MessageEntry(MapInt32MessageEntry other) { + public MapInt32MessageEntry(MapInt32MessageEntry other) : this() { key_ = other.key_; Value = other.value_ != null ? other.Value.Clone() : null; } @@ -3497,9 +3581,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestSameTypeMap() { } + public TestSameTypeMap() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestSameTypeMap(TestSameTypeMap other) { + public TestSameTypeMap(TestSameTypeMap other) : this() { map1_ = other.map1_.Clone(); map2_ = other.map2_.Clone(); } @@ -3620,9 +3708,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Map1Entry() { } + public Map1Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public Map1Entry(Map1Entry other) { + public Map1Entry(Map1Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -3758,9 +3850,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Map2Entry() { } + public Map2Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public Map2Entry(Map2Entry other) { + public Map2Entry(Map2Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -3901,9 +3997,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestArenaMap() { } + public TestArenaMap() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestArenaMap(TestArenaMap other) { + public TestArenaMap(TestArenaMap other) : this() { mapInt32Int32_ = other.mapInt32Int32_.Clone(); mapInt64Int64_ = other.mapInt64Int64_.Clone(); mapUint32Uint32_ = other.mapUint32Uint32_.Clone(); @@ -4271,9 +4371,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32Int32Entry() { } + public MapInt32Int32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32Int32Entry(MapInt32Int32Entry other) { + public MapInt32Int32Entry(MapInt32Int32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -4409,9 +4513,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt64Int64Entry() { } + public MapInt64Int64Entry() { + OnConstruction(); + } - public MapInt64Int64Entry(MapInt64Int64Entry other) { + partial void OnConstruction(); + + public MapInt64Int64Entry(MapInt64Int64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -4547,9 +4655,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapUint32Uint32Entry() { } + public MapUint32Uint32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapUint32Uint32Entry(MapUint32Uint32Entry other) { + public MapUint32Uint32Entry(MapUint32Uint32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -4685,9 +4797,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapUint64Uint64Entry() { } + public MapUint64Uint64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapUint64Uint64Entry(MapUint64Uint64Entry other) { + public MapUint64Uint64Entry(MapUint64Uint64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -4823,9 +4939,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSint32Sint32Entry() { } + public MapSint32Sint32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSint32Sint32Entry(MapSint32Sint32Entry other) { + public MapSint32Sint32Entry(MapSint32Sint32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -4961,9 +5081,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSint64Sint64Entry() { } + public MapSint64Sint64Entry() { + OnConstruction(); + } - public MapSint64Sint64Entry(MapSint64Sint64Entry other) { + partial void OnConstruction(); + + public MapSint64Sint64Entry(MapSint64Sint64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5099,9 +5223,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapFixed32Fixed32Entry() { } + public MapFixed32Fixed32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) { + public MapFixed32Fixed32Entry(MapFixed32Fixed32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5237,9 +5365,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapFixed64Fixed64Entry() { } + public MapFixed64Fixed64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) { + public MapFixed64Fixed64Entry(MapFixed64Fixed64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5375,9 +5507,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSfixed32Sfixed32Entry() { } + public MapSfixed32Sfixed32Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) { + public MapSfixed32Sfixed32Entry(MapSfixed32Sfixed32Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5513,9 +5649,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapSfixed64Sfixed64Entry() { } + public MapSfixed64Sfixed64Entry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) { + public MapSfixed64Sfixed64Entry(MapSfixed64Sfixed64Entry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5651,9 +5791,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32FloatEntry() { } + public MapInt32FloatEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32FloatEntry(MapInt32FloatEntry other) { + public MapInt32FloatEntry(MapInt32FloatEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5789,9 +5933,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32DoubleEntry() { } + public MapInt32DoubleEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32DoubleEntry(MapInt32DoubleEntry other) { + public MapInt32DoubleEntry(MapInt32DoubleEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -5927,9 +6075,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapBoolBoolEntry() { } + public MapBoolBoolEntry() { + OnConstruction(); + } - public MapBoolBoolEntry(MapBoolBoolEntry other) { + partial void OnConstruction(); + + public MapBoolBoolEntry(MapBoolBoolEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -6065,9 +6217,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32EnumEntry() { } + public MapInt32EnumEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32EnumEntry(MapInt32EnumEntry other) { + public MapInt32EnumEntry(MapInt32EnumEntry other) : this() { key_ = other.key_; value_ = other.value_; } @@ -6203,9 +6359,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MapInt32ForeignMessageEntry() { } + public MapInt32ForeignMessageEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) { + public MapInt32ForeignMessageEntry(MapInt32ForeignMessageEntry other) : this() { key_ = other.key_; Value = other.value_ != null ? other.Value.Clone() : null; } @@ -6353,9 +6513,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MessageContainingEnumCalledType() { } + public MessageContainingEnumCalledType() { + OnConstruction(); + } + + partial void OnConstruction(); - public MessageContainingEnumCalledType(MessageContainingEnumCalledType other) { + public MessageContainingEnumCalledType(MessageContainingEnumCalledType other) : this() { type_ = other.type_.Clone(); } @@ -6461,9 +6625,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TypeEntry() { } + public TypeEntry() { + OnConstruction(); + } - public TypeEntry(TypeEntry other) { + partial void OnConstruction(); + + public TypeEntry(TypeEntry other) : this() { key_ = other.key_; Value = other.value_ != null ? other.Value.Clone() : null; } @@ -6611,9 +6779,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MessageContainingMapCalledEntry() { } + public MessageContainingMapCalledEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public MessageContainingMapCalledEntry(MessageContainingMapCalledEntry other) { + public MessageContainingMapCalledEntry(MessageContainingMapCalledEntry other) : this() { entry_ = other.entry_.Clone(); } @@ -6715,9 +6887,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public EntryEntry() { } + public EntryEntry() { + OnConstruction(); + } + + partial void OnConstruction(); - public EntryEntry(EntryEntry other) { + public EntryEntry(EntryEntry other) : this() { key_ = other.key_; value_ = other.value_; } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs index 5afcb4e0..d30f22db 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportProto3.cs @@ -72,9 +72,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ImportMessage() { } + public ImportMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public ImportMessage(ImportMessage other) { + public ImportMessage(ImportMessage other) : this() { d_ = other.d_; } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs index 79c0876e..5aa03a64 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestImportPublicProto3.cs @@ -57,9 +57,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public PublicImportMessage() { } + public PublicImportMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public PublicImportMessage(PublicImportMessage other) { + public PublicImportMessage(PublicImportMessage other) : this() { e_ = other.e_; } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs index 124f2de7..0e409c8b 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestIssues.cs @@ -109,9 +109,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Issue307() { } + public Issue307() { + OnConstruction(); + } + + partial void OnConstruction(); - public Issue307(Issue307 other) { + public Issue307(Issue307 other) : this() { } public Issue307 Clone() { @@ -194,9 +198,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NestedOnce() { } + public NestedOnce() { + OnConstruction(); + } + + partial void OnConstruction(); - public NestedOnce(NestedOnce other) { + public NestedOnce(NestedOnce other) : this() { } public NestedOnce Clone() { @@ -279,9 +287,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NestedTwice() { } + public NestedTwice() { + OnConstruction(); + } + + partial void OnConstruction(); - public NestedTwice(NestedTwice other) { + public NestedTwice(NestedTwice other) : this() { } public NestedTwice Clone() { @@ -373,9 +385,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NegativeEnumMessage() { } + public NegativeEnumMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public NegativeEnumMessage(NegativeEnumMessage other) { + public NegativeEnumMessage(NegativeEnumMessage other) : this() { value_ = other.value_; values_ = other.values_.Clone(); packedValues_ = other.packedValues_.Clone(); @@ -522,9 +538,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public DeprecatedChild() { } + public DeprecatedChild() { + OnConstruction(); + } + + partial void OnConstruction(); - public DeprecatedChild(DeprecatedChild other) { + public DeprecatedChild(DeprecatedChild other) : this() { } public DeprecatedChild Clone() { @@ -606,9 +626,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public DeprecatedFieldsMessage() { } + public DeprecatedFieldsMessage() { + OnConstruction(); + } - public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) { + partial void OnConstruction(); + + public DeprecatedFieldsMessage(DeprecatedFieldsMessage other) : this() { primitiveValue_ = other.primitiveValue_; primitiveArray_ = other.primitiveArray_.Clone(); MessageValue = other.messageValue_ != null ? other.MessageValue.Clone() : null; @@ -842,9 +866,13 @@ namespace UnitTest.Issues.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ItemField() { } + public ItemField() { + OnConstruction(); + } + + partial void OnConstruction(); - public ItemField(ItemField other) { + public ItemField(ItemField other) : this() { item_ = other.item_; } diff --git a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs index c9aed740..d2437bf4 100644 --- a/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/ProtocolBuffers.Test/TestProtos/UnittestProto3.cs @@ -346,9 +346,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestAllTypes() { } + public TestAllTypes() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestAllTypes(TestAllTypes other) { + public TestAllTypes(TestAllTypes other) : this() { singleInt32_ = other.singleInt32_; singleInt64_ = other.singleInt64_; singleUint32_ = other.singleUint32_; @@ -1639,9 +1643,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NestedMessage() { } + public NestedMessage() { + OnConstruction(); + } - public NestedMessage(NestedMessage other) { + partial void OnConstruction(); + + public NestedMessage(NestedMessage other) : this() { bb_ = other.bb_; } @@ -1755,9 +1763,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NestedTestAllTypes() { } + public NestedTestAllTypes() { + OnConstruction(); + } - public NestedTestAllTypes(NestedTestAllTypes other) { + partial void OnConstruction(); + + public NestedTestAllTypes(NestedTestAllTypes other) : this() { Child = other.child_ != null ? other.Child.Clone() : null; Payload = other.payload_ != null ? other.Payload.Clone() : null; repeatedChild_ = other.repeatedChild_.Clone(); @@ -1926,9 +1938,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestDeprecatedFields() { } + public TestDeprecatedFields() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestDeprecatedFields(TestDeprecatedFields other) { + public TestDeprecatedFields(TestDeprecatedFields other) : this() { deprecatedInt32_ = other.deprecatedInt32_; } @@ -2038,9 +2054,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ForeignMessage() { } + public ForeignMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public ForeignMessage(ForeignMessage other) { + public ForeignMessage(ForeignMessage other) : this() { c_ = other.c_; } @@ -2149,9 +2169,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestReservedFields() { } + public TestReservedFields() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestReservedFields(TestReservedFields other) { + public TestReservedFields(TestReservedFields other) : this() { } public TestReservedFields Clone() { @@ -2233,9 +2257,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestForeignNested() { } + public TestForeignNested() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestForeignNested(TestForeignNested other) { + public TestForeignNested(TestForeignNested other) : this() { ForeignNested = other.foreignNested_ != null ? other.ForeignNested.Clone() : null; } @@ -2351,9 +2379,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestReallyLargeTagNumber() { } + public TestReallyLargeTagNumber() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) { + public TestReallyLargeTagNumber(TestReallyLargeTagNumber other) : this() { a_ = other.a_; bb_ = other.bb_; } @@ -2489,9 +2521,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestRecursiveMessage() { } + public TestRecursiveMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestRecursiveMessage(TestRecursiveMessage other) { + public TestRecursiveMessage(TestRecursiveMessage other) : this() { A = other.a_ != null ? other.A.Clone() : null; i_ = other.i_; } @@ -2634,9 +2670,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestMutualRecursionA() { } + public TestMutualRecursionA() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestMutualRecursionA(TestMutualRecursionA other) { + public TestMutualRecursionA(TestMutualRecursionA other) : this() { Bb = other.bb_ != null ? other.Bb.Clone() : null; } @@ -2752,9 +2792,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestMutualRecursionB() { } + public TestMutualRecursionB() { + OnConstruction(); + } - public TestMutualRecursionB(TestMutualRecursionB other) { + partial void OnConstruction(); + + public TestMutualRecursionB(TestMutualRecursionB other) : this() { A = other.a_ != null ? other.A.Clone() : null; optionalInt32_ = other.optionalInt32_; } @@ -2897,9 +2941,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestCamelCaseFieldNames() { } + public TestCamelCaseFieldNames() { + OnConstruction(); + } - public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) { + partial void OnConstruction(); + + public TestCamelCaseFieldNames(TestCamelCaseFieldNames other) : this() { primitiveField_ = other.primitiveField_; stringField_ = other.stringField_; enumField_ = other.enumField_; @@ -3173,9 +3221,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestFieldOrderings() { } + public TestFieldOrderings() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestFieldOrderings(TestFieldOrderings other) { + public TestFieldOrderings(TestFieldOrderings other) : this() { myString_ = other.myString_; myInt_ = other.myInt_; myFloat_ = other.myFloat_; @@ -3373,9 +3425,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NestedMessage() { } + public NestedMessage() { + OnConstruction(); + } - public NestedMessage(NestedMessage other) { + partial void OnConstruction(); + + public NestedMessage(NestedMessage other) : this() { oo_ = other.oo_; bb_ = other.bb_; } @@ -3516,9 +3572,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public SparseEnumMessage() { } + public SparseEnumMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public SparseEnumMessage(SparseEnumMessage other) { + public SparseEnumMessage(SparseEnumMessage other) : this() { sparseEnum_ = other.sparseEnum_; } @@ -3627,9 +3687,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public OneString() { } + public OneString() { + OnConstruction(); + } + + partial void OnConstruction(); - public OneString(OneString other) { + public OneString(OneString other) : this() { data_ = other.data_; } @@ -3738,9 +3802,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MoreString() { } + public MoreString() { + OnConstruction(); + } + + partial void OnConstruction(); - public MoreString(MoreString other) { + public MoreString(MoreString other) : this() { data_ = other.data_.Clone(); } @@ -3841,9 +3909,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public OneBytes() { } + public OneBytes() { + OnConstruction(); + } + + partial void OnConstruction(); - public OneBytes(OneBytes other) { + public OneBytes(OneBytes other) : this() { data_ = other.data_; } @@ -3952,9 +4024,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MoreBytes() { } + public MoreBytes() { + OnConstruction(); + } + + partial void OnConstruction(); - public MoreBytes(MoreBytes other) { + public MoreBytes(MoreBytes other) : this() { data_ = other.data_; } @@ -4063,9 +4139,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Int32Message() { } + public Int32Message() { + OnConstruction(); + } + + partial void OnConstruction(); - public Int32Message(Int32Message other) { + public Int32Message(Int32Message other) : this() { data_ = other.data_; } @@ -4174,9 +4254,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Uint32Message() { } + public Uint32Message() { + OnConstruction(); + } + + partial void OnConstruction(); - public Uint32Message(Uint32Message other) { + public Uint32Message(Uint32Message other) : this() { data_ = other.data_; } @@ -4285,9 +4369,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Int64Message() { } + public Int64Message() { + OnConstruction(); + } + + partial void OnConstruction(); - public Int64Message(Int64Message other) { + public Int64Message(Int64Message other) : this() { data_ = other.data_; } @@ -4396,9 +4484,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Uint64Message() { } + public Uint64Message() { + OnConstruction(); + } + + partial void OnConstruction(); - public Uint64Message(Uint64Message other) { + public Uint64Message(Uint64Message other) : this() { data_ = other.data_; } @@ -4507,9 +4599,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public BoolMessage() { } + public BoolMessage() { + OnConstruction(); + } - public BoolMessage(BoolMessage other) { + partial void OnConstruction(); + + public BoolMessage(BoolMessage other) : this() { data_ = other.data_; } @@ -4618,9 +4714,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestOneof() { } + public TestOneof() { + OnConstruction(); + } - public TestOneof(TestOneof other) { + partial void OnConstruction(); + + public TestOneof(TestOneof other) : this() { switch (other.FooCase) { case FooOneofCase.FooInt: FooInt = other.FooInt; @@ -4819,9 +4919,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestPackedTypes() { } + public TestPackedTypes() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestPackedTypes(TestPackedTypes other) { + public TestPackedTypes(TestPackedTypes other) : this() { packedInt32_ = other.packedInt32_.Clone(); packedInt64_ = other.packedInt64_.Clone(); packedUint32_ = other.packedUint32_.Clone(); @@ -5182,9 +5286,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestUnpackedTypes() { } + public TestUnpackedTypes() { + OnConstruction(); + } - public TestUnpackedTypes(TestUnpackedTypes other) { + partial void OnConstruction(); + + public TestUnpackedTypes(TestUnpackedTypes other) : this() { unpackedInt32_ = other.unpackedInt32_.Clone(); unpackedInt64_ = other.unpackedInt64_.Clone(); unpackedUint32_ = other.unpackedUint32_.Clone(); @@ -5545,9 +5653,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestRepeatedScalarDifferentTagSizes() { } + public TestRepeatedScalarDifferentTagSizes() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) { + public TestRepeatedScalarDifferentTagSizes(TestRepeatedScalarDifferentTagSizes other) : this() { repeatedFixed32_ = other.repeatedFixed32_.Clone(); repeatedInt32_ = other.repeatedInt32_.Clone(); repeatedFixed64_ = other.repeatedFixed64_.Clone(); @@ -5749,9 +5861,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public TestCommentInjectionMessage() { } + public TestCommentInjectionMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public TestCommentInjectionMessage(TestCommentInjectionMessage other) { + public TestCommentInjectionMessage(TestCommentInjectionMessage other) : this() { a_ = other.a_; } @@ -5860,9 +5976,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FooRequest() { } + public FooRequest() { + OnConstruction(); + } + + partial void OnConstruction(); - public FooRequest(FooRequest other) { + public FooRequest(FooRequest other) : this() { } public FooRequest Clone() { @@ -5944,9 +6064,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FooResponse() { } + public FooResponse() { + OnConstruction(); + } + + partial void OnConstruction(); - public FooResponse(FooResponse other) { + public FooResponse(FooResponse other) : this() { } public FooResponse Clone() { @@ -6028,9 +6152,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FooClientMessage() { } + public FooClientMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public FooClientMessage(FooClientMessage other) { + public FooClientMessage(FooClientMessage other) : this() { } public FooClientMessage Clone() { @@ -6112,9 +6240,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FooServerMessage() { } + public FooServerMessage() { + OnConstruction(); + } + + partial void OnConstruction(); - public FooServerMessage(FooServerMessage other) { + public FooServerMessage(FooServerMessage other) : this() { } public FooServerMessage Clone() { @@ -6196,9 +6328,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public BarRequest() { } + public BarRequest() { + OnConstruction(); + } + + partial void OnConstruction(); - public BarRequest(BarRequest other) { + public BarRequest(BarRequest other) : this() { } public BarRequest Clone() { @@ -6280,9 +6416,13 @@ namespace Google.Protobuf.TestProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public BarResponse() { } + public BarResponse() { + OnConstruction(); + } + + partial void OnConstruction(); - public BarResponse(BarResponse other) { + public BarResponse(BarResponse other) : this() { } public BarResponse Clone() { diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs index 3be7c4a9..c87b367a 100644 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs +++ b/csharp/src/ProtocolBuffers/DescriptorProtos/DescriptorProtoFile.cs @@ -10,7 +10,7 @@ using scg = global::System.Collections.Generic; namespace Google.Protobuf.DescriptorProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static partial class DescriptorProtoFile { + internal static partial class DescriptorProtoFile { #region Static variables internal static pb::FieldAccess.FieldAccessorTable internal__static_google_protobuf_FileDescriptorSet__FieldAccessorTable; @@ -231,7 +231,7 @@ namespace Google.Protobuf.DescriptorProtos { } #region Messages [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorSet : pb::IMessage { + internal sealed partial class FileDescriptorSet : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorSet()); public static pb::MessageParser Parser { get { return _parser; } } @@ -248,9 +248,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FileDescriptorSet() { } + public FileDescriptorSet() { + OnConstruction(); + } + + partial void OnConstruction(); - public FileDescriptorSet(FileDescriptorSet other) { + public FileDescriptorSet(FileDescriptorSet other) : this() { file_ = other.file_.Clone(); } @@ -270,7 +274,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_file_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.DescriptorProtos.FileDescriptorProto.Parser); private readonly pbc::RepeatedField file_ = new pbc::RepeatedField(); - public pbc::RepeatedField File { + internal pbc::RepeatedField File { get { return file_; } } @@ -334,7 +338,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileDescriptorProto : pb::IMessage { + internal sealed partial class FileDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -351,9 +355,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FileDescriptorProto() { } + public FileDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public FileDescriptorProto(FileDescriptorProto other) { + public FileDescriptorProto(FileDescriptorProto other) : this() { name_ = other.name_; package_ = other.package_; dependency_ = other.dependency_.Clone(); @@ -390,7 +398,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -400,7 +408,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int PackageFieldNumber = 2; private string package_ = ""; - public string Package { + internal string Package { get { return package_; } set { pb::Freezable.CheckMutable(this); @@ -412,7 +420,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_dependency_codec = pb::FieldCodec.ForString(26); private readonly pbc::RepeatedField dependency_ = new pbc::RepeatedField(); - public pbc::RepeatedField Dependency { + internal pbc::RepeatedField Dependency { get { return dependency_; } } @@ -420,7 +428,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_publicDependency_codec = pb::FieldCodec.ForInt32(80); private readonly pbc::RepeatedField publicDependency_ = new pbc::RepeatedField(); - public pbc::RepeatedField PublicDependency { + internal pbc::RepeatedField PublicDependency { get { return publicDependency_; } } @@ -428,7 +436,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_weakDependency_codec = pb::FieldCodec.ForInt32(88); private readonly pbc::RepeatedField weakDependency_ = new pbc::RepeatedField(); - public pbc::RepeatedField WeakDependency { + internal pbc::RepeatedField WeakDependency { get { return weakDependency_; } } @@ -436,7 +444,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_messageType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.DescriptorProtos.DescriptorProto.Parser); private readonly pbc::RepeatedField messageType_ = new pbc::RepeatedField(); - public pbc::RepeatedField MessageType { + internal pbc::RepeatedField MessageType { get { return messageType_; } } @@ -444,7 +452,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - public pbc::RepeatedField EnumType { + internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -452,7 +460,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_service_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.DescriptorProtos.ServiceDescriptorProto.Parser); private readonly pbc::RepeatedField service_ = new pbc::RepeatedField(); - public pbc::RepeatedField Service { + internal pbc::RepeatedField Service { get { return service_; } } @@ -460,13 +468,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(58, global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - public pbc::RepeatedField Extension { + internal pbc::RepeatedField Extension { get { return extension_; } } public const int OptionsFieldNumber = 8; private global::Google.Protobuf.DescriptorProtos.FileOptions options_; - public global::Google.Protobuf.DescriptorProtos.FileOptions Options { + internal global::Google.Protobuf.DescriptorProtos.FileOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -476,7 +484,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int SourceCodeInfoFieldNumber = 9; private global::Google.Protobuf.DescriptorProtos.SourceCodeInfo sourceCodeInfo_; - public global::Google.Protobuf.DescriptorProtos.SourceCodeInfo SourceCodeInfo { + internal global::Google.Protobuf.DescriptorProtos.SourceCodeInfo SourceCodeInfo { get { return sourceCodeInfo_; } set { pb::Freezable.CheckMutable(this); @@ -486,7 +494,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int SyntaxFieldNumber = 12; private string syntax_ = ""; - public string Syntax { + internal string Syntax { get { return syntax_; } set { pb::Freezable.CheckMutable(this); @@ -702,7 +710,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class DescriptorProto : pb::IMessage { + internal sealed partial class DescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -719,9 +727,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public DescriptorProto() { } + public DescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public DescriptorProto(DescriptorProto other) { + public DescriptorProto(DescriptorProto other) : this() { name_ = other.name_; field_ = other.field_.Clone(); extension_ = other.extension_.Clone(); @@ -756,7 +768,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -768,7 +780,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_field_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField field_ = new pbc::RepeatedField(); - public pbc::RepeatedField Field { + internal pbc::RepeatedField Field { get { return field_; } } @@ -776,7 +788,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_extension_codec = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Parser); private readonly pbc::RepeatedField extension_ = new pbc::RepeatedField(); - public pbc::RepeatedField Extension { + internal pbc::RepeatedField Extension { get { return extension_; } } @@ -784,7 +796,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_nestedType_codec = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.DescriptorProtos.DescriptorProto.Parser); private readonly pbc::RepeatedField nestedType_ = new pbc::RepeatedField(); - public pbc::RepeatedField NestedType { + internal pbc::RepeatedField NestedType { get { return nestedType_; } } @@ -792,7 +804,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_enumType_codec = pb::FieldCodec.ForMessage(34, global::Google.Protobuf.DescriptorProtos.EnumDescriptorProto.Parser); private readonly pbc::RepeatedField enumType_ = new pbc::RepeatedField(); - public pbc::RepeatedField EnumType { + internal pbc::RepeatedField EnumType { get { return enumType_; } } @@ -800,7 +812,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_extensionRange_codec = pb::FieldCodec.ForMessage(42, global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ExtensionRange.Parser); private readonly pbc::RepeatedField extensionRange_ = new pbc::RepeatedField(); - public pbc::RepeatedField ExtensionRange { + internal pbc::RepeatedField ExtensionRange { get { return extensionRange_; } } @@ -808,13 +820,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_oneofDecl_codec = pb::FieldCodec.ForMessage(66, global::Google.Protobuf.DescriptorProtos.OneofDescriptorProto.Parser); private readonly pbc::RepeatedField oneofDecl_ = new pbc::RepeatedField(); - public pbc::RepeatedField OneofDecl { + internal pbc::RepeatedField OneofDecl { get { return oneofDecl_; } } public const int OptionsFieldNumber = 7; private global::Google.Protobuf.DescriptorProtos.MessageOptions options_; - public global::Google.Protobuf.DescriptorProtos.MessageOptions Options { + internal global::Google.Protobuf.DescriptorProtos.MessageOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -826,7 +838,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_reservedRange_codec = pb::FieldCodec.ForMessage(74, global::Google.Protobuf.DescriptorProtos.DescriptorProto.Types.ReservedRange.Parser); private readonly pbc::RepeatedField reservedRange_ = new pbc::RepeatedField(); - public pbc::RepeatedField ReservedRange { + internal pbc::RepeatedField ReservedRange { get { return reservedRange_; } } @@ -834,7 +846,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_reservedName_codec = pb::FieldCodec.ForString(82); private readonly pbc::RepeatedField reservedName_ = new pbc::RepeatedField(); - public pbc::RepeatedField ReservedName { + internal pbc::RepeatedField ReservedName { get { return reservedName_; } } @@ -1000,7 +1012,7 @@ namespace Google.Protobuf.DescriptorProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ExtensionRange : pb::IMessage { + internal sealed partial class ExtensionRange : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExtensionRange()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1017,9 +1029,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ExtensionRange() { } + public ExtensionRange() { + OnConstruction(); + } + + partial void OnConstruction(); - public ExtensionRange(ExtensionRange other) { + public ExtensionRange(ExtensionRange other) : this() { start_ = other.start_; end_ = other.end_; } @@ -1037,7 +1053,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int StartFieldNumber = 1; private int start_; - public int Start { + internal int Start { get { return start_; } set { pb::Freezable.CheckMutable(this); @@ -1047,7 +1063,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int EndFieldNumber = 2; private int end_; - public int End { + internal int End { get { return end_; } set { pb::Freezable.CheckMutable(this); @@ -1138,7 +1154,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ReservedRange : pb::IMessage { + internal sealed partial class ReservedRange : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReservedRange()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1155,9 +1171,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ReservedRange() { } + public ReservedRange() { + OnConstruction(); + } - public ReservedRange(ReservedRange other) { + partial void OnConstruction(); + + public ReservedRange(ReservedRange other) : this() { start_ = other.start_; end_ = other.end_; } @@ -1175,7 +1195,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int StartFieldNumber = 1; private int start_; - public int Start { + internal int Start { get { return start_; } set { pb::Freezable.CheckMutable(this); @@ -1185,7 +1205,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int EndFieldNumber = 2; private int end_; - public int End { + internal int End { get { return end_; } set { pb::Freezable.CheckMutable(this); @@ -1281,7 +1301,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldDescriptorProto : pb::IMessage { + internal sealed partial class FieldDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1298,9 +1318,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FieldDescriptorProto() { } + public FieldDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public FieldDescriptorProto(FieldDescriptorProto other) { + public FieldDescriptorProto(FieldDescriptorProto other) : this() { name_ = other.name_; number_ = other.number_; label_ = other.label_; @@ -1326,7 +1350,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -1336,7 +1360,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NumberFieldNumber = 3; private int number_; - public int Number { + internal int Number { get { return number_; } set { pb::Freezable.CheckMutable(this); @@ -1346,7 +1370,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int LabelFieldNumber = 4; private global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label label_ = global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label.LABEL_OPTIONAL; - public global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label Label { + internal global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Label Label { get { return label_; } set { pb::Freezable.CheckMutable(this); @@ -1356,7 +1380,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int TypeFieldNumber = 5; private global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type type_ = global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type.TYPE_DOUBLE; - public global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type Type { + internal global::Google.Protobuf.DescriptorProtos.FieldDescriptorProto.Types.Type Type { get { return type_; } set { pb::Freezable.CheckMutable(this); @@ -1366,7 +1390,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int TypeNameFieldNumber = 6; private string typeName_ = ""; - public string TypeName { + internal string TypeName { get { return typeName_; } set { pb::Freezable.CheckMutable(this); @@ -1376,7 +1400,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int ExtendeeFieldNumber = 2; private string extendee_ = ""; - public string Extendee { + internal string Extendee { get { return extendee_; } set { pb::Freezable.CheckMutable(this); @@ -1386,7 +1410,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DefaultValueFieldNumber = 7; private string defaultValue_ = ""; - public string DefaultValue { + internal string DefaultValue { get { return defaultValue_; } set { pb::Freezable.CheckMutable(this); @@ -1396,7 +1420,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OneofIndexFieldNumber = 9; private int oneofIndex_; - public int OneofIndex { + internal int OneofIndex { get { return oneofIndex_; } set { pb::Freezable.CheckMutable(this); @@ -1406,7 +1430,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OptionsFieldNumber = 8; private global::Google.Protobuf.DescriptorProtos.FieldOptions options_; - public global::Google.Protobuf.DescriptorProtos.FieldOptions Options { + internal global::Google.Protobuf.DescriptorProtos.FieldOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -1615,7 +1639,7 @@ namespace Google.Protobuf.DescriptorProtos { #region Nested types [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { - public enum Type { + internal enum Type { TYPE_DOUBLE = 1, TYPE_FLOAT = 2, TYPE_INT64 = 3, @@ -1636,7 +1660,7 @@ namespace Google.Protobuf.DescriptorProtos { TYPE_SINT64 = 18, } - public enum Label { + internal enum Label { LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, LABEL_REPEATED = 3, @@ -1648,7 +1672,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class OneofDescriptorProto : pb::IMessage { + internal sealed partial class OneofDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new OneofDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1665,9 +1689,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public OneofDescriptorProto() { } + public OneofDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public OneofDescriptorProto(OneofDescriptorProto other) { + public OneofDescriptorProto(OneofDescriptorProto other) : this() { name_ = other.name_; } @@ -1684,7 +1712,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -1759,7 +1787,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumDescriptorProto : pb::IMessage { + internal sealed partial class EnumDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1776,9 +1804,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public EnumDescriptorProto() { } + public EnumDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public EnumDescriptorProto(EnumDescriptorProto other) { + public EnumDescriptorProto(EnumDescriptorProto other) : this() { name_ = other.name_; value_ = other.value_.Clone(); Options = other.options_ != null ? other.Options.Clone() : null; @@ -1799,7 +1831,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -1811,13 +1843,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_value_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.DescriptorProtos.EnumValueDescriptorProto.Parser); private readonly pbc::RepeatedField value_ = new pbc::RepeatedField(); - public pbc::RepeatedField Value { + internal pbc::RepeatedField Value { get { return value_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.DescriptorProtos.EnumOptions options_; - public global::Google.Protobuf.DescriptorProtos.EnumOptions Options { + internal global::Google.Protobuf.DescriptorProtos.EnumOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -1923,7 +1955,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueDescriptorProto : pb::IMessage { + internal sealed partial class EnumValueDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -1940,9 +1972,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public EnumValueDescriptorProto() { } + public EnumValueDescriptorProto() { + OnConstruction(); + } - public EnumValueDescriptorProto(EnumValueDescriptorProto other) { + partial void OnConstruction(); + + public EnumValueDescriptorProto(EnumValueDescriptorProto other) : this() { name_ = other.name_; number_ = other.number_; Options = other.options_ != null ? other.Options.Clone() : null; @@ -1962,7 +1998,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -1972,7 +2008,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NumberFieldNumber = 2; private int number_; - public int Number { + internal int Number { get { return number_; } set { pb::Freezable.CheckMutable(this); @@ -1982,7 +2018,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OptionsFieldNumber = 3; private global::Google.Protobuf.DescriptorProtos.EnumValueOptions options_; - public global::Google.Protobuf.DescriptorProtos.EnumValueOptions Options { + internal global::Google.Protobuf.DescriptorProtos.EnumValueOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -2095,7 +2131,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceDescriptorProto : pb::IMessage { + internal sealed partial class ServiceDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -2112,9 +2148,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ServiceDescriptorProto() { } + public ServiceDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public ServiceDescriptorProto(ServiceDescriptorProto other) { + public ServiceDescriptorProto(ServiceDescriptorProto other) : this() { name_ = other.name_; method_ = other.method_.Clone(); Options = other.options_ != null ? other.Options.Clone() : null; @@ -2135,7 +2175,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -2147,13 +2187,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_method_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.DescriptorProtos.MethodDescriptorProto.Parser); private readonly pbc::RepeatedField method_ = new pbc::RepeatedField(); - public pbc::RepeatedField Method { + internal pbc::RepeatedField Method { get { return method_; } } public const int OptionsFieldNumber = 3; private global::Google.Protobuf.DescriptorProtos.ServiceOptions options_; - public global::Google.Protobuf.DescriptorProtos.ServiceOptions Options { + internal global::Google.Protobuf.DescriptorProtos.ServiceOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -2259,7 +2299,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodDescriptorProto : pb::IMessage { + internal sealed partial class MethodDescriptorProto : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodDescriptorProto()); public static pb::MessageParser Parser { get { return _parser; } } @@ -2276,9 +2316,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MethodDescriptorProto() { } + public MethodDescriptorProto() { + OnConstruction(); + } + + partial void OnConstruction(); - public MethodDescriptorProto(MethodDescriptorProto other) { + public MethodDescriptorProto(MethodDescriptorProto other) : this() { name_ = other.name_; inputType_ = other.inputType_; outputType_ = other.outputType_; @@ -2301,7 +2345,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NameFieldNumber = 1; private string name_ = ""; - public string Name { + internal string Name { get { return name_; } set { pb::Freezable.CheckMutable(this); @@ -2311,7 +2355,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int InputTypeFieldNumber = 2; private string inputType_ = ""; - public string InputType { + internal string InputType { get { return inputType_; } set { pb::Freezable.CheckMutable(this); @@ -2321,7 +2365,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OutputTypeFieldNumber = 3; private string outputType_ = ""; - public string OutputType { + internal string OutputType { get { return outputType_; } set { pb::Freezable.CheckMutable(this); @@ -2331,7 +2375,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OptionsFieldNumber = 4; private global::Google.Protobuf.DescriptorProtos.MethodOptions options_; - public global::Google.Protobuf.DescriptorProtos.MethodOptions Options { + internal global::Google.Protobuf.DescriptorProtos.MethodOptions Options { get { return options_; } set { pb::Freezable.CheckMutable(this); @@ -2341,7 +2385,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int ClientStreamingFieldNumber = 5; private bool clientStreaming_; - public bool ClientStreaming { + internal bool ClientStreaming { get { return clientStreaming_; } set { pb::Freezable.CheckMutable(this); @@ -2351,7 +2395,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int ServerStreamingFieldNumber = 6; private bool serverStreaming_; - public bool ServerStreaming { + internal bool ServerStreaming { get { return serverStreaming_; } set { pb::Freezable.CheckMutable(this); @@ -2512,7 +2556,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FileOptions : pb::IMessage { + internal sealed partial class FileOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FileOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -2529,9 +2573,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FileOptions() { } + public FileOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public FileOptions(FileOptions other) { + public FileOptions(FileOptions other) : this() { javaPackage_ = other.javaPackage_; javaOuterClassname_ = other.javaOuterClassname_; javaMultipleFiles_ = other.javaMultipleFiles_; @@ -2563,7 +2611,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaPackageFieldNumber = 1; private string javaPackage_ = ""; - public string JavaPackage { + internal string JavaPackage { get { return javaPackage_; } set { pb::Freezable.CheckMutable(this); @@ -2573,7 +2621,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaOuterClassnameFieldNumber = 8; private string javaOuterClassname_ = ""; - public string JavaOuterClassname { + internal string JavaOuterClassname { get { return javaOuterClassname_; } set { pb::Freezable.CheckMutable(this); @@ -2583,7 +2631,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaMultipleFilesFieldNumber = 10; private bool javaMultipleFiles_; - public bool JavaMultipleFiles { + internal bool JavaMultipleFiles { get { return javaMultipleFiles_; } set { pb::Freezable.CheckMutable(this); @@ -2593,7 +2641,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaGenerateEqualsAndHashFieldNumber = 20; private bool javaGenerateEqualsAndHash_; - public bool JavaGenerateEqualsAndHash { + internal bool JavaGenerateEqualsAndHash { get { return javaGenerateEqualsAndHash_; } set { pb::Freezable.CheckMutable(this); @@ -2603,7 +2651,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaStringCheckUtf8FieldNumber = 27; private bool javaStringCheckUtf8_; - public bool JavaStringCheckUtf8 { + internal bool JavaStringCheckUtf8 { get { return javaStringCheckUtf8_; } set { pb::Freezable.CheckMutable(this); @@ -2613,7 +2661,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int OptimizeForFieldNumber = 9; private global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode optimizeFor_ = global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode.SPEED; - public global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { + internal global::Google.Protobuf.DescriptorProtos.FileOptions.Types.OptimizeMode OptimizeFor { get { return optimizeFor_; } set { pb::Freezable.CheckMutable(this); @@ -2623,7 +2671,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int GoPackageFieldNumber = 11; private string goPackage_ = ""; - public string GoPackage { + internal string GoPackage { get { return goPackage_; } set { pb::Freezable.CheckMutable(this); @@ -2633,7 +2681,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int CcGenericServicesFieldNumber = 16; private bool ccGenericServices_; - public bool CcGenericServices { + internal bool CcGenericServices { get { return ccGenericServices_; } set { pb::Freezable.CheckMutable(this); @@ -2643,7 +2691,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JavaGenericServicesFieldNumber = 17; private bool javaGenericServices_; - public bool JavaGenericServices { + internal bool JavaGenericServices { get { return javaGenericServices_; } set { pb::Freezable.CheckMutable(this); @@ -2653,7 +2701,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int PyGenericServicesFieldNumber = 18; private bool pyGenericServices_; - public bool PyGenericServices { + internal bool PyGenericServices { get { return pyGenericServices_; } set { pb::Freezable.CheckMutable(this); @@ -2663,7 +2711,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 23; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -2673,7 +2721,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int CcEnableArenasFieldNumber = 31; private bool ccEnableArenas_; - public bool CcEnableArenas { + internal bool CcEnableArenas { get { return ccEnableArenas_; } set { pb::Freezable.CheckMutable(this); @@ -2683,7 +2731,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int ObjcClassPrefixFieldNumber = 36; private string objcClassPrefix_ = ""; - public string ObjcClassPrefix { + internal string ObjcClassPrefix { get { return objcClassPrefix_; } set { pb::Freezable.CheckMutable(this); @@ -2693,7 +2741,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int CsharpNamespaceFieldNumber = 37; private string csharpNamespace_ = ""; - public string CsharpNamespace { + internal string CsharpNamespace { get { return csharpNamespace_; } set { pb::Freezable.CheckMutable(this); @@ -2705,7 +2753,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -2993,7 +3041,7 @@ namespace Google.Protobuf.DescriptorProtos { #region Nested types [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { - public enum OptimizeMode { + internal enum OptimizeMode { SPEED = 1, CODE_SIZE = 2, LITE_RUNTIME = 3, @@ -3005,7 +3053,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MessageOptions : pb::IMessage { + internal sealed partial class MessageOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MessageOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3022,9 +3070,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MessageOptions() { } + public MessageOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public MessageOptions(MessageOptions other) { + public MessageOptions(MessageOptions other) : this() { messageSetWireFormat_ = other.messageSetWireFormat_; noStandardDescriptorAccessor_ = other.noStandardDescriptorAccessor_; deprecated_ = other.deprecated_; @@ -3046,7 +3098,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int MessageSetWireFormatFieldNumber = 1; private bool messageSetWireFormat_; - public bool MessageSetWireFormat { + internal bool MessageSetWireFormat { get { return messageSetWireFormat_; } set { pb::Freezable.CheckMutable(this); @@ -3056,7 +3108,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NoStandardDescriptorAccessorFieldNumber = 2; private bool noStandardDescriptorAccessor_; - public bool NoStandardDescriptorAccessor { + internal bool NoStandardDescriptorAccessor { get { return noStandardDescriptorAccessor_; } set { pb::Freezable.CheckMutable(this); @@ -3066,7 +3118,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3076,7 +3128,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int MapEntryFieldNumber = 7; private bool mapEntry_; - public bool MapEntry { + internal bool MapEntry { get { return mapEntry_; } set { pb::Freezable.CheckMutable(this); @@ -3088,7 +3140,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3216,7 +3268,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class FieldOptions : pb::IMessage { + internal sealed partial class FieldOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FieldOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3233,9 +3285,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public FieldOptions() { } + public FieldOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public FieldOptions(FieldOptions other) { + public FieldOptions(FieldOptions other) : this() { ctype_ = other.ctype_; packed_ = other.packed_; jstype_ = other.jstype_; @@ -3259,7 +3315,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int CtypeFieldNumber = 1; private global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType ctype_ = global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType.STRING; - public global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType Ctype { + internal global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.CType Ctype { get { return ctype_; } set { pb::Freezable.CheckMutable(this); @@ -3269,7 +3325,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int PackedFieldNumber = 2; private bool packed_; - public bool Packed { + internal bool Packed { get { return packed_; } set { pb::Freezable.CheckMutable(this); @@ -3279,7 +3335,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int JstypeFieldNumber = 6; private global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.JSType jstype_ = global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.JSType.JS_NORMAL; - public global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.JSType Jstype { + internal global::Google.Protobuf.DescriptorProtos.FieldOptions.Types.JSType Jstype { get { return jstype_; } set { pb::Freezable.CheckMutable(this); @@ -3289,7 +3345,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int LazyFieldNumber = 5; private bool lazy_; - public bool Lazy { + internal bool Lazy { get { return lazy_; } set { pb::Freezable.CheckMutable(this); @@ -3299,7 +3355,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3309,7 +3365,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int WeakFieldNumber = 10; private bool weak_; - public bool Weak { + internal bool Weak { get { return weak_; } set { pb::Freezable.CheckMutable(this); @@ -3321,7 +3377,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3481,13 +3537,13 @@ namespace Google.Protobuf.DescriptorProtos { #region Nested types [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { - public enum CType { + internal enum CType { STRING = 0, CORD = 1, STRING_PIECE = 2, } - public enum JSType { + internal enum JSType { JS_NORMAL = 0, JS_STRING = 1, JS_NUMBER = 2, @@ -3499,7 +3555,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumOptions : pb::IMessage { + internal sealed partial class EnumOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3516,9 +3572,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public EnumOptions() { } + public EnumOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public EnumOptions(EnumOptions other) { + public EnumOptions(EnumOptions other) : this() { allowAlias_ = other.allowAlias_; deprecated_ = other.deprecated_; uninterpretedOption_ = other.uninterpretedOption_.Clone(); @@ -3538,7 +3598,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int AllowAliasFieldNumber = 2; private bool allowAlias_; - public bool AllowAlias { + internal bool AllowAlias { get { return allowAlias_; } set { pb::Freezable.CheckMutable(this); @@ -3548,7 +3608,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 3; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3560,7 +3620,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3656,7 +3716,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class EnumValueOptions : pb::IMessage { + internal sealed partial class EnumValueOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EnumValueOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3673,9 +3733,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public EnumValueOptions() { } + public EnumValueOptions() { + OnConstruction(); + } - public EnumValueOptions(EnumValueOptions other) { + partial void OnConstruction(); + + public EnumValueOptions(EnumValueOptions other) : this() { deprecated_ = other.deprecated_; uninterpretedOption_ = other.uninterpretedOption_.Clone(); } @@ -3694,7 +3758,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 1; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3706,7 +3770,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3786,7 +3850,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class ServiceOptions : pb::IMessage { + internal sealed partial class ServiceOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServiceOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3803,9 +3867,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public ServiceOptions() { } + public ServiceOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public ServiceOptions(ServiceOptions other) { + public ServiceOptions(ServiceOptions other) : this() { deprecated_ = other.deprecated_; uninterpretedOption_ = other.uninterpretedOption_.Clone(); } @@ -3824,7 +3892,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 33; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3836,7 +3904,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -3916,7 +3984,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class MethodOptions : pb::IMessage { + internal sealed partial class MethodOptions : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MethodOptions()); public static pb::MessageParser Parser { get { return _parser; } } @@ -3933,9 +4001,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public MethodOptions() { } + public MethodOptions() { + OnConstruction(); + } + + partial void OnConstruction(); - public MethodOptions(MethodOptions other) { + public MethodOptions(MethodOptions other) : this() { deprecated_ = other.deprecated_; uninterpretedOption_ = other.uninterpretedOption_.Clone(); } @@ -3954,7 +4026,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DeprecatedFieldNumber = 33; private bool deprecated_; - public bool Deprecated { + internal bool Deprecated { get { return deprecated_; } set { pb::Freezable.CheckMutable(this); @@ -3966,7 +4038,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_uninterpretedOption_codec = pb::FieldCodec.ForMessage(7994, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Parser); private readonly pbc::RepeatedField uninterpretedOption_ = new pbc::RepeatedField(); - public pbc::RepeatedField UninterpretedOption { + internal pbc::RepeatedField UninterpretedOption { get { return uninterpretedOption_; } } @@ -4046,7 +4118,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class UninterpretedOption : pb::IMessage { + internal sealed partial class UninterpretedOption : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new UninterpretedOption()); public static pb::MessageParser Parser { get { return _parser; } } @@ -4063,9 +4135,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public UninterpretedOption() { } + public UninterpretedOption() { + OnConstruction(); + } + + partial void OnConstruction(); - public UninterpretedOption(UninterpretedOption other) { + public UninterpretedOption(UninterpretedOption other) : this() { name_ = other.name_.Clone(); identifierValue_ = other.identifierValue_; positiveIntValue_ = other.positiveIntValue_; @@ -4091,13 +4167,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_name_codec = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.DescriptorProtos.UninterpretedOption.Types.NamePart.Parser); private readonly pbc::RepeatedField name_ = new pbc::RepeatedField(); - public pbc::RepeatedField Name { + internal pbc::RepeatedField Name { get { return name_; } } public const int IdentifierValueFieldNumber = 3; private string identifierValue_ = ""; - public string IdentifierValue { + internal string IdentifierValue { get { return identifierValue_; } set { pb::Freezable.CheckMutable(this); @@ -4107,7 +4183,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int PositiveIntValueFieldNumber = 4; private ulong positiveIntValue_; - public ulong PositiveIntValue { + internal ulong PositiveIntValue { get { return positiveIntValue_; } set { pb::Freezable.CheckMutable(this); @@ -4117,7 +4193,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NegativeIntValueFieldNumber = 5; private long negativeIntValue_; - public long NegativeIntValue { + internal long NegativeIntValue { get { return negativeIntValue_; } set { pb::Freezable.CheckMutable(this); @@ -4127,7 +4203,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int DoubleValueFieldNumber = 6; private double doubleValue_; - public double DoubleValue { + internal double DoubleValue { get { return doubleValue_; } set { pb::Freezable.CheckMutable(this); @@ -4137,7 +4213,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int StringValueFieldNumber = 7; private pb::ByteString stringValue_ = pb::ByteString.Empty; - public pb::ByteString StringValue { + internal pb::ByteString StringValue { get { return stringValue_; } set { pb::Freezable.CheckMutable(this); @@ -4147,7 +4223,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int AggregateValueFieldNumber = 8; private string aggregateValue_ = ""; - public string AggregateValue { + internal string AggregateValue { get { return aggregateValue_; } set { pb::Freezable.CheckMutable(this); @@ -4312,7 +4388,7 @@ namespace Google.Protobuf.DescriptorProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class NamePart : pb::IMessage { + internal sealed partial class NamePart : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NamePart()); public static pb::MessageParser Parser { get { return _parser; } } @@ -4329,9 +4405,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public NamePart() { } + public NamePart() { + OnConstruction(); + } - public NamePart(NamePart other) { + partial void OnConstruction(); + + public NamePart(NamePart other) : this() { namePart_ = other.namePart_; isExtension_ = other.isExtension_; } @@ -4349,7 +4429,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int NamePart_FieldNumber = 1; private string namePart_ = ""; - public string NamePart_ { + internal string NamePart_ { get { return namePart_; } set { pb::Freezable.CheckMutable(this); @@ -4359,7 +4439,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int IsExtensionFieldNumber = 2; private bool isExtension_; - public bool IsExtension { + internal bool IsExtension { get { return isExtension_; } set { pb::Freezable.CheckMutable(this); @@ -4455,7 +4535,7 @@ namespace Google.Protobuf.DescriptorProtos { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class SourceCodeInfo : pb::IMessage { + internal sealed partial class SourceCodeInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SourceCodeInfo()); public static pb::MessageParser Parser { get { return _parser; } } @@ -4472,9 +4552,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public SourceCodeInfo() { } + public SourceCodeInfo() { + OnConstruction(); + } + + partial void OnConstruction(); - public SourceCodeInfo(SourceCodeInfo other) { + public SourceCodeInfo(SourceCodeInfo other) : this() { location_ = other.location_.Clone(); } @@ -4494,7 +4578,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_location_codec = pb::FieldCodec.ForMessage(10, global::Google.Protobuf.DescriptorProtos.SourceCodeInfo.Types.Location.Parser); private readonly pbc::RepeatedField location_ = new pbc::RepeatedField(); - public pbc::RepeatedField Location { + internal pbc::RepeatedField Location { get { return location_; } } @@ -4559,7 +4643,7 @@ namespace Google.Protobuf.DescriptorProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class Types { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public sealed partial class Location : pb::IMessage { + internal sealed partial class Location : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Location()); public static pb::MessageParser Parser { get { return _parser; } } @@ -4576,9 +4660,13 @@ namespace Google.Protobuf.DescriptorProtos { private bool _frozen = false; public bool IsFrozen { get { return _frozen; } } - public Location() { } + public Location() { + OnConstruction(); + } + + partial void OnConstruction(); - public Location(Location other) { + public Location(Location other) : this() { path_ = other.path_.Clone(); span_ = other.span_.Clone(); leadingComments_ = other.leadingComments_; @@ -4604,7 +4692,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_path_codec = pb::FieldCodec.ForInt32(10); private readonly pbc::RepeatedField path_ = new pbc::RepeatedField(); - public pbc::RepeatedField Path { + internal pbc::RepeatedField Path { get { return path_; } } @@ -4612,13 +4700,13 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_span_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField span_ = new pbc::RepeatedField(); - public pbc::RepeatedField Span { + internal pbc::RepeatedField Span { get { return span_; } } public const int LeadingCommentsFieldNumber = 3; private string leadingComments_ = ""; - public string LeadingComments { + internal string LeadingComments { get { return leadingComments_; } set { pb::Freezable.CheckMutable(this); @@ -4628,7 +4716,7 @@ namespace Google.Protobuf.DescriptorProtos { public const int TrailingCommentsFieldNumber = 4; private string trailingComments_ = ""; - public string TrailingComments { + internal string TrailingComments { get { return trailingComments_; } set { pb::Freezable.CheckMutable(this); @@ -4640,7 +4728,7 @@ namespace Google.Protobuf.DescriptorProtos { private static readonly pb::FieldCodec _repeated_leadingDetachedComments_codec = pb::FieldCodec.ForString(50); private readonly pbc::RepeatedField leadingDetachedComments_ = new pbc::RepeatedField(); - public pbc::RepeatedField LeadingDetachedComments { + internal pbc::RepeatedField LeadingDetachedComments { get { return leadingDetachedComments_; } } diff --git a/examples/addressbook.proto b/examples/addressbook.proto index 9ab45427..5da5fa39 100644 --- a/examples/addressbook.proto +++ b/examples/addressbook.proto @@ -1,6 +1,6 @@ // See README.txt for information and build instructions. -syntax = "proto2"; +syntax = "proto3"; package tutorial; @@ -9,9 +9,9 @@ option java_outer_classname = "AddressBookProtos"; option csharp_namespace = "Google.Protobuf.Examples.AddressBook"; message Person { - required string name = 1; - required int32 id = 2; // Unique ID number for this person. - optional string email = 3; + string name = 1; + int32 id = 2; // Unique ID number for this person. + string email = 3; enum PhoneType { MOBILE = 0; @@ -20,8 +20,8 @@ message Person { } message PhoneNumber { - required string number = 1; - optional PhoneType type = 2 [default = HOME]; + string number = 1; + PhoneType type = 2; } repeated PhoneNumber phone = 4; -- cgit v1.2.3 From af259b77bf04fcfb68609776cb27f04d289a2c39 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 1 Jul 2015 17:19:48 +0100 Subject: Fix descriptor reflection in various ways - The protos are no longer publicly exposed at all - Oneof detection now works (as we default to -1, not 0) - OneofDescriptor exposes the fields in the oneof - Removed unnecessary code for replacing protos - remnant of extensions - There's now just the non-generic form of IDescriptor --- csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs | 32 +++++++++-- .../DescriptorProtos/IDescriptorProto.cs | 53 ------------------ .../DescriptorProtos/PartialClasses.cs | 38 ++++--------- .../ProtocolBuffers/Descriptors/DescriptorBase.cs | 63 +++++---------------- .../ProtocolBuffers/Descriptors/DescriptorPool.cs | 2 +- .../ProtocolBuffers/Descriptors/EnumDescriptor.cs | 22 ++++---- .../Descriptors/EnumValueDescriptor.cs | 20 +++---- .../ProtocolBuffers/Descriptors/FieldDescriptor.cs | 30 ++++++---- .../ProtocolBuffers/Descriptors/FileDescriptor.cs | 53 +++++++----------- .../src/ProtocolBuffers/Descriptors/IDescriptor.cs | 15 +---- .../Descriptors/IndexedDescriptorBase.cs | 65 ---------------------- .../Descriptors/MessageDescriptor.cs | 57 +++++-------------- .../Descriptors/MethodDescriptor.cs | 28 +++++----- .../ProtocolBuffers/Descriptors/OneofDescriptor.cs | 45 +++++++-------- .../Descriptors/PackageDescriptor.cs | 7 +-- .../Descriptors/ServiceDescriptor.cs | 24 ++++---- csharp/src/ProtocolBuffers/ProtocolBuffers.csproj | 2 - 17 files changed, 178 insertions(+), 378 deletions(-) delete mode 100644 csharp/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs delete mode 100644 csharp/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs (limited to 'csharp/src/ProtocolBuffers') diff --git a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs index e0fef912..d5c622bc 100644 --- a/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DescriptorsTest.cs @@ -30,6 +30,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion +using System.Linq; +using Google.Protobuf.DescriptorProtos; using Google.Protobuf.Descriptors; using Google.Protobuf.TestProtos; using NUnit.Framework; @@ -50,7 +52,7 @@ namespace Google.Protobuf Assert.AreEqual("google/protobuf/unittest_proto3.proto", file.Name); Assert.AreEqual("protobuf_unittest", file.Package); - Assert.AreEqual("UnittestProto", file.Options.JavaOuterClassname); + Assert.AreEqual("UnittestProto", file.Proto.Options.JavaOuterClassname); Assert.AreEqual("google/protobuf/unittest_proto3.proto", file.Proto.Name); // unittest.proto doesn't have any public imports, but unittest_import.proto does. @@ -92,7 +94,7 @@ namespace Google.Protobuf Assert.AreEqual("protobuf_unittest.TestAllTypes", messageType.FullName); Assert.AreEqual(UnittestProto3.Descriptor, messageType.File); Assert.IsNull(messageType.ContainingType); - Assert.IsNull(messageType.Options); + Assert.IsNull(messageType.Proto.Options); Assert.AreEqual("TestAllTypes", messageType.Name); @@ -143,7 +145,7 @@ namespace Google.Protobuf Assert.AreEqual(messageType, primitiveField.ContainingType); Assert.AreEqual(UnittestProto3.Descriptor, primitiveField.File); Assert.AreEqual(FieldType.Int32, primitiveField.FieldType); - Assert.IsNull(primitiveField.Options); + Assert.IsNull(primitiveField.Proto.Options); Assert.AreEqual("single_nested_enum", enumField.Name); Assert.AreEqual(FieldType.Enum, enumField.FieldType); @@ -177,7 +179,7 @@ namespace Google.Protobuf Assert.AreEqual("protobuf_unittest.ForeignEnum", enumType.FullName); Assert.AreEqual(UnittestProto3.Descriptor, enumType.File); Assert.Null(enumType.ContainingType); - Assert.Null(enumType.Options); + Assert.Null(enumType.Proto.Options); Assert.AreEqual("NestedEnum", nestedType.Name); Assert.AreEqual("protobuf_unittest.TestAllTypes.NestedEnum", @@ -197,5 +199,27 @@ namespace Google.Protobuf Assert.AreEqual(i, enumType.Values[i].Index); } } + + [Test] + public void OneofDescriptor() + { + OneofDescriptor descriptor = TestAllTypes.Descriptor.FindDescriptor("oneof_field"); + Assert.AreEqual("oneof_field", descriptor.Name); + Assert.AreEqual("protobuf_unittest.TestAllTypes.oneof_field", descriptor.FullName); + + var expectedFields = new[] { + TestAllTypes.OneofBytesFieldNumber, + TestAllTypes.OneofNestedMessageFieldNumber, + TestAllTypes.OneofStringFieldNumber, + TestAllTypes.OneofUint32FieldNumber } + .Select(fieldNumber => TestAllTypes.Descriptor.FindFieldByNumber(fieldNumber)) + .ToList(); + foreach (var field in expectedFields) + { + Assert.AreSame(descriptor, field.ContainingOneof); + } + + CollectionAssert.AreEquivalent(expectedFields, descriptor.Fields); + } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs deleted file mode 100644 index c0f27427..00000000 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/IDescriptorProto.cs +++ /dev/null @@ -1,53 +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 - -namespace Google.Protobuf.DescriptorProtos -{ - /// - /// Interface implemented by all DescriptorProtos. The generator doesn't - /// emit the interface implementation claim, so PartialClasses.cs contains - /// partial class declarations for each of them. - /// - /// The associated options protocol buffer type - public interface IDescriptorProto - { - /// - /// The brief name of the descriptor's target. - /// - string Name { get; } - - /// - /// The options for this descriptor. - /// - TOptions Options { get; } - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs index 15f339ba..dc19cdad 100644 --- a/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs +++ b/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs @@ -30,36 +30,18 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion -// This file just contains partial classes for each of the -// autogenerated classes, so that they implement -// IDescriptorProto +// This file just contains partial classes for any autogenerated classes that need additional support. namespace Google.Protobuf.DescriptorProtos { - public partial class DescriptorProto : IDescriptorProto - { - } - - public partial class EnumDescriptorProto : IDescriptorProto - { - } - - public partial class EnumValueDescriptorProto : IDescriptorProto - { - } - - public partial class FieldDescriptorProto : IDescriptorProto - { - } - - public partial class FileDescriptorProto : IDescriptorProto - { - } - - public partial class MethodDescriptorProto : IDescriptorProto - { - } - - public partial class ServiceDescriptorProto : IDescriptorProto + internal partial class FieldDescriptorProto { + // We can't tell the difference between "explicitly set to 0" and "not set" + // in proto3, but we need to tell the difference for OneofIndex. descriptor.proto + // is really a proto2 file, but the runtime doesn't know about proto2 semantics... + // We fake it by defaulting to -1. + partial void OnConstruction() + { + OneofIndex = -1; + } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/DescriptorBase.cs b/csharp/src/ProtocolBuffers/Descriptors/DescriptorBase.cs index ccde34ab..0eb71215 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/DescriptorBase.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/DescriptorBase.cs @@ -34,61 +34,36 @@ using Google.Protobuf.DescriptorProtos; namespace Google.Protobuf.Descriptors { - // TODO(jonskeet): The descriptor type hierarchy needs changing so that we can hide the descriptor protos. /// /// Base class for nearly all descriptors, providing common functionality. /// - /// Type of the protocol buffer form of this descriptor - /// Type of the options protocol buffer for this descriptor - public abstract class DescriptorBase : IDescriptor - where TProto : IMessage, IDescriptorProto + public abstract class DescriptorBase : IDescriptor { - private TProto proto; private readonly FileDescriptor file; private readonly string fullName; + private readonly int index; - protected DescriptorBase(TProto proto, FileDescriptor file, string fullName) + internal DescriptorBase(FileDescriptor file, string fullName, int index) { - this.proto = proto; this.file = file; this.fullName = fullName; + this.index = index; } - internal virtual void ReplaceProto(TProto newProto) - { - this.proto = newProto; - } - - protected static string ComputeFullName(FileDescriptor file, MessageDescriptor parent, string name) - { - if (parent != null) - { - return parent.FullName + "." + name; - } - if (file.Package.Length > 0) - { - return file.Package + "." + name; - } - return name; - } - - IMessage IDescriptor.Proto - { - get { return proto; } - } - - /// - /// Returns the protocol buffer form of this descriptor. - /// - public TProto Proto + /// + /// The index of this descriptor within its parent descriptor. + /// + /// + /// This returns the index of this descriptor within its parent, for + /// this descriptor's type. (There can be duplicate values for different + /// types, e.g. one enum type with index 0 and one message type with index 0.) + /// + public int Index { - get { return proto; } + get { return index; } } - public TOptions Options - { - get { return proto.Options; } - } + public abstract string Name { get; } /// /// The fully qualified name of the descriptor's target. @@ -98,14 +73,6 @@ namespace Google.Protobuf.Descriptors get { return fullName; } } - /// - /// The brief name of the descriptor's target. - /// - public string Name - { - get { return proto.Name; } - } - /// /// The file this descriptor was declared in. /// diff --git a/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs b/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs index 57c4ba03..b07af060 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/DescriptorPool.cs @@ -257,7 +257,7 @@ namespace Google.Protobuf.Descriptors /// or unqualified. C++-like name lookup semantics are used to search for the /// matching descriptor. /// - public IDescriptor LookupSymbol(string name, IDescriptor relativeTo) + internal IDescriptor LookupSymbol(string name, IDescriptor relativeTo) { // TODO(jonskeet): This could be optimized in a number of ways. diff --git a/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs index 9f10990b..a6db5268 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/EnumDescriptor.cs @@ -38,14 +38,16 @@ namespace Google.Protobuf.Descriptors /// /// Descriptor for an enum type in a .proto file. /// - public sealed class EnumDescriptor : IndexedDescriptorBase + public sealed class EnumDescriptor : DescriptorBase { + private readonly EnumDescriptorProto proto; private readonly MessageDescriptor containingType; private readonly IList values; internal EnumDescriptor(EnumDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) - : base(proto, file, ComputeFullName(file, parent, proto.Name), index) + : base(file, file.ComputeFullName(parent, proto.Name), index) { + this.proto = proto; containingType = parent; if (proto.Value.Count == 0) @@ -61,6 +63,13 @@ namespace Google.Protobuf.Descriptors File.DescriptorPool.AddSymbol(this); } + internal EnumDescriptorProto Proto { get { return proto; } } + + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + /// /// If this is a nested type, get the outer descriptor, otherwise null. /// @@ -95,14 +104,5 @@ namespace Google.Protobuf.Descriptors { return File.DescriptorPool.FindSymbol(FullName + "." + name); } - - internal override void ReplaceProto(EnumDescriptorProto newProto) - { - base.ReplaceProto(newProto); - for (int i = 0; i < values.Count; i++) - { - values[i].ReplaceProto(newProto.Value[i]); - } - } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs index b553ee55..e609b1f8 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/EnumValueDescriptor.cs @@ -37,27 +37,27 @@ namespace Google.Protobuf.Descriptors /// /// Descriptor for a single enum value within an enum in a .proto file. /// - public sealed class EnumValueDescriptor : IndexedDescriptorBase + public sealed class EnumValueDescriptor : DescriptorBase { private readonly EnumDescriptor enumDescriptor; + private readonly EnumValueDescriptorProto proto; internal EnumValueDescriptor(EnumValueDescriptorProto proto, FileDescriptor file, EnumDescriptor parent, int index) - : base(proto, file, parent.FullName + "." + proto.Name, index) + : base(file, parent.FullName + "." + proto.Name, index) { + this.proto = proto; enumDescriptor = parent; file.DescriptorPool.AddSymbol(this); file.DescriptorPool.AddEnumValueByNumber(this); } - public int Number - { - get { return Proto.Number; } - } + internal EnumValueDescriptorProto Proto { get { return proto; } } + + public override string Name { get { return proto.Name; } } - public EnumDescriptor EnumDescriptor - { - get { return enumDescriptor; } - } + public int Number { get { return Proto.Number; } } + + public EnumDescriptor EnumDescriptor { get { return enumDescriptor; } } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs index 3b36a280..7af69bbb 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FieldDescriptor.cs @@ -38,21 +38,20 @@ namespace Google.Protobuf.Descriptors /// /// Descriptor for a field or extension within a message in a .proto file. /// - public sealed class FieldDescriptor : IndexedDescriptorBase, - IComparable + public sealed class FieldDescriptor : DescriptorBase, IComparable { + private readonly FieldDescriptorProto proto; private EnumDescriptor enumType; private MessageDescriptor messageType; - private MessageDescriptor containingType; - private OneofDescriptor containingOneof; + private readonly MessageDescriptor containingType; + private readonly OneofDescriptor containingOneof; private FieldType fieldType; - private readonly object optionsLock = new object(); - internal FieldDescriptor(FieldDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) - : base(proto, file, ComputeFullName(file, parent, proto.Name), index) + : base(file, file.ComputeFullName(parent, proto.Name), index) { + this.proto = proto; if (proto.Type != 0) { fieldType = GetFieldTypeFromProtoType(proto.Type); @@ -64,7 +63,8 @@ namespace Google.Protobuf.Descriptors "Field numbers must be positive integers."); } containingType = parent; - if (proto.OneofIndex != 0) + // OneofIndex "defaults" to -1 due to a hack in FieldDescriptor.OnConstruction. + if (proto.OneofIndex != -1) { if (proto.OneofIndex < 0 || proto.OneofIndex >= parent.Proto.OneofDecl.Count) { @@ -72,12 +72,18 @@ namespace Google.Protobuf.Descriptors "FieldDescriptorProto.oneof_index is out of range for type " + parent.Name); } containingOneof = parent.Oneofs[proto.OneofIndex]; - containingOneof.fieldCount ++; } file.DescriptorPool.AddSymbol(this); } + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + + internal FieldDescriptorProto Proto { get { return proto; } } + /// /// Maps a field type as included in the .proto file to a FieldType. /// @@ -133,12 +139,12 @@ namespace Google.Protobuf.Descriptors public bool IsMap { - get { return fieldType == FieldType.Message && messageType.Options != null && messageType.Options.MapEntry; } + get { return fieldType == FieldType.Message && messageType.Proto.Options != null && messageType.Proto.Options.MapEntry; } } public bool IsPacked { - get { return Proto.Options.Packed; } + get { return Proto.Options != null && Proto.Options.Packed; } } /// @@ -278,7 +284,7 @@ namespace Google.Protobuf.Descriptors File.DescriptorPool.AddFieldByNumber(this); - if (containingType != null && containingType.Options != null && containingType.Options.MessageSetWireFormat) + if (containingType != null && containingType.Proto.Options != null && containingType.Proto.Options.MessageSetWireFormat) { throw new DescriptorValidationException(this, "MessageSet format is not supported."); } diff --git a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs index a6320a31..9d0bdfd3 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/FileDescriptor.cs @@ -43,7 +43,7 @@ namespace Google.Protobuf.Descriptors /// IDescriptor is implemented such that the File property returns this descriptor, /// and the FullName is the same as the Name. /// - public sealed class FileDescriptor : IDescriptor + public sealed class FileDescriptor : IDescriptor { private readonly FileDescriptorProto proto; private readonly IList messageTypes; @@ -87,6 +87,22 @@ namespace Google.Protobuf.Descriptors new ServiceDescriptor(service, this, index)); } + /// + /// Computes the full name of a descriptor within this file, with an optional parent message. + /// + internal string ComputeFullName(MessageDescriptor parent, string name) + { + if (parent != null) + { + return parent.FullName + "." + name; + } + if (Package.Length > 0) + { + return Package + "." + name; + } + return name; + } + /// /// Extracts public dependencies from direct dependencies. This is a static method despite its /// first parameter, as the value we're in the middle of constructing is only used for exceptions. @@ -127,19 +143,11 @@ namespace Google.Protobuf.Descriptors /// /// The descriptor in its protocol message representation. /// - public FileDescriptorProto Proto + internal FileDescriptorProto Proto { get { return proto; } } - /// - /// The defined in descriptor.proto. - /// - public FileOptions Options - { - get { return proto.Options; } - } - /// /// The file name. /// @@ -213,14 +221,6 @@ namespace Google.Protobuf.Descriptors get { return this; } } - /// - /// Protocol buffer describing this descriptor. - /// - IMessage IDescriptor.Proto - { - get { return Proto; } - } - /// /// Pool containing symbol descriptors. /// @@ -255,22 +255,7 @@ namespace Google.Protobuf.Descriptors } return null; } - - /// - /// Builds a FileDescriptor from its protocol buffer representation. - /// - /// The protocol message form of the FileDescriptor. - /// FileDescriptors corresponding to all of the - /// 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. - /// 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. - public static FileDescriptor BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) - { - return BuildFrom(proto, dependencies, false); - } - + /// /// Builds a FileDescriptor from its protocol buffer representation. /// diff --git a/csharp/src/ProtocolBuffers/Descriptors/IDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/IDescriptor.cs index 2c2db127..92c6d463 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/IDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/IDescriptor.cs @@ -33,23 +33,12 @@ namespace Google.Protobuf.Descriptors { /// - /// The non-generic form of the IDescriptor interface. Useful for describing a general - /// descriptor. + /// Interface implemented by all descriptor types. /// public interface IDescriptor { string Name { get; } string FullName { get; } FileDescriptor File { get; } - IMessage Proto { get; } - } - - /// - /// Strongly-typed form of the IDescriptor interface. - /// - /// Protocol buffer type underlying this descriptor type - internal interface IDescriptor : IDescriptor where TProto : IMessage - { - new TProto Proto { get; } - } + } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs b/csharp/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs deleted file mode 100644 index 6c515726..00000000 --- a/csharp/src/ProtocolBuffers/Descriptors/IndexedDescriptorBase.cs +++ /dev/null @@ -1,65 +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 Google.Protobuf.DescriptorProtos; - -namespace Google.Protobuf.Descriptors -{ - /// - /// Base class for descriptors which are also indexed. This is all of them other than - /// . - /// - public abstract class IndexedDescriptorBase : DescriptorBase - where TProto : IMessage, IDescriptorProto - { - private readonly int index; - - protected IndexedDescriptorBase(TProto proto, FileDescriptor file, string fullName, int index) - : base(proto, file, fullName) - { - this.index = index; - } - - /// - /// The index of this descriptor within its parent descriptor. - /// - /// - /// This returns the index of this descriptor within its parent, for - /// this descriptor's type. (There can be duplicate values for different - /// types, e.g. one enum type with index 0 and one message type with index 0.) - /// - public int Index - { - get { return index; } - } - } -} \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs index cbf4c0f2..e65e8bb0 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/MessageDescriptor.cs @@ -39,8 +39,9 @@ namespace Google.Protobuf.Descriptors /// /// Describes a message type. /// - public sealed class MessageDescriptor : IndexedDescriptorBase + public sealed class MessageDescriptor : DescriptorBase { + private readonly DescriptorProto proto; private readonly MessageDescriptor containingType; private readonly IList nestedTypes; private readonly IList enumTypes; @@ -48,8 +49,9 @@ namespace Google.Protobuf.Descriptors private readonly IList oneofs; internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex) - : base(proto, file, ComputeFullName(file, parent, proto.Name), typeIndex) + : base(file, file.ComputeFullName(parent, proto.Name), typeIndex) { + this.proto = proto; containingType = parent; oneofs = DescriptorUtil.ConvertAndMakeReadOnly(proto.OneofDecl, @@ -68,23 +70,16 @@ namespace Google.Protobuf.Descriptors fields = DescriptorUtil.ConvertAndMakeReadOnly(proto.Field, (field, index) => new FieldDescriptor(field, file, this, index)); - - for (int i = 0; i < proto.OneofDecl.Count; i++) - { - oneofs[i].fields = new FieldDescriptor[oneofs[i].FieldCount]; - oneofs[i].fieldCount = 0; - } - for (int i = 0; i< proto.Field.Count; i++) - { - OneofDescriptor oneofDescriptor = fields[i].ContainingOneof; - if (oneofDescriptor != null) - { - oneofDescriptor.fields[oneofDescriptor.fieldCount++] = fields[i]; - } - } file.DescriptorPool.AddSymbol(this); } + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + + internal DescriptorProto Proto { get { return proto; } } + /// /// If this is a nested type, get the outer descriptor, otherwise null. /// @@ -144,7 +139,7 @@ namespace Google.Protobuf.Descriptors /// /// Finds a nested descriptor by name. The is valid for fields, nested - /// message types and enums. + /// message types, oneofs and enums. /// /// The unqualified name of the descriptor, e.g. "Foo" /// The descriptor, or null if not found. @@ -171,32 +166,8 @@ namespace Google.Protobuf.Descriptors foreach (OneofDescriptor oneof in oneofs) { - // TODO(jonskeet): Do we need to do this? - // oneof.C - } - } - - /// - /// See FileDescriptor.ReplaceProto - /// - internal override void ReplaceProto(DescriptorProto newProto) - { - base.ReplaceProto(newProto); - - for (int i = 0; i < nestedTypes.Count; i++) - { - nestedTypes[i].ReplaceProto(newProto.NestedType[i]); - } - - for (int i = 0; i < enumTypes.Count; i++) - { - enumTypes[i].ReplaceProto(newProto.EnumType[i]); - } - - for (int i = 0; i < fields.Count; i++) - { - fields[i].ReplaceProto(newProto.Field[i]); + oneof.CrossLink(); } - } + } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs index 6a4ad4ea..7d4a6f4f 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs @@ -37,8 +37,9 @@ namespace Google.Protobuf.Descriptors /// /// Describes a single method in a service. /// - public sealed class MethodDescriptor : IndexedDescriptorBase + public sealed class MethodDescriptor : DescriptorBase { + private readonly MethodDescriptorProto proto; private readonly ServiceDescriptor service; private MessageDescriptor inputType; private MessageDescriptor outputType; @@ -46,35 +47,34 @@ namespace Google.Protobuf.Descriptors /// /// The service this method belongs to. /// - public ServiceDescriptor Service - { - get { return service; } - } + public ServiceDescriptor Service { get { return service; } } /// /// The method's input type. /// - public MessageDescriptor InputType - { - get { return inputType; } - } + public MessageDescriptor InputType { get { return inputType; } } /// /// The method's input type. /// - public MessageDescriptor OutputType - { - get { return outputType; } - } + public MessageDescriptor OutputType { get { return outputType; } } internal MethodDescriptor(MethodDescriptorProto proto, FileDescriptor file, ServiceDescriptor parent, int index) - : base(proto, file, parent.FullName + "." + proto.Name, index) + : base(file, parent.FullName + "." + proto.Name, index) { + this.proto = proto; service = parent; file.DescriptorPool.AddSymbol(this); } + internal MethodDescriptorProto Proto { get { return proto; } } + + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + internal void CrossLink() { IDescriptor lookup = File.DescriptorPool.LookupSymbol(Proto.InputType, this); diff --git a/csharp/src/ProtocolBuffers/Descriptors/OneofDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/OneofDescriptor.cs index ab3b76ec..8418948f 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/OneofDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/OneofDescriptor.cs @@ -31,48 +31,49 @@ #endregion using System.Collections.Generic; +using System.Collections.ObjectModel; using Google.Protobuf.DescriptorProtos; namespace Google.Protobuf.Descriptors { - public sealed class OneofDescriptor + public sealed class OneofDescriptor : DescriptorBase { - private int index; - private OneofDescriptorProto proto; - private FileDescriptor file; + private readonly OneofDescriptorProto proto; private MessageDescriptor containingType; - internal int fieldCount; - internal IList fields; + private IList fields; - internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, - MessageDescriptor parent, int index) + internal OneofDescriptor(OneofDescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int index) + : base(file, file.ComputeFullName(parent, proto.Name), index) { this.proto = proto; - this.file = file; - this.index = index; - containingType = parent; - fieldCount = 0; - } - public int Index - { - get { return index; } + file.DescriptorPool.AddSymbol(this); } + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + public MessageDescriptor ContainingType { get { return containingType; } } - public int FieldCount - { - get { return fieldCount; } - } + public IList Fields { get { return fields; } } - public FieldDescriptor Field(int index) + internal void CrossLink() { - return fields[index]; + List fieldCollection = new List(); + foreach (var field in ContainingType.Fields) + { + if (field.ContainingOneof == this) + { + fieldCollection.Add(field); + } + } + fields = new ReadOnlyCollection(fieldCollection); } } } diff --git a/csharp/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs index 9af677d7..18adc9e3 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/PackageDescriptor.cs @@ -37,7 +37,7 @@ namespace Google.Protobuf.Descriptors /// just as placeholders so that someone cannot define, say, a message type /// that has the same name as an existing package. /// - internal sealed class PackageDescriptor : IDescriptor + internal sealed class PackageDescriptor : IDescriptor { private readonly string name; private readonly string fullName; @@ -50,11 +50,6 @@ namespace Google.Protobuf.Descriptors this.name = name; } - public IMessage Proto - { - get { return file.Proto; } - } - public string Name { get { return name; } diff --git a/csharp/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs index ef712b46..2556e272 100644 --- a/csharp/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs +++ b/csharp/src/ProtocolBuffers/Descriptors/ServiceDescriptor.cs @@ -39,19 +39,28 @@ namespace Google.Protobuf.Descriptors /// /// Describes a service type. /// - public sealed class ServiceDescriptor : IndexedDescriptorBase + public sealed class ServiceDescriptor : DescriptorBase { + private readonly ServiceDescriptorProto proto; private readonly IList methods; - public ServiceDescriptor(ServiceDescriptorProto proto, FileDescriptor file, int index) - : base(proto, file, ComputeFullName(file, null, proto.Name), index) + internal ServiceDescriptor(ServiceDescriptorProto proto, FileDescriptor file, int index) + : base(file, file.ComputeFullName(null, proto.Name), index) { + this.proto = proto; methods = DescriptorUtil.ConvertAndMakeReadOnly(proto.Method, (method, i) => new MethodDescriptor(method, file, this, i)); file.DescriptorPool.AddSymbol(this); } + /// + /// The brief name of the descriptor's target. + /// + public override string Name { get { return proto.Name; } } + + internal ServiceDescriptorProto Proto { get { return proto; } } + /// /// An unmodifiable list of methods in this service. /// @@ -77,14 +86,5 @@ namespace Google.Protobuf.Descriptors method.CrossLink(); } } - - internal override void ReplaceProto(ServiceDescriptorProto newProto) - { - base.ReplaceProto(newProto); - for (int i = 0; i < methods.Count; i++) - { - methods[i].ReplaceProto(newProto.Method[i]); - } - } } } \ No newline at end of file diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj index 4078589e..aa4adcc0 100644 --- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -61,7 +61,6 @@ - @@ -74,7 +73,6 @@ - -- cgit v1.2.3 From 14f2222a50a18ff0d8772095587b9cdad455a7bb Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 3 Jul 2015 11:41:37 +0100 Subject: Lots more tests for FieldCodec, MapField, RepeatedField ... and some implementation changes to go with them. --- .../Collections/MapFieldTest.cs | 184 +++++++++++++- .../Collections/RepeatedFieldTest.cs | 263 +++++++++++++++++++++ csharp/src/ProtocolBuffers.Test/EqualityTester.cs | 7 +- csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs | 15 ++ csharp/src/ProtocolBuffers/Collections/MapField.cs | 45 +++- .../ProtocolBuffers/Collections/RepeatedField.cs | 12 +- csharp/src/ProtocolBuffers/FieldCodec.cs | 8 +- 7 files changed, 516 insertions(+), 18 deletions(-) (limited to 'csharp/src/ProtocolBuffers') diff --git a/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs b/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs index 75f8ff2a..d43bed3e 100644 --- a/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs +++ b/csharp/src/ProtocolBuffers.Test/Collections/MapFieldTest.cs @@ -34,6 +34,8 @@ using System; using System.Collections.Generic; using Google.Protobuf.TestProtos; using NUnit.Framework; +using System.Collections; +using System.Linq; namespace Google.Protobuf.Collections { @@ -53,6 +55,18 @@ namespace Google.Protobuf.Collections Assert.IsTrue(message.IsFrozen); } + [Test] + public void Freeze_Idempotent() + { + var message = new ForeignMessage { C = 20 }; + var map = new MapField { { "x", message } }; + Assert.IsFalse(map.IsFrozen); + map.Freeze(); + Assert.IsTrue(message.IsFrozen); + map.Freeze(); + Assert.IsTrue(message.IsFrozen); + } + [Test] public void Freeze_PreventsMutation() { @@ -187,6 +201,15 @@ namespace Google.Protobuf.Collections EqualityTester.AssertInequality(map1, map2); } + [Test] + public void Equality_Simple() + { + var map = new MapField(); + EqualityTester.AssertEquality(map, map); + EqualityTester.AssertInequality(map, null); + Assert.IsFalse(map.Equals(new object())); + } + [Test] public void EqualityIsValueSensitive() { @@ -287,7 +310,8 @@ namespace Google.Protobuf.Collections Assert.IsFalse(map.Remove("missing")); Assert.AreEqual(1, map.Count); Assert.IsTrue(map.Remove("foo")); - Assert.AreEqual(0, map.Count); + Assert.AreEqual(0, map.Count); + Assert.Throws(() => map.Remove(null)); } [Test] @@ -346,6 +370,164 @@ namespace Google.Protobuf.Collections Assert.AreEqual("z", map["x"]); } + [Test] + public void GetEnumerator_NonGeneric() + { + IEnumerable map = new MapField { { "x", "y" } }; + CollectionAssert.AreEqual(new[] { new KeyValuePair("x", "y") }, + map.Cast().ToList()); + } + + // Test for the explicitly-implemented non-generic IDictionary interface + [Test] + public void IDictionary_GetEnumerator() + { + IDictionary map = new MapField { { "x", "y" } }; + var enumerator = map.GetEnumerator(); + + // Commented assertions show an ideal situation - it looks like + // the LinkedList enumerator doesn't throw when you ask for the current entry + // at an inappropriate time; fixing this would be more work than it's worth. + // Assert.Throws(() => enumerator.Current.GetHashCode()); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("x", enumerator.Key); + Assert.AreEqual("y", enumerator.Value); + Assert.AreEqual(new DictionaryEntry("x", "y"), enumerator.Current); + Assert.AreEqual(new DictionaryEntry("x", "y"), enumerator.Entry); + Assert.IsFalse(enumerator.MoveNext()); + // Assert.Throws(() => enumerator.Current.GetHashCode()); + enumerator.Reset(); + // Assert.Throws(() => enumerator.Current.GetHashCode()); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("x", enumerator.Key); // Assume the rest are okay + } + + [Test] + public void IDictionary_Add() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + dictionary.Add("a", "b"); + Assert.AreEqual("b", map["a"]); + Assert.Throws(() => dictionary.Add("a", "duplicate")); + Assert.Throws(() => dictionary.Add(new object(), "key is bad")); + Assert.Throws(() => dictionary.Add("value is bad", new object())); + } + + [Test] + public void IDictionary_Contains() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + + Assert.IsFalse(dictionary.Contains("a")); + Assert.IsFalse(dictionary.Contains(5)); + // Surprising, but IDictionary.Contains is only about keys. + Assert.IsFalse(dictionary.Contains(new DictionaryEntry("x", "y"))); + Assert.IsTrue(dictionary.Contains("x")); + } + + [Test] + public void IDictionary_Remove() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + dictionary.Remove("a"); + Assert.AreEqual(1, dictionary.Count); + dictionary.Remove(5); + Assert.AreEqual(1, dictionary.Count); + dictionary.Remove(new DictionaryEntry("x", "y")); + Assert.AreEqual(1, dictionary.Count); + dictionary.Remove("x"); + Assert.AreEqual(0, dictionary.Count); + Assert.Throws(() => dictionary.Remove(null)); + + map.Freeze(); + // Call should fail even though it clearly doesn't contain 5 as a key. + Assert.Throws(() => dictionary.Remove(5)); + } + + [Test] + public void IDictionary_CopyTo() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + var array = new DictionaryEntry[3]; + dictionary.CopyTo(array, 1); + CollectionAssert.AreEqual(new[] { default(DictionaryEntry), new DictionaryEntry("x", "y"), default(DictionaryEntry) }, + array); + var objectArray = new object[3]; + dictionary.CopyTo(objectArray, 1); + CollectionAssert.AreEqual(new object[] { null, new DictionaryEntry("x", "y"), null }, + objectArray); + } + + [Test] + public void IDictionary_IsFixedSize() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + Assert.IsFalse(dictionary.IsFixedSize); + map.Freeze(); + Assert.IsTrue(dictionary.IsFixedSize); + } + + [Test] + public void IDictionary_Keys() + { + IDictionary dictionary = new MapField { { "x", "y" } }; + CollectionAssert.AreEqual(new[] { "x" }, dictionary.Keys); + } + + [Test] + public void IDictionary_Values() + { + IDictionary dictionary = new MapField { { "x", "y" } }; + CollectionAssert.AreEqual(new[] { "y" }, dictionary.Values); + } + + [Test] + public void IDictionary_IsSynchronized() + { + IDictionary dictionary = new MapField { { "x", "y" } }; + Assert.IsFalse(dictionary.IsSynchronized); + } + + [Test] + public void IDictionary_SyncRoot() + { + IDictionary dictionary = new MapField { { "x", "y" } }; + Assert.AreSame(dictionary, dictionary.SyncRoot); + } + + [Test] + public void IDictionary_Indexer_Get() + { + IDictionary dictionary = new MapField { { "x", "y" } }; + Assert.AreEqual("y", dictionary["x"]); + Assert.IsNull(dictionary["a"]); + Assert.IsNull(dictionary[5]); + Assert.Throws(() => dictionary[null].GetHashCode()); + } + + [Test] + public void IDictionary_Indexer_Set() + { + var map = new MapField { { "x", "y" } }; + IDictionary dictionary = map; + map["a"] = "b"; + Assert.AreEqual("b", map["a"]); + map["a"] = "c"; + Assert.AreEqual("c", map["a"]); + Assert.Throws(() => dictionary[5] = "x"); + Assert.Throws(() => dictionary["x"] = 5); + Assert.Throws(() => dictionary[null] = "z"); + Assert.Throws(() => dictionary["x"] = null); + map.Freeze(); + // Note: Not InvalidOperationException. + Assert.Throws(() => dictionary["a"] = "c"); + } + private static KeyValuePair NewKeyValuePair(TKey key, TValue value) { return new KeyValuePair(key, value); diff --git a/csharp/src/ProtocolBuffers.Test/Collections/RepeatedFieldTest.cs b/csharp/src/ProtocolBuffers.Test/Collections/RepeatedFieldTest.cs index 988801b7..6eff8683 100644 --- a/csharp/src/ProtocolBuffers.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/ProtocolBuffers.Test/Collections/RepeatedFieldTest.cs @@ -31,9 +31,11 @@ #endregion using System; +using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using Google.Protobuf.TestProtos; using NUnit.Framework; @@ -82,6 +84,115 @@ namespace Google.Protobuf.Collections Assert.AreEqual("bar", list[2]); } + [Test] + public void RemoveAt_Valid() + { + var list = new RepeatedField { "first", "second", "third" }; + list.RemoveAt(1); + CollectionAssert.AreEqual(new[] { "first", "third" }, list); + // Just check that these don't throw... + list.RemoveAt(list.Count - 1); // Now the count will be 1... + list.RemoveAt(0); + Assert.AreEqual(0, list.Count); + } + + [Test] + public void RemoveAt_Invalid() + { + var list = new RepeatedField { "first", "second", "third" }; + Assert.Throws(() => list.RemoveAt(-1)); + Assert.Throws(() => list.RemoveAt(3)); + } + + [Test] + public void Insert_Valid() + { + var list = new RepeatedField { "first", "second" }; + list.Insert(1, "middle"); + CollectionAssert.AreEqual(new[] { "first", "middle", "second" }, list); + list.Insert(3, "end"); + CollectionAssert.AreEqual(new[] { "first", "middle", "second", "end" }, list); + list.Insert(0, "start"); + CollectionAssert.AreEqual(new[] { "start", "first", "middle", "second", "end" }, list); + } + + [Test] + public void Insert_Invalid() + { + var list = new RepeatedField { "first", "second" }; + Assert.Throws(() => list.Insert(-1, "foo")); + Assert.Throws(() => list.Insert(3, "foo")); + Assert.Throws(() => list.Insert(0, null)); + } + + [Test] + public void Equals_RepeatedField() + { + var list = new RepeatedField { "first", "second" }; + Assert.IsFalse(list.Equals((RepeatedField) null)); + Assert.IsTrue(list.Equals(list)); + Assert.IsFalse(list.Equals(new RepeatedField { "first", "third" })); + Assert.IsFalse(list.Equals(new RepeatedField { "first" })); + Assert.IsTrue(list.Equals(new RepeatedField { "first", "second" })); + } + + [Test] + public void Equals_Object() + { + var list = new RepeatedField { "first", "second" }; + Assert.IsFalse(list.Equals((object) null)); + Assert.IsTrue(list.Equals((object) list)); + Assert.IsFalse(list.Equals((object) new RepeatedField { "first", "third" })); + Assert.IsFalse(list.Equals((object) new RepeatedField { "first" })); + Assert.IsTrue(list.Equals((object) new RepeatedField { "first", "second" })); + Assert.IsFalse(list.Equals(new object())); + } + + [Test] + public void GetEnumerator_GenericInterface() + { + IEnumerable list = new RepeatedField { "first", "second" }; + // Select gets rid of the optimizations in ToList... + CollectionAssert.AreEqual(new[] { "first", "second" }, list.Select(x => x).ToList()); + } + + [Test] + public void GetEnumerator_NonGenericInterface() + { + IEnumerable list = new RepeatedField { "first", "second" }; + CollectionAssert.AreEqual(new[] { "first", "second" }, list.Cast().ToList()); + } + + [Test] + public void CopyTo() + { + var list = new RepeatedField { "first", "second" }; + string[] stringArray = new string[4]; + list.CopyTo(stringArray, 1); + CollectionAssert.AreEqual(new[] { null, "first", "second", null }, stringArray); + } + + [Test] + public void Indexer_Get() + { + var list = new RepeatedField { "first", "second" }; + Assert.AreEqual("first", list[0]); + Assert.AreEqual("second", list[1]); + Assert.Throws(() => list[-1].GetHashCode()); + Assert.Throws(() => list[2].GetHashCode()); + } + + [Test] + public void Indexer_Set() + { + var list = new RepeatedField { "first", "second" }; + list[0] = "changed"; + Assert.AreEqual("changed", list[0]); + Assert.Throws(() => list[0] = null); + Assert.Throws(() => list[-1] = "bad"); + Assert.Throws(() => list[2] = "bad"); + } + [Test] public void Freeze_FreezesElements() { @@ -124,6 +235,27 @@ namespace Google.Protobuf.Collections clone[0] = 1; } + [Test] + public void Enumerator() + { + var list = new RepeatedField { "first", "second" }; + using (var enumerator = list.GetEnumerator()) + { + Assert.Throws(() => enumerator.Current.GetHashCode()); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("first", enumerator.Current); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("second", enumerator.Current); + Assert.IsFalse(enumerator.MoveNext()); + Assert.Throws(() => enumerator.Current.GetHashCode()); + Assert.IsFalse(enumerator.MoveNext()); + enumerator.Reset(); + Assert.Throws(() => enumerator.Current.GetHashCode()); + Assert.IsTrue(enumerator.MoveNext()); + Assert.AreEqual("first", enumerator.Current); + } + } + [Test] public void AddEntriesFrom_PackedInt32() { @@ -309,6 +441,42 @@ namespace Google.Protobuf.Collections Assert.IsTrue(input.IsAtEnd); } + [Test] + public void CalculateSize_VariableSizeNonPacked() + { + var list = new RepeatedField { 1, 500, 1 }; + var tag = WireFormat.MakeTag(1, WireFormat.WireType.Varint); + // 2 bytes for the first entry, 3 bytes for the second, 2 bytes for the third + Assert.AreEqual(7, list.CalculateSize(FieldCodec.ForInt32(tag))); + } + + [Test] + public void CalculateSize_FixedSizeNonPacked() + { + var list = new RepeatedField { 1, 500, 1 }; + var tag = WireFormat.MakeTag(1, WireFormat.WireType.Fixed32); + // 5 bytes for the each entry + Assert.AreEqual(15, list.CalculateSize(FieldCodec.ForSFixed32(tag))); + } + + [Test] + public void CalculateSize_VariableSizePacked() + { + var list = new RepeatedField { 1, 500, 1}; + var tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + // 1 byte for the tag, 1 byte for the length, + // 1 byte for the first entry, 2 bytes for the second, 1 byte for the third + Assert.AreEqual(6, list.CalculateSize(FieldCodec.ForInt32(tag))); + } + + [Test] + public void CalculateSize_FixedSizePacked() + { + var list = new RepeatedField { 1, 500, 1 }; + var tag = WireFormat.MakeTag(1, WireFormat.WireType.LengthDelimited); + // 1 byte for the tag, 1 byte for the length, 4 bytes per entry + Assert.AreEqual(14, list.CalculateSize(FieldCodec.ForSFixed32(tag))); + } [Test] public void TestNegativeEnumArray() @@ -378,5 +546,100 @@ namespace Google.Protobuf.Collections Assert.AreEqual(((SampleEnum)(-4)), values[4]); Assert.AreEqual(((SampleEnum)(-5)), values[5]); } + + // Fairly perfunctory tests for the non-generic IList implementation + [Test] + public void IList_Indexer() + { + var field = new RepeatedField { "first", "second" }; + IList list = field; + Assert.AreEqual("first", list[0]); + list[1] = "changed"; + Assert.AreEqual("changed", field[1]); + } + + [Test] + public void IList_Contains() + { + IList list = new RepeatedField { "first", "second" }; + Assert.IsTrue(list.Contains("second")); + Assert.IsFalse(list.Contains("third")); + Assert.IsFalse(list.Contains(new object())); + } + + [Test] + public void IList_Add() + { + IList list = new RepeatedField { "first", "second" }; + list.Add("third"); + CollectionAssert.AreEqual(new[] { "first", "second", "third" }, list); + } + + [Test] + public void IList_Remove() + { + IList list = new RepeatedField { "first", "second" }; + list.Remove("third"); // No-op, no exception + list.Remove(new object()); // No-op, no exception + list.Remove("first"); + CollectionAssert.AreEqual(new[] { "second" }, list); + } + + [Test] + public void IList_IsFixedSize() + { + var field = new RepeatedField { "first", "second" }; + IList list = field; + Assert.IsFalse(list.IsFixedSize); + field.Freeze(); + Assert.IsTrue(list.IsFixedSize); + } + + [Test] + public void IList_IndexOf() + { + IList list = new RepeatedField { "first", "second" }; + Assert.AreEqual(1, list.IndexOf("second")); + Assert.AreEqual(-1, list.IndexOf("third")); + Assert.AreEqual(-1, list.IndexOf(new object())); + } + + [Test] + public void IList_SyncRoot() + { + IList list = new RepeatedField { "first", "second" }; + Assert.AreSame(list, list.SyncRoot); + } + + [Test] + public void IList_CopyTo() + { + IList list = new RepeatedField { "first", "second" }; + string[] stringArray = new string[4]; + list.CopyTo(stringArray, 1); + CollectionAssert.AreEqual(new[] { null, "first", "second", null }, stringArray); + + object[] objectArray = new object[4]; + list.CopyTo(objectArray, 1); + CollectionAssert.AreEqual(new[] { null, "first", "second", null }, objectArray); + + Assert.Throws(() => list.CopyTo(new StringBuilder[4], 1)); + Assert.Throws(() => list.CopyTo(new int[4], 1)); + } + + [Test] + public void IList_IsSynchronized() + { + IList list = new RepeatedField { "first", "second" }; + Assert.IsFalse(list.IsSynchronized); + } + + [Test] + public void IList_Insert() + { + IList list = new RepeatedField { "first", "second" }; + list.Insert(1, "middle"); + CollectionAssert.AreEqual(new[] { "first", "middle", "second" }, list); + } } } diff --git a/csharp/src/ProtocolBuffers.Test/EqualityTester.cs b/csharp/src/ProtocolBuffers.Test/EqualityTester.cs index b372443b..a669baba 100644 --- a/csharp/src/ProtocolBuffers.Test/EqualityTester.cs +++ b/csharp/src/ProtocolBuffers.Test/EqualityTester.cs @@ -45,15 +45,20 @@ namespace Google.Protobuf public static void AssertEquality(T first, T second) where T : IEquatable { Assert.IsTrue(first.Equals(second)); + Assert.IsTrue(first.Equals((object) second)); Assert.AreEqual(first.GetHashCode(), second.GetHashCode()); } public static void AssertInequality(T first, T second) where T : IEquatable { Assert.IsFalse(first.Equals(second)); + Assert.IsFalse(first.Equals((object) second)); // While this isn't a requirement, the chances of this test failing due to // coincidence rather than a bug are very small. - Assert.AreNotEqual(first.GetHashCode(), second.GetHashCode()); + if (first != null && second != null) + { + Assert.AreNotEqual(first.GetHashCode(), second.GetHashCode()); + } } } } diff --git a/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs b/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs index a14040d1..c6ed2a21 100644 --- a/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs +++ b/csharp/src/ProtocolBuffers.Test/FieldCodecTest.cs @@ -86,12 +86,22 @@ namespace Google.Protobuf codec.TestDefaultValue(); } + [Test, TestCaseSource("Codecs")] + public void FixedSize(ICodecTestData codec) + { + codec.TestFixedSize(); + } + + // This is ugly, but it means we can have a non-generic interface. + // It feels like NUnit should support this better, but I don't know + // of any better ways right now. public interface ICodecTestData { void TestRoundTripRaw(); void TestRoundTripWithTag(); void TestCalculateSizeWithTag(); void TestDefaultValue(); + void TestFixedSize(); } public class FieldCodecTestData : ICodecTestData @@ -169,6 +179,11 @@ namespace Google.Protobuf } } + public void TestFixedSize() + { + Assert.AreEqual(name.Contains("Fixed"), codec.FixedSize != 0); + } + public override string ToString() { return name; diff --git a/csharp/src/ProtocolBuffers/Collections/MapField.cs b/csharp/src/ProtocolBuffers/Collections/MapField.cs index 779ff061..0f379eaa 100644 --- a/csharp/src/ProtocolBuffers/Collections/MapField.cs +++ b/csharp/src/ProtocolBuffers/Collections/MapField.cs @@ -367,11 +367,13 @@ namespace Google.Protobuf.Collections IDictionaryEnumerator IDictionary.GetEnumerator() { - throw new NotImplementedException(); + return new DictionaryEnumerator(GetEnumerator()); } void IDictionary.Remove(object key) { + ThrowHelper.ThrowIfNull(key, "key"); + this.CheckMutable(); if (!(key is TKey)) { return; @@ -381,7 +383,9 @@ namespace Google.Protobuf.Collections void ICollection.CopyTo(Array array, int index) { - throw new NotImplementedException(); + // This is ugly and slow as heck, but with any luck it will never be used anyway. + ICollection temp = this.Select(pair => new DictionaryEntry(pair.Key, pair.Value)).ToList(); + temp.CopyTo(array, index); } bool IDictionary.IsFixedSize { get { return IsFrozen; } } @@ -392,12 +396,13 @@ namespace Google.Protobuf.Collections bool ICollection.IsSynchronized { get { return false; } } - object ICollection.SyncRoot { get { return null; } } + object ICollection.SyncRoot { get { return this; } } object IDictionary.this[object key] { get { + ThrowHelper.ThrowIfNull(key, "key"); if (!(key is TKey)) { return null; @@ -407,10 +412,42 @@ namespace Google.Protobuf.Collections return value; } - set { this[(TKey)key] = (TValue)value; } + set + { + if (frozen) + { + throw new NotSupportedException("Dictionary is frozen"); + } + this[(TKey)key] = (TValue)value; + } } #endregion + private class DictionaryEnumerator : IDictionaryEnumerator + { + private readonly IEnumerator> enumerator; + + internal DictionaryEnumerator(IEnumerator> enumerator) + { + this.enumerator = enumerator; + } + + public bool MoveNext() + { + return enumerator.MoveNext(); + } + + public void Reset() + { + enumerator.Reset(); + } + + public object Current { get { return Entry; } } + public DictionaryEntry Entry { get { return new DictionaryEntry(Key, Value); } } + public object Key { get { return enumerator.Current.Key; } } + public object Value { get { return enumerator.Current.Value; } } + } + /// /// A codec for a specific map field. This contains all the information required to encoded and /// decode the nested messages. diff --git a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs index ebc711de..b6b52cb9 100644 --- a/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs +++ b/csharp/src/ProtocolBuffers/Collections/RepeatedField.cs @@ -376,6 +376,7 @@ namespace Google.Protobuf.Collections this.CheckMutable(); EnsureSize(count + 1); Array.Copy(array, index, array, index + 1, count - index); + array[index] = item; count++; } @@ -421,18 +422,12 @@ namespace Google.Protobuf.Collections void ICollection.CopyTo(Array array, int index) { - ThrowHelper.ThrowIfNull(array, "array"); - T[] strongArray = array as T[]; - if (strongArray == null) - { - throw new ArgumentException("Array is of incorrect type", "array"); - } - CopyTo(strongArray, index); + Array.Copy(this.array, 0, array, index, count); } bool ICollection.IsSynchronized { get { return false; } } - object ICollection.SyncRoot { get { return null; } } + object ICollection.SyncRoot { get { return this; } } object IList.this[int index] { @@ -490,6 +485,7 @@ namespace Google.Protobuf.Collections { if (index + 1 >= field.Count) { + index = field.Count; return false; } index++; diff --git a/csharp/src/ProtocolBuffers/FieldCodec.cs b/csharp/src/ProtocolBuffers/FieldCodec.cs index 2cebc1bb..c72a3e7b 100644 --- a/csharp/src/ProtocolBuffers/FieldCodec.cs +++ b/csharp/src/ProtocolBuffers/FieldCodec.cs @@ -68,12 +68,12 @@ namespace Google.Protobuf public static FieldCodec ForFixed32(uint tag) { - return new FieldCodec(input => input.ReadFixed32(), (output, value) => output.WriteFixed32(value), CodedOutputStream.ComputeFixed32Size, tag); + return new FieldCodec(input => input.ReadFixed32(), (output, value) => output.WriteFixed32(value), 4, tag); } public static FieldCodec ForSFixed32(uint tag) { - return new FieldCodec(input => input.ReadSFixed32(), (output, value) => output.WriteSFixed32(value), CodedOutputStream.ComputeSFixed32Size, tag); + return new FieldCodec(input => input.ReadSFixed32(), (output, value) => output.WriteSFixed32(value), 4, tag); } public static FieldCodec ForUInt32(uint tag) @@ -93,12 +93,12 @@ namespace Google.Protobuf public static FieldCodec ForFixed64(uint tag) { - return new FieldCodec(input => input.ReadFixed64(), (output, value) => output.WriteFixed64(value), CodedOutputStream.ComputeFixed64Size, tag); + return new FieldCodec(input => input.ReadFixed64(), (output, value) => output.WriteFixed64(value), 8, tag); } public static FieldCodec ForSFixed64(uint tag) { - return new FieldCodec(input => input.ReadSFixed64(), (output, value) => output.WriteSFixed64(value), CodedOutputStream.ComputeSFixed64Size, tag); + return new FieldCodec(input => input.ReadSFixed64(), (output, value) => output.WriteSFixed64(value), 8, tag); } public static FieldCodec ForUInt64(uint tag) -- cgit v1.2.3