diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-07-22 10:36:06 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-07-22 10:36:06 -0700 |
commit | 7b5c3967991b6534f439cb31b0d247501f4a0ef8 (patch) | |
tree | e161b4bfaa308ca173ee9a8b2ff858c5b76b618b /csharp/src/Google.Protobuf.Test | |
parent | 2ee4b5665520fe3245eb5e15df8bd35e0c539a07 (diff) | |
parent | 43d64b4f54c8cf9521aded37fc695faba28793ee (diff) | |
download | protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.gz protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.tar.bz2 protobuf-7b5c3967991b6534f439cb31b0d247501f4a0ef8.zip |
Merge pull request #625 from jskeet/reflection-refactor
Reflection refactor
Diffstat (limited to 'csharp/src/Google.Protobuf.Test')
9 files changed, 231 insertions, 518 deletions
diff --git a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs index acb20b15..180976d1 100644 --- a/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs +++ b/csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs @@ -604,7 +604,7 @@ namespace Google.Protobuf public void Reflection_GetValue()
{
var message = SampleMessages.CreateFullTestAllTypes();
- var fields = ((IReflectedMessage) message).Fields;
+ var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber;
Assert.AreEqual(message.SingleBool, fields[TestAllTypes.SingleBoolFieldNumber].GetValue(message));
Assert.AreEqual(message.SingleBytes, fields[TestAllTypes.SingleBytesFieldNumber].GetValue(message));
Assert.AreEqual(message.SingleDouble, fields[TestAllTypes.SingleDoubleFieldNumber].GetValue(message));
@@ -639,7 +639,7 @@ namespace Google.Protobuf // Just a single map field, for the same reason
var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } };
- fields = ((IReflectedMessage) mapMessage).Fields;
+ fields = TestMap.Descriptor.FieldAccessorsByFieldNumber;
var dictionary = (IDictionary) fields[TestMap.MapStringStringFieldNumber].GetValue(mapMessage);
Assert.AreEqual(mapMessage.MapStringString, dictionary);
Assert.AreEqual("value1", dictionary["key1"]);
@@ -648,8 +648,8 @@ namespace Google.Protobuf [Test]
public void Reflection_Clear()
{
- IReflectedMessage message = SampleMessages.CreateFullTestAllTypes();
- var fields = message.Fields;
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber;
fields[TestAllTypes.SingleBoolFieldNumber].Clear(message);
fields[TestAllTypes.SingleInt32FieldNumber].Clear(message);
fields[TestAllTypes.SingleStringFieldNumber].Clear(message);
@@ -673,7 +673,7 @@ namespace Google.Protobuf // Separately, maps.
var mapMessage = new TestMap { MapStringString = { { "key1", "value1" }, { "key2", "value2" } } };
- fields = ((IReflectedMessage) mapMessage).Fields;
+ fields = TestMap.Descriptor.FieldAccessorsByFieldNumber;
fields[TestMap.MapStringStringFieldNumber].Clear(mapMessage);
Assert.AreEqual(0, mapMessage.MapStringString.Count);
}
@@ -682,8 +682,8 @@ namespace Google.Protobuf public void Reflection_SetValue_SingleFields()
{
// Just a sample (primitives, messages, enums, strings, byte strings)
- IReflectedMessage message = SampleMessages.CreateFullTestAllTypes();
- var fields = message.Fields;
+ var message = SampleMessages.CreateFullTestAllTypes();
+ var fields = TestAllTypes.Descriptor.FieldAccessorsByFieldNumber;
fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, false);
fields[TestAllTypes.SingleInt32FieldNumber].SetValue(message, 500);
fields[TestAllTypes.SingleStringFieldNumber].SetValue(message, "It's a string");
@@ -709,51 +709,52 @@ namespace Google.Protobuf [Test]
public void Reflection_SetValue_SingleFields_WrongType()
{
- IReflectedMessage message = SampleMessages.CreateFullTestAllTypes();
- var fields = message.Fields;
+ IMessage message = SampleMessages.CreateFullTestAllTypes();
+ var fields = message.Descriptor.FieldAccessorsByFieldNumber;
Assert.Throws<InvalidCastException>(() => fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, "This isn't a bool"));
}
[Test]
public void Reflection_SetValue_MapFields()
{
- IReflectedMessage message = new TestMap();
- var fields = message.Fields;
+ IMessage message = new TestMap();
+ var fields = message.Descriptor.FieldAccessorsByFieldNumber;
Assert.Throws<InvalidOperationException>(() => fields[TestMap.MapStringStringFieldNumber].SetValue(message, new Dictionary<string, string>()));
}
[Test]
public void Reflection_SetValue_RepeatedFields()
{
- IReflectedMessage message = SampleMessages.CreateFullTestAllTypes();
- var fields = message.Fields;
+ IMessage message = SampleMessages.CreateFullTestAllTypes();
+ var fields = message.Descriptor.FieldAccessorsByFieldNumber;
Assert.Throws<InvalidOperationException>(() => fields[TestAllTypes.RepeatedDoubleFieldNumber].SetValue(message, new double[10]));
}
[Test]
public void Reflection_GetValue_IncorrectType()
{
- IReflectedMessage message = SampleMessages.CreateFullTestAllTypes();
- Assert.Throws<InvalidCastException>(() => message.Fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap()));
+ IMessage message = SampleMessages.CreateFullTestAllTypes();
+ var fields = message.Descriptor.FieldAccessorsByFieldNumber;
+ Assert.Throws<InvalidCastException>(() => fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap()));
}
[Test]
public void Reflection_Oneof()
{
var message = new TestAllTypes();
- var fields = ((IReflectedMessage) message).Fields;
- Assert.AreEqual(1, fields.Oneofs.Count);
- var oneof = fields.Oneofs[0];
- Assert.AreEqual("oneof_field", oneof.Descriptor.Name);
- Assert.IsNull(oneof.GetCaseFieldDescriptor(message));
+ var descriptor = TestAllTypes.Descriptor;
+ Assert.AreEqual(1, descriptor.Oneofs.Count);
+ var oneof = descriptor.Oneofs[0];
+ Assert.AreEqual("oneof_field", oneof.Name);
+ Assert.IsNull(oneof.Accessor.GetCaseFieldDescriptor(message));
message.OneofString = "foo";
- Assert.AreSame(fields[TestAllTypes.OneofStringFieldNumber].Descriptor, oneof.GetCaseFieldDescriptor(message));
+ Assert.AreSame(descriptor.FieldAccessorsByFieldNumber[TestAllTypes.OneofStringFieldNumber].Descriptor, oneof.Accessor.GetCaseFieldDescriptor(message));
message.OneofUint32 = 10;
- Assert.AreSame(fields[TestAllTypes.OneofUint32FieldNumber].Descriptor, oneof.GetCaseFieldDescriptor(message));
+ Assert.AreSame(descriptor.FieldAccessorsByFieldNumber[TestAllTypes.OneofUint32FieldNumber].Descriptor, oneof.Accessor.GetCaseFieldDescriptor(message));
- oneof.Clear(message);
+ oneof.Accessor.Clear(message);
Assert.AreEqual(TestAllTypes.OneofFieldOneofCase.None, message.OneofFieldCase);
}
}
diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs index 0db01a5e..0aff0a6c 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs @@ -62,6 +62,7 @@ namespace Google.Protobuf.Reflection Assert.AreEqual(UnittestImportProto3.Descriptor, file.Dependencies[0]); MessageDescriptor messageType = TestAllTypes.Descriptor; + Assert.AreSame(typeof(TestAllTypes), messageType.GeneratedType); Assert.AreEqual(messageType, file.MessageTypes[0]); Assert.AreEqual(messageType, file.FindTypeByName<MessageDescriptor>("TestAllTypes")); Assert.Null(file.FindTypeByName<MessageDescriptor>("NoSuchType")); diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs index 5f6eae0c..7da82bf0 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs @@ -12,15 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MapUnittestProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -153,32 +144,18 @@ namespace Google.Protobuf.TestProtos { "dHJ5LkVudHJ5RW50cnkaLAoKRW50cnlFbnRyeRILCgNrZXkYASABKAUSDQoF", "dmFsdWUYAiABKAU6AjgBKj8KB01hcEVudW0SEAoMTUFQX0VOVU1fRk9PEAAS", "EAoMTUFQX0VOVU1fQkFSEAESEAoMTUFQX0VOVU1fQkFaEAJCIPgBAaoCGkdv", - "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); + "b2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, - }); - internal__static_protobuf_unittest_TestMap__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMap), descriptor.MessageTypes[0], - new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapInt32Bytes", "MapInt32Enum", "MapInt32ForeignMessage", }, new string[] { }); - internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), descriptor.MessageTypes[1], - new string[] { "TestMap", }, new string[] { }); - internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMessageMap), descriptor.MessageTypes[2], - new string[] { "MapInt32Message", }, new string[] { }); - internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), descriptor.MessageTypes[3], - new string[] { "Map1", "Map2", }, new string[] { }); - internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestArenaMap), descriptor.MessageTypes[4], - new string[] { "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapInt32Enum", "MapInt32ForeignMessage", }, new string[] { }); - internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), descriptor.MessageTypes[5], - new string[] { "Type", }, new string[] { }); - internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), descriptor.MessageTypes[6], - new string[] { "Entry", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor, }, + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.MapEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMap), new[]{ "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapStringString", "MapInt32Bytes", "MapInt32Enum", "MapInt32ForeignMessage" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMapSubmessage), new[]{ "TestMap" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMessageMap), new[]{ "MapInt32Message" }, null, null, new pbr::GeneratedCodeInfo[] { null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestSameTypeMap), new[]{ "Map1", "Map2" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestArenaMap), new[]{ "MapInt32Int32", "MapInt64Int64", "MapUint32Uint32", "MapUint64Uint64", "MapSint32Sint32", "MapSint64Sint64", "MapFixed32Fixed32", "MapFixed64Fixed64", "MapSfixed32Sfixed32", "MapSfixed64Sfixed64", "MapInt32Float", "MapInt32Double", "MapBoolBool", "MapInt32Enum", "MapInt32ForeignMessage" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType), new[]{ "Type" }, null, new[]{ typeof(global::Google.Protobuf.TestProtos.MessageContainingEnumCalledType.Types.Type) }, new pbr::GeneratedCodeInfo[] { null, }), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MessageContainingMapCalledEntry), new[]{ "Entry" }, null, null, new pbr::GeneratedCodeInfo[] { null, }) + })); } #endregion @@ -198,14 +175,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestMap> _parser = new pb::MessageParser<TestMap>(() => new TestMap()); public static pb::MessageParser<TestMap> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "map_bool_bool", "map_fixed32_fixed32", "map_fixed64_fixed64", "map_int32_bytes", "map_int32_double", "map_int32_enum", "map_int32_float", "map_int32_foreign_message", "map_int32_int32", "map_int64_int64", "map_sfixed32_sfixed32", "map_sfixed64_sfixed64", "map_sint32_sint32", "map_sint64_sint64", "map_string_string", "map_uint32_uint32", "map_uint64_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 106, 58, 66, 122, 98, 130, 90, 138, 10, 18, 74, 82, 42, 50, 114, 26, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMap__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -613,14 +588,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestMapSubmessage> _parser = new pb::MessageParser<TestMapSubmessage>(() => new TestMapSubmessage()); public static pb::MessageParser<TestMapSubmessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "test_map" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMapSubmessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -739,14 +712,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestMessageMap> _parser = new pb::MessageParser<TestMessageMap>(() => new TestMessageMap()); public static pb::MessageParser<TestMessageMap> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "map_int32_message" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestMessageMap__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -850,14 +821,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestSameTypeMap> _parser = new pb::MessageParser<TestSameTypeMap>(() => new TestSameTypeMap()); public static pb::MessageParser<TestSameTypeMap> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "map1", "map2" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestSameTypeMap__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -980,14 +949,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestArenaMap> _parser = new pb::MessageParser<TestArenaMap>(() => new TestArenaMap()); public static pb::MessageParser<TestArenaMap> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "map_bool_bool", "map_fixed32_fixed32", "map_fixed64_fixed64", "map_int32_double", "map_int32_enum", "map_int32_float", "map_int32_foreign_message", "map_int32_int32", "map_int64_int64", "map_sfixed32_sfixed32", "map_sfixed64_sfixed64", "map_sint32_sint32", "map_sint64_sint64", "map_uint32_uint32", "map_uint64_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 106, 58, 66, 98, 114, 90, 122, 10, 18, 74, 82, 42, 50, 26, 34 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_TestArenaMap__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1357,14 +1324,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<MessageContainingEnumCalledType> _parser = new pb::MessageParser<MessageContainingEnumCalledType>(() => new MessageContainingEnumCalledType()); public static pb::MessageParser<MessageContainingEnumCalledType> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "type" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingEnumCalledType__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1478,14 +1443,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<MessageContainingMapCalledEntry> _parser = new pb::MessageParser<MessageContainingMapCalledEntry>(() => new MessageContainingMapCalledEntry()); public static pb::MessageParser<MessageContainingMapCalledEntry> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "entry" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.MapUnittestProto3.internal__static_protobuf_unittest_MessageContainingMapCalledEntry__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs index 3875a4c3..517225b6 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs @@ -12,9 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -31,14 +28,12 @@ namespace Google.Protobuf.TestProtos { "VU1fVU5TUEVDSUZJRUQQABIOCgpJTVBPUlRfRk9PEAcSDgoKSU1QT1JUX0JB", "UhAIEg4KCklNUE9SVF9CQVoQCUI8Chhjb20uZ29vZ2xlLnByb3RvYnVmLnRl", "c3RIAfgBAaoCGkdvb2dsZS5Qcm90b2J1Zi5UZXN0UHJvdG9zUABiBnByb3Rv", - "Mw==")); + "Mw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, - }); - internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ImportMessage), descriptor.MessageTypes[0], - new string[] { "D", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor, }, + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ImportEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.ImportMessage), new[]{ "D" }, null, null, null) + })); } #endregion @@ -59,14 +54,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<ImportMessage> _parser = new pb::MessageParser<ImportMessage>(() => new ImportMessage()); public static pb::MessageParser<ImportMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "d" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestImportProto3.internal__static_protobuf_unittest_import_ImportMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs index 048ae5e9..11ec29dd 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs @@ -12,9 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestImportPublicProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -27,13 +24,12 @@ namespace Google.Protobuf.TestProtos { "CjNnb29nbGUvcHJvdG9idWYvdW5pdHRlc3RfaW1wb3J0X3B1YmxpY19wcm90", "bzMucHJvdG8SGHByb3RvYnVmX3VuaXR0ZXN0X2ltcG9ydCIgChNQdWJsaWNJ", "bXBvcnRNZXNzYWdlEgkKAWUYASABKAVCNwoYY29tLmdvb2dsZS5wcm90b2J1", - "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); + "Zi50ZXN0qgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), descriptor.MessageTypes[0], - new string[] { "E", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.PublicImportMessage), new[]{ "E" }, null, null, null) + })); } #endregion @@ -44,14 +40,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<PublicImportMessage> _parser = new pb::MessageParser<PublicImportMessage>(() => new PublicImportMessage()); public static pb::MessageParser<PublicImportMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "e" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestImportPublicProto3.internal__static_protobuf_unittest_import_PublicImportMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs index c68c67fb..07466650 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs @@ -12,15 +12,6 @@ namespace UnitTest.Issues.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestIssues { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_unittest_issues_ItemField__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -47,31 +38,16 @@ namespace UnitTest.Issues.TestProtos { "dGl2ZUVudW0SFgoSTkVHQVRJVkVfRU5VTV9aRVJPEAASFgoJRml2ZUJlbG93", "EPv//////////wESFQoITWludXNPbmUQ////////////ASouCg5EZXByZWNh", "dGVkRW51bRITCg9ERVBSRUNBVEVEX1pFUk8QABIHCgNvbmUQAUIfSAGqAhpV", - "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); + "bml0VGVzdC5Jc3N1ZXMuVGVzdFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - }); - internal__static_unittest_issues_Issue307__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307), descriptor.MessageTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), descriptor.MessageTypes[0].NestedTypes[0].NestedTypes[0], - new string[] { }, new string[] { }); - internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), descriptor.MessageTypes[1], - new string[] { "Value", "Values", "PackedValues", }, new string[] { }); - internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), descriptor.MessageTypes[2], - new string[] { }, new string[] { }); - internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), descriptor.MessageTypes[3], - new string[] { "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray", }, new string[] { }); - internal__static_unittest_issues_ItemField__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::UnitTest.Issues.TestProtos.ItemField), descriptor.MessageTypes[4], - new string[] { "Item", }, new string[] { }); + new pbr::FileDescriptor[] { }, + new pbr::GeneratedCodeInfo(new[] {typeof(global::UnitTest.Issues.TestProtos.NegativeEnum), typeof(global::UnitTest.Issues.TestProtos.DeprecatedEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce), null, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Types.NestedTwice), null, null, null, null)})}), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.NegativeEnumMessage), new[]{ "Value", "Values", "PackedValues" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedChild), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.DeprecatedFieldsMessage), new[]{ "PrimitiveValue", "PrimitiveArray", "MessageValue", "MessageArray", "EnumValue", "EnumArray" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::UnitTest.Issues.TestProtos.ItemField), new[]{ "Item" }, null, null, null) + })); } #endregion @@ -96,14 +72,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<Issue307> _parser = new pb::MessageParser<Issue307>(() => new Issue307()); public static pb::MessageParser<Issue307> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -189,14 +163,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<NestedOnce> _parser = new pb::MessageParser<NestedOnce>(() => new NestedOnce()); public static pb::MessageParser<NestedOnce> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -282,14 +254,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<NestedTwice> _parser = new pb::MessageParser<NestedTwice>(() => new NestedTwice()); public static pb::MessageParser<NestedTwice> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.Issue307.Types.NestedOnce.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_Issue307_NestedOnce_NestedTwice__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -384,14 +354,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<NegativeEnumMessage> _parser = new pb::MessageParser<NegativeEnumMessage>(() => new NegativeEnumMessage()); public static pb::MessageParser<NegativeEnumMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "packed_values", "value", "values" }; - private static readonly uint[] _fieldTags = new uint[] { 26, 8, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_NegativeEnumMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -434,14 +402,16 @@ namespace UnitTest.Issues.TestProtos { public const int ValuesFieldNumber = 2; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_values_codec - = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); + = pb::FieldCodec.ForEnum(16, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); + private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> values_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> Values { get { return values_; } } public const int PackedValuesFieldNumber = 3; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.NegativeEnum> _repeated_packedValues_codec - = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x);private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); + = pb::FieldCodec.ForEnum(26, x => (int) x, x => (global::UnitTest.Issues.TestProtos.NegativeEnum) x); + private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> packedValues_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum>(); public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.NegativeEnum> PackedValues { get { return packedValues_; } } @@ -541,14 +511,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<DeprecatedChild> _parser = new pb::MessageParser<DeprecatedChild>(() => new DeprecatedChild()); public static pb::MessageParser<DeprecatedChild> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedChild__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -633,14 +601,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<DeprecatedFieldsMessage> _parser = new pb::MessageParser<DeprecatedFieldsMessage>(() => new DeprecatedFieldsMessage()); public static pb::MessageParser<DeprecatedFieldsMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "EnumArray", "EnumValue", "MessageArray", "MessageValue", "PrimitiveArray", "PrimitiveValue" }; - private static readonly uint[] _fieldTags = new uint[] { 50, 40, 34, 26, 18, 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_DeprecatedFieldsMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -729,7 +695,8 @@ namespace UnitTest.Issues.TestProtos { public const int EnumArrayFieldNumber = 6; private static readonly pb::FieldCodec<global::UnitTest.Issues.TestProtos.DeprecatedEnum> _repeated_enumArray_codec - = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x);private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>(); + = pb::FieldCodec.ForEnum(50, x => (int) x, x => (global::UnitTest.Issues.TestProtos.DeprecatedEnum) x); + private readonly pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> enumArray_ = new pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum>(); [global::System.ObsoleteAttribute()] public pbc::RepeatedField<global::UnitTest.Issues.TestProtos.DeprecatedEnum> EnumArray { get { return enumArray_; } @@ -877,14 +844,12 @@ namespace UnitTest.Issues.TestProtos { private static readonly pb::MessageParser<ItemField> _parser = new pb::MessageParser<ItemField>(() => new ItemField()); public static pb::MessageParser<ItemField> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "item" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::UnitTest.Issues.TestProtos.UnittestIssues.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::UnitTest.Issues.TestProtos.UnittestIssues.internal__static_unittest_issues_ItemField__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs index 67c42708..3d72c5a0 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs @@ -12,43 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestProto3 { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneString__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MoreString__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -184,116 +147,44 @@ namespace Google.Protobuf.TestProtos { "cXVlc3QaHi5wcm90b2J1Zl91bml0dGVzdC5Gb29SZXNwb25zZRJECgNCYXIS", "HS5wcm90b2J1Zl91bml0dGVzdC5CYXJSZXF1ZXN0Gh4ucHJvdG9idWZfdW5p", "dHRlc3QuQmFyUmVzcG9uc2VCOkINVW5pdHRlc3RQcm90b0gBgAEBiAEBkAEB", - "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); + "+AEBqgIaR29vZ2xlLlByb3RvYnVmLlRlc3RQcm90b3NiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, - }); - internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestAllTypes), descriptor.MessageTypes[0], - new string[] { "SingleInt32", "SingleInt64", "SingleUint32", "SingleUint64", "SingleSint32", "SingleSint64", "SingleFixed32", "SingleFixed64", "SingleSfixed32", "SingleSfixed64", "SingleFloat", "SingleDouble", "SingleBool", "SingleString", "SingleBytes", "SingleNestedMessage", "SingleForeignMessage", "SingleImportMessage", "SingleNestedEnum", "SingleForeignEnum", "SingleImportEnum", "SinglePublicImportMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedPublicImportMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes", }, new string[] { "OneofField", }); - internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), descriptor.MessageTypes[0].NestedTypes[0], - new string[] { "Bb", }, new string[] { }); - internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), descriptor.MessageTypes[1], - new string[] { "Child", "Payload", "RepeatedChild", }, new string[] { }); - internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), descriptor.MessageTypes[2], - new string[] { "DeprecatedInt32", }, new string[] { }); - internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.ForeignMessage), descriptor.MessageTypes[3], - new string[] { "C", }, new string[] { }); - internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReservedFields), descriptor.MessageTypes[4], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestForeignNested), descriptor.MessageTypes[5], - new string[] { "ForeignNested", }, new string[] { }); - internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), descriptor.MessageTypes[6], - new string[] { "A", "Bb", }, new string[] { }); - internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), descriptor.MessageTypes[7], - new string[] { "A", "I", }, new string[] { }); - internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), descriptor.MessageTypes[8], - new string[] { "Bb", }, new string[] { }); - internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), descriptor.MessageTypes[9], - new string[] { "A", "OptionalInt32", }, new string[] { }); - internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), descriptor.MessageTypes[10], - new string[] { "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField", }, new string[] { }); - internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), descriptor.MessageTypes[11], - new string[] { "MyString", "MyInt", "MyFloat", "SingleNestedMessage", }, new string[] { }); - internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), descriptor.MessageTypes[11].NestedTypes[0], - new string[] { "Oo", "Bb", }, new string[] { }); - internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), descriptor.MessageTypes[12], - new string[] { "SparseEnum", }, new string[] { }); - internal__static_protobuf_unittest_OneString__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneString), descriptor.MessageTypes[13], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_MoreString__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreString), descriptor.MessageTypes[14], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_OneBytes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneBytes), descriptor.MessageTypes[15], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MoreBytes), descriptor.MessageTypes[16], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Int32Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int32Message), descriptor.MessageTypes[17], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint32Message), descriptor.MessageTypes[18], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Int64Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Int64Message), descriptor.MessageTypes[19], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.Uint64Message), descriptor.MessageTypes[20], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BoolMessage), descriptor.MessageTypes[21], - new string[] { "Data", }, new string[] { }); - internal__static_protobuf_unittest_TestOneof__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestOneof), descriptor.MessageTypes[22], - new string[] { "FooInt", "FooString", "FooMessage", }, new string[] { "Foo", }); - internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), descriptor.MessageTypes[23], - new string[] { "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum", }, new string[] { }); - internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), descriptor.MessageTypes[24], - new string[] { "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum", }, new string[] { }); - internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), descriptor.MessageTypes[25], - new string[] { "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64", }, new string[] { }); - internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), descriptor.MessageTypes[26], - new string[] { "A", }, new string[] { }); - internal__static_protobuf_unittest_FooRequest__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooRequest), descriptor.MessageTypes[27], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooResponse__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooResponse), descriptor.MessageTypes[28], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), descriptor.MessageTypes[29], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), descriptor.MessageTypes[30], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_BarRequest__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarRequest), descriptor.MessageTypes[31], - new string[] { }, new string[] { }); - internal__static_protobuf_unittest_BarResponse__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.BarResponse), descriptor.MessageTypes[32], - new string[] { }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.TestProtos.UnittestImportProto3.Descriptor, }, + new pbr::GeneratedCodeInfo(new[] {typeof(global::Google.Protobuf.TestProtos.ForeignEnum), typeof(global::Google.Protobuf.TestProtos.TestEnumWithDupValue), typeof(global::Google.Protobuf.TestProtos.TestSparseEnum), }, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestAllTypes), new[]{ "SingleInt32", "SingleInt64", "SingleUint32", "SingleUint64", "SingleSint32", "SingleSint64", "SingleFixed32", "SingleFixed64", "SingleSfixed32", "SingleSfixed64", "SingleFloat", "SingleDouble", "SingleBool", "SingleString", "SingleBytes", "SingleNestedMessage", "SingleForeignMessage", "SingleImportMessage", "SingleNestedEnum", "SingleForeignEnum", "SingleImportEnum", "SinglePublicImportMessage", "RepeatedInt32", "RepeatedInt64", "RepeatedUint32", "RepeatedUint64", "RepeatedSint32", "RepeatedSint64", "RepeatedFixed32", "RepeatedFixed64", "RepeatedSfixed32", "RepeatedSfixed64", "RepeatedFloat", "RepeatedDouble", "RepeatedBool", "RepeatedString", "RepeatedBytes", "RepeatedNestedMessage", "RepeatedForeignMessage", "RepeatedImportMessage", "RepeatedNestedEnum", "RepeatedForeignEnum", "RepeatedImportEnum", "RepeatedPublicImportMessage", "OneofUint32", "OneofNestedMessage", "OneofString", "OneofBytes" }, new[]{ "OneofField" }, new[]{ typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) }, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedMessage), new[]{ "Bb" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.NestedTestAllTypes), new[]{ "Child", "Payload", "RepeatedChild" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestDeprecatedFields), new[]{ "DeprecatedInt32" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.ForeignMessage), new[]{ "C" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestReservedFields), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestForeignNested), new[]{ "ForeignNested" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestReallyLargeTagNumber), new[]{ "A", "Bb" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestRecursiveMessage), new[]{ "A", "I" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionA), new[]{ "Bb" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestMutualRecursionB), new[]{ "A", "OptionalInt32" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestCamelCaseFieldNames), new[]{ "PrimitiveField", "StringField", "EnumField", "MessageField", "RepeatedPrimitiveField", "RepeatedStringField", "RepeatedEnumField", "RepeatedMessageField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings), new[]{ "MyString", "MyInt", "MyFloat", "SingleNestedMessage" }, null, null, new pbr::GeneratedCodeInfo[] { new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestFieldOrderings.Types.NestedMessage), new[]{ "Oo", "Bb" }, null, null, null)}), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.SparseEnumMessage), new[]{ "SparseEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneString), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MoreString), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneBytes), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MoreBytes), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Int32Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Uint32Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Int64Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.Uint64Message), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BoolMessage), new[]{ "Data" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestOneof), new[]{ "FooInt", "FooString", "FooMessage" }, new[]{ "Foo" }, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestPackedTypes), new[]{ "PackedInt32", "PackedInt64", "PackedUint32", "PackedUint64", "PackedSint32", "PackedSint64", "PackedFixed32", "PackedFixed64", "PackedSfixed32", "PackedSfixed64", "PackedFloat", "PackedDouble", "PackedBool", "PackedEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestUnpackedTypes), new[]{ "UnpackedInt32", "UnpackedInt64", "UnpackedUint32", "UnpackedUint64", "UnpackedSint32", "UnpackedSint64", "UnpackedFixed32", "UnpackedFixed64", "UnpackedSfixed32", "UnpackedSfixed64", "UnpackedFloat", "UnpackedDouble", "UnpackedBool", "UnpackedEnum" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestRepeatedScalarDifferentTagSizes), new[]{ "RepeatedFixed32", "RepeatedInt32", "RepeatedFixed64", "RepeatedInt64", "RepeatedFloat", "RepeatedUint64" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestCommentInjectionMessage), new[]{ "A" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooRequest), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooResponse), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooClientMessage), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.FooServerMessage), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BarRequest), null, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.BarResponse), null, null, null, null) + })); } #endregion @@ -333,14 +224,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestAllTypes> _parser = new pb::MessageParser<TestAllTypes>(() => new TestAllTypes()); public static pb::MessageParser<TestAllTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "oneof_bytes", "oneof_nested_message", "oneof_string", "oneof_uint32", "repeated_bool", "repeated_bytes", "repeated_double", "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_foreign_enum", "repeated_foreign_message", "repeated_import_enum", "repeated_import_message", "repeated_int32", "repeated_int64", "repeated_nested_enum", "repeated_nested_message", "repeated_public_import_message", "repeated_sfixed32", "repeated_sfixed64", "repeated_sint32", "repeated_sint64", "repeated_string", "repeated_uint32", "repeated_uint64", "single_bool", "single_bytes", "single_double", "single_fixed32", "single_fixed64", "single_float", "single_foreign_enum", "single_foreign_message", "single_import_enum", "single_import_message", "single_int32", "single_int64", "single_nested_enum", "single_nested_message", "single_public_import_message", "single_sfixed32", "single_sfixed64", "single_sint32", "single_sint64", "single_string", "single_uint32", "single_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 914, 898, 906, 888, 346, 362, 338, 298, 306, 330, 418, 394, 426, 402, 250, 258, 410, 386, 434, 314, 322, 282, 290, 354, 266, 274, 104, 122, 97, 61, 65, 93, 176, 154, 184, 162, 8, 16, 168, 146, 210, 77, 81, 40, 48, 114, 24, 32 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -818,21 +707,24 @@ namespace Google.Protobuf.TestProtos { public const int RepeatedNestedEnumFieldNumber = 51; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum> _repeated_repeatedNestedEnum_codec - = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum> repeatedNestedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum>(); + = pb::FieldCodec.ForEnum(410, x => (int) x, x => (global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum> repeatedNestedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.TestAllTypes.Types.NestedEnum> RepeatedNestedEnum { get { return repeatedNestedEnum_; } } public const int RepeatedForeignEnumFieldNumber = 52; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_repeatedForeignEnum_codec - = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> repeatedForeignEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); + = pb::FieldCodec.ForEnum(418, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> repeatedForeignEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> RepeatedForeignEnum { get { return repeatedForeignEnum_; } } public const int RepeatedImportEnumFieldNumber = 53; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ImportEnum> _repeated_repeatedImportEnum_codec - = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ImportEnum> repeatedImportEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ImportEnum>(); + = pb::FieldCodec.ForEnum(426, x => (int) x, x => (global::Google.Protobuf.TestProtos.ImportEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ImportEnum> repeatedImportEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ImportEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.ImportEnum> RepeatedImportEnum { get { return repeatedImportEnum_; } } @@ -1634,14 +1526,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage()); public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestAllTypes.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestAllTypes_NestedMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1758,14 +1648,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<NestedTestAllTypes> _parser = new pb::MessageParser<NestedTestAllTypes>(() => new NestedTestAllTypes()); public static pb::MessageParser<NestedTestAllTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "child", "payload", "repeated_child" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 26 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_NestedTestAllTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1937,14 +1825,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestDeprecatedFields> _parser = new pb::MessageParser<TestDeprecatedFields>(() => new TestDeprecatedFields()); public static pb::MessageParser<TestDeprecatedFields> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "deprecated_int32" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestDeprecatedFields__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2057,14 +1943,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<ForeignMessage> _parser = new pb::MessageParser<ForeignMessage>(() => new ForeignMessage()); public static pb::MessageParser<ForeignMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "c" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_ForeignMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2176,14 +2060,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestReservedFields> _parser = new pb::MessageParser<TestReservedFields>(() => new TestReservedFields()); public static pb::MessageParser<TestReservedFields> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[4]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReservedFields__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2268,14 +2150,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestForeignNested> _parser = new pb::MessageParser<TestForeignNested>(() => new TestForeignNested()); public static pb::MessageParser<TestForeignNested> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "foreign_nested" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[5]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestForeignNested__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2394,14 +2274,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestReallyLargeTagNumber> _parser = new pb::MessageParser<TestReallyLargeTagNumber>(() => new TestReallyLargeTagNumber()); public static pb::MessageParser<TestReallyLargeTagNumber> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 2147483640 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[6]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestReallyLargeTagNumber__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2540,14 +2418,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestRecursiveMessage> _parser = new pb::MessageParser<TestRecursiveMessage>(() => new TestRecursiveMessage()); public static pb::MessageParser<TestRecursiveMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "i" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[7]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRecursiveMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2693,14 +2569,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestMutualRecursionA> _parser = new pb::MessageParser<TestMutualRecursionA>(() => new TestMutualRecursionA()); public static pb::MessageParser<TestMutualRecursionA> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[8]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionA__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2819,14 +2693,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestMutualRecursionB> _parser = new pb::MessageParser<TestMutualRecursionB>(() => new TestMutualRecursionB()); public static pb::MessageParser<TestMutualRecursionB> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a", "optional_int32" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[9]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestMutualRecursionB__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2972,14 +2844,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestCamelCaseFieldNames> _parser = new pb::MessageParser<TestCamelCaseFieldNames>(() => new TestCamelCaseFieldNames()); public static pb::MessageParser<TestCamelCaseFieldNames> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "EnumField", "MessageField", "PrimitiveField", "RepeatedEnumField", "RepeatedMessageField", "RepeatedPrimitiveField", "RepeatedStringField", "StringField" }; - private static readonly uint[] _fieldTags = new uint[] { 24, 34, 8, 74, 82, 58, 66, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[10]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCamelCaseFieldNames__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3076,7 +2946,8 @@ namespace Google.Protobuf.TestProtos { public const int RepeatedEnumFieldFieldNumber = 9; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_repeatedEnumField_codec - = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> repeatedEnumField_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); + = pb::FieldCodec.ForEnum(74, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> repeatedEnumField_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> RepeatedEnumField { get { return repeatedEnumField_; } } @@ -3256,14 +3127,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestFieldOrderings> _parser = new pb::MessageParser<TestFieldOrderings>(() => new TestFieldOrderings()); public static pb::MessageParser<TestFieldOrderings> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "my_float", "my_int", "my_string", "single_nested_message" }; - private static readonly uint[] _fieldTags = new uint[] { 813, 8, 90, 1602 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[11]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3464,14 +3333,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<NestedMessage> _parser = new pb::MessageParser<NestedMessage>(() => new NestedMessage()); public static pb::MessageParser<NestedMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "bb", "oo" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 16 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.TestFieldOrderings.Descriptor.NestedTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestFieldOrderings_NestedMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3615,14 +3482,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<SparseEnumMessage> _parser = new pb::MessageParser<SparseEnumMessage>(() => new SparseEnumMessage()); public static pb::MessageParser<SparseEnumMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "sparse_enum" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[12]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_SparseEnumMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3734,14 +3599,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<OneString> _parser = new pb::MessageParser<OneString>(() => new OneString()); public static pb::MessageParser<OneString> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[13]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneString__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3853,14 +3716,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<MoreString> _parser = new pb::MessageParser<MoreString>(() => new MoreString()); public static pb::MessageParser<MoreString> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[14]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreString__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -3964,14 +3825,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<OneBytes> _parser = new pb::MessageParser<OneBytes>(() => new OneBytes()); public static pb::MessageParser<OneBytes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[15]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_OneBytes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4083,14 +3942,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<MoreBytes> _parser = new pb::MessageParser<MoreBytes>(() => new MoreBytes()); public static pb::MessageParser<MoreBytes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[16]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_MoreBytes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4202,14 +4059,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<Int32Message> _parser = new pb::MessageParser<Int32Message>(() => new Int32Message()); public static pb::MessageParser<Int32Message> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[17]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int32Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4321,14 +4176,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<Uint32Message> _parser = new pb::MessageParser<Uint32Message>(() => new Uint32Message()); public static pb::MessageParser<Uint32Message> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[18]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint32Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4440,14 +4293,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<Int64Message> _parser = new pb::MessageParser<Int64Message>(() => new Int64Message()); public static pb::MessageParser<Int64Message> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[19]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Int64Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4559,14 +4410,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<Uint64Message> _parser = new pb::MessageParser<Uint64Message>(() => new Uint64Message()); public static pb::MessageParser<Uint64Message> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[20]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_Uint64Message__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4678,14 +4527,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<BoolMessage> _parser = new pb::MessageParser<BoolMessage>(() => new BoolMessage()); public static pb::MessageParser<BoolMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "data" }; - private static readonly uint[] _fieldTags = new uint[] { 8 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[21]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BoolMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -4797,14 +4644,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestOneof> _parser = new pb::MessageParser<TestOneof>(() => new TestOneof()); public static pb::MessageParser<TestOneof> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "foo_int", "foo_message", "foo_string" }; - private static readonly uint[] _fieldTags = new uint[] { 8, 26, 18 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[22]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestOneof__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5006,14 +4851,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestPackedTypes> _parser = new pb::MessageParser<TestPackedTypes>(() => new TestPackedTypes()); public static pb::MessageParser<TestPackedTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "packed_bool", "packed_double", "packed_enum", "packed_fixed32", "packed_fixed64", "packed_float", "packed_int32", "packed_int64", "packed_sfixed32", "packed_sfixed64", "packed_sint32", "packed_sint64", "packed_uint32", "packed_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 818, 810, 826, 770, 778, 802, 722, 730, 786, 794, 754, 762, 738, 746 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[23]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestPackedTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5173,7 +5016,8 @@ namespace Google.Protobuf.TestProtos { public const int PackedEnumFieldNumber = 103; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_packedEnum_codec - = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> packedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); + = pb::FieldCodec.ForEnum(826, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> packedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> PackedEnum { get { return packedEnum_; } } @@ -5377,14 +5221,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestUnpackedTypes> _parser = new pb::MessageParser<TestUnpackedTypes>(() => new TestUnpackedTypes()); public static pb::MessageParser<TestUnpackedTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "unpacked_bool", "unpacked_double", "unpacked_enum", "unpacked_fixed32", "unpacked_fixed64", "unpacked_float", "unpacked_int32", "unpacked_int64", "unpacked_sfixed32", "unpacked_sfixed64", "unpacked_sint32", "unpacked_sint64", "unpacked_uint32", "unpacked_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 816, 809, 824, 773, 777, 805, 720, 728, 789, 793, 752, 760, 736, 744 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[24]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestUnpackedTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5544,7 +5386,8 @@ namespace Google.Protobuf.TestProtos { public const int UnpackedEnumFieldNumber = 103; private static readonly pb::FieldCodec<global::Google.Protobuf.TestProtos.ForeignEnum> _repeated_unpackedEnum_codec - = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x);private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> unpackedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); + = pb::FieldCodec.ForEnum(824, x => (int) x, x => (global::Google.Protobuf.TestProtos.ForeignEnum) x); + private readonly pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> unpackedEnum_ = new pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum>(); public pbc::RepeatedField<global::Google.Protobuf.TestProtos.ForeignEnum> UnpackedEnum { get { return unpackedEnum_; } } @@ -5748,14 +5591,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestRepeatedScalarDifferentTagSizes> _parser = new pb::MessageParser<TestRepeatedScalarDifferentTagSizes>(() => new TestRepeatedScalarDifferentTagSizes()); public static pb::MessageParser<TestRepeatedScalarDifferentTagSizes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "repeated_fixed32", "repeated_fixed64", "repeated_float", "repeated_int32", "repeated_int64", "repeated_uint64" }; - private static readonly uint[] _fieldTags = new uint[] { 98, 16370, 2097138, 106, 16378, 2097146 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[25]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestRepeatedScalarDifferentTagSizes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -5960,14 +5801,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestCommentInjectionMessage> _parser = new pb::MessageParser<TestCommentInjectionMessage>(() => new TestCommentInjectionMessage()); public static pb::MessageParser<TestCommentInjectionMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "a" }; - private static readonly uint[] _fieldTags = new uint[] { 10 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[26]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_TestCommentInjectionMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6079,14 +5918,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<FooRequest> _parser = new pb::MessageParser<FooRequest>(() => new FooRequest()); public static pb::MessageParser<FooRequest> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[27]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooRequest__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6171,14 +6008,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<FooResponse> _parser = new pb::MessageParser<FooResponse>(() => new FooResponse()); public static pb::MessageParser<FooResponse> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[28]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooResponse__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6263,14 +6098,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<FooClientMessage> _parser = new pb::MessageParser<FooClientMessage>(() => new FooClientMessage()); public static pb::MessageParser<FooClientMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[29]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooClientMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6355,14 +6188,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<FooServerMessage> _parser = new pb::MessageParser<FooServerMessage>(() => new FooServerMessage()); public static pb::MessageParser<FooServerMessage> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[30]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_FooServerMessage__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6447,14 +6278,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<BarRequest> _parser = new pb::MessageParser<BarRequest>(() => new BarRequest()); public static pb::MessageParser<BarRequest> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[31]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarRequest__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -6539,14 +6368,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<BarResponse> _parser = new pb::MessageParser<BarResponse>(() => new BarResponse()); public static pb::MessageParser<BarResponse> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { }; - private static readonly uint[] _fieldTags = new uint[] { }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestProto3.Descriptor.MessageTypes[32]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestProto3.internal__static_protobuf_unittest_BarResponse__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs index af7d83ba..d9943dba 100644 --- a/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs +++ b/csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs @@ -12,12 +12,6 @@ namespace Google.Protobuf.TestProtos { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class UnittestWellKnownTypes { - #region Static variables - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable; - internal static pbr::FieldAccessorTable internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable; - #endregion #region Descriptor public static pbr::FileDescriptor Descriptor { get { return descriptor; } @@ -162,32 +156,15 @@ namespace Google.Protobuf.TestProtos { "AjgBGk4KD0J5dGVzRmllbGRFbnRyeRILCgNrZXkYASABKAUSKgoFdmFsdWUY", "AiABKAsyGy5nb29nbGUucHJvdG9idWYuQnl0ZXNWYWx1ZToCOAFCOQoYY29t", "Lmdvb2dsZS5wcm90b2J1Zi50ZXN0UAGqAhpHb29nbGUuUHJvdG9idWYuVGVz", - "dFByb3Rvc2IGcHJvdG8z")); + "dFByb3Rvc2IGcHJvdG8z")); descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbr::FileDescriptor[] { - global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, - global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, - global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, - }); - internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), descriptor.MessageTypes[0], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); - internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), descriptor.MessageTypes[1], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); - internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), descriptor.MessageTypes[2], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { "OneofField", }); - internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable = - new pbr::FieldAccessorTable(typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), descriptor.MessageTypes[3], - new string[] { "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField", }, new string[] { }); + new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.Any.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Duration.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Empty.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.FieldMask.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Struct.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Timestamp.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, global::Google.Protobuf.WellKnownTypes.Wrappers.Descriptor, }, + new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.TestWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.RepeatedWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.OneofWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, new[]{ "OneofField" }, null, null), + new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.TestProtos.MapWellKnownTypes), new[]{ "AnyField", "ApiField", "DurationField", "EmptyField", "FieldMaskField", "SourceContextField", "StructField", "TimestampField", "TypeField", "DoubleField", "FloatField", "Int64Field", "Uint64Field", "Int32Field", "Uint32Field", "BoolField", "StringField", "BytesField" }, null, null, new pbr::GeneratedCodeInfo[] { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }) + })); } #endregion @@ -198,14 +175,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<TestWellKnownTypes> _parser = new pb::MessageParser<TestWellKnownTypes>(() => new TestWellKnownTypes()); public static pb::MessageParser<TestWellKnownTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[0]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_TestWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -884,14 +859,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<RepeatedWellKnownTypes> _parser = new pb::MessageParser<RepeatedWellKnownTypes>(() => new RepeatedWellKnownTypes()); public static pb::MessageParser<RepeatedWellKnownTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[1]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_RepeatedWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -1318,14 +1291,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<OneofWellKnownTypes> _parser = new pb::MessageParser<OneofWellKnownTypes>(() => new OneofWellKnownTypes()); public static pb::MessageParser<OneofWellKnownTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[2]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_OneofWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; @@ -2017,14 +1988,12 @@ namespace Google.Protobuf.TestProtos { private static readonly pb::MessageParser<MapWellKnownTypes> _parser = new pb::MessageParser<MapWellKnownTypes>(() => new MapWellKnownTypes()); public static pb::MessageParser<MapWellKnownTypes> Parser { get { return _parser; } } - private static readonly string[] _fieldNames = new string[] { "any_field", "api_field", "bool_field", "bytes_field", "double_field", "duration_field", "empty_field", "field_mask_field", "float_field", "int32_field", "int64_field", "source_context_field", "string_field", "struct_field", "timestamp_field", "type_field", "uint32_field", "uint64_field" }; - private static readonly uint[] _fieldTags = new uint[] { 10, 18, 130, 146, 82, 26, 34, 42, 90, 114, 98, 50, 138, 58, 66, 74, 122, 106 }; public static pbr::MessageDescriptor Descriptor { get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.Descriptor.MessageTypes[3]; } } - pbr::FieldAccessorTable pb::IReflectedMessage.Fields { - get { return global::Google.Protobuf.TestProtos.UnittestWellKnownTypes.internal__static_protobuf_unittest_MapWellKnownTypes__FieldAccessorTable; } + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } } private bool _frozen = false; diff --git a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs index ad88c4eb..c617db36 100644 --- a/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs +++ b/csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs @@ -192,7 +192,7 @@ namespace Google.Protobuf.WellKnownTypes Uint32Field = 3, Uint64Field = 4 }; - var fields = ((IReflectedMessage) message).Fields; + var fields = TestWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; Assert.AreEqual("x", fields[TestWellKnownTypes.StringFieldFieldNumber].GetValue(message)); Assert.AreEqual(ByteString.CopyFrom(1, 2, 3), fields[TestWellKnownTypes.BytesFieldFieldNumber].GetValue(message)); @@ -216,7 +216,7 @@ namespace Google.Protobuf.WellKnownTypes { // Just a single example... note that we can't have a null value here var message = new RepeatedWellKnownTypes { Int32Field = { 1, 2 } }; - var fields = ((IReflectedMessage) message).Fields; + var fields = RepeatedWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; var list = (IList) fields[RepeatedWellKnownTypes.Int32FieldFieldNumber].GetValue(message); CollectionAssert.AreEqual(new[] { 1, 2 }, list); } @@ -226,7 +226,7 @@ namespace Google.Protobuf.WellKnownTypes { // Just a single example... note that we can't have a null value here var message = new MapWellKnownTypes { Int32Field = { { 1, 2 }, { 3, null } } }; - var fields = ((IReflectedMessage) message).Fields; + var fields = MapWellKnownTypes.Descriptor.FieldAccessorsByFieldNumber; var dictionary = (IDictionary) fields[MapWellKnownTypes.Int32FieldFieldNumber].GetValue(message); Assert.AreEqual(2, dictionary[1]); Assert.IsNull(dictionary[3]); |