diff options
author | Jon Skeet <jonskeet@google.com> | 2015-11-13 20:04:03 +0000 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-11-19 08:50:28 +0000 |
commit | 2a15051a1e101ea58d7d2e262aa79c7c21f23266 (patch) | |
tree | 29793eb4d5c1c58004d79b64ef19fb70c5f1f4a4 /csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs | |
parent | c581acb562fad93c4eb7b125cc31b64fa6f51868 (diff) | |
download | protobuf-2a15051a1e101ea58d7d2e262aa79c7c21f23266.tar.gz protobuf-2a15051a1e101ea58d7d2e262aa79c7c21f23266.tar.bz2 protobuf-2a15051a1e101ea58d7d2e262aa79c7c21f23266.zip |
Introduce a Parser property into MessageDescriptor, and populate it from generated types.
Generated code coming in next commit - in a subsequent PR I want to do a bit of renaming and redocumenting around this, in anticipation of DynamicMessage.
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs b/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs index 8c52cd12..ff4ad0aa 100644 --- a/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs +++ b/csharp/src/Google.Protobuf/Reflection/GeneratedCodeInfo.cs @@ -18,6 +18,11 @@ namespace Google.Protobuf.Reflection public Type ClrType { get; private set; } /// <summary> + /// Irrelevant for file descriptors; the parser for message descriptors. + /// </summary> + public MessageParser Parser { get; private set; } + + /// <summary> /// Irrelevant for file descriptors; the CLR property names (in message descriptor field order) /// for fields in the message for message descriptors. /// </summary> @@ -46,11 +51,12 @@ namespace Google.Protobuf.Reflection /// Each array parameter may be null, to indicate a lack of values. /// The parameter order is designed to make it feasible to format the generated code readably. /// </summary> - public GeneratedCodeInfo(Type clrType, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes) + public GeneratedCodeInfo(Type clrType, MessageParser parser, string[] propertyNames, string[] oneofNames, Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes) { NestedTypes = nestedTypes ?? EmptyCodeInfo; NestedEnums = nestedEnums ?? ReflectionUtil.EmptyTypes; ClrType = clrType; + Parser = parser; PropertyNames = propertyNames ?? EmptyNames; OneofNames = oneofNames ?? EmptyNames; } @@ -59,7 +65,7 @@ namespace Google.Protobuf.Reflection /// Creates a GeneratedCodeInfo for a file descriptor, with only types and enums. /// </summary> public GeneratedCodeInfo(Type[] nestedEnums, GeneratedCodeInfo[] nestedTypes) - : this(null, null, null, nestedEnums, nestedTypes) + : this(null, null, null, null, nestedEnums, nestedTypes) { } } |