aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-07-01 17:19:48 +0100
committerJon Skeet <jonskeet@google.com>2015-07-09 08:26:06 +0100
commitaf259b77bf04fcfb68609776cb27f04d289a2c39 (patch)
tree3e5434199a9c59b8556e9267fb9eb7b73211f8c5 /csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs
parent5350822b0a923287bc23375a10c2f3cb07cff5fb (diff)
downloadprotobuf-af259b77bf04fcfb68609776cb27f04d289a2c39.tar.gz
protobuf-af259b77bf04fcfb68609776cb27f04d289a2c39.tar.bz2
protobuf-af259b77bf04fcfb68609776cb27f04d289a2c39.zip
Fix descriptor reflection in various ways
- The protos are no longer publicly exposed at all - Oneof detection now works (as we default to -1, not 0) - OneofDescriptor exposes the fields in the oneof - Removed unnecessary code for replacing protos - remnant of extensions - There's now just the non-generic form of IDescriptor
Diffstat (limited to 'csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs')
-rw-r--r--csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs b/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs
index 6a4ad4ea..7d4a6f4f 100644
--- a/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs
+++ b/csharp/src/ProtocolBuffers/Descriptors/MethodDescriptor.cs
@@ -37,8 +37,9 @@ namespace Google.Protobuf.Descriptors
/// <summary>
/// Describes a single method in a service.
/// </summary>
- public sealed class MethodDescriptor : IndexedDescriptorBase<MethodDescriptorProto, MethodOptions>
+ public sealed class MethodDescriptor : DescriptorBase
{
+ private readonly MethodDescriptorProto proto;
private readonly ServiceDescriptor service;
private MessageDescriptor inputType;
private MessageDescriptor outputType;
@@ -46,35 +47,34 @@ namespace Google.Protobuf.Descriptors
/// <value>
/// The service this method belongs to.
/// </value>
- public ServiceDescriptor Service
- {
- get { return service; }
- }
+ public ServiceDescriptor Service { get { return service; } }
/// <value>
/// The method's input type.
/// </value>
- public MessageDescriptor InputType
- {
- get { return inputType; }
- }
+ public MessageDescriptor InputType { get { return inputType; } }
/// <value>
/// The method's input type.
/// </value>
- public MessageDescriptor OutputType
- {
- get { return outputType; }
- }
+ public MessageDescriptor OutputType { get { return outputType; } }
internal MethodDescriptor(MethodDescriptorProto proto, FileDescriptor file,
ServiceDescriptor parent, int index)
- : base(proto, file, parent.FullName + "." + proto.Name, index)
+ : base(file, parent.FullName + "." + proto.Name, index)
{
+ this.proto = proto;
service = parent;
file.DescriptorPool.AddSymbol(this);
}
+ internal MethodDescriptorProto Proto { get { return proto; } }
+
+ /// <summary>
+ /// The brief name of the descriptor's target.
+ /// </summary>
+ public override string Name { get { return proto.Name; } }
+
internal void CrossLink()
{
IDescriptor lookup = File.DescriptorPool.LookupSymbol(Proto.InputType, this);