blob: d7c6f3a3a7d1ebc5866a66b1fe954cd365b547a3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
using System;
using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers.DescriptorProtos;
namespace Google.ProtocolBuffers.Descriptors {
/// <summary>
/// Describes a service type.
/// </summary>
public class ServiceDescriptor : IndexedDescriptorBase<ServiceDescriptorProto, ServiceOptions> {
private readonly IList<MethodDescriptor> methods;
public ServiceDescriptor(ServiceDescriptorProto proto, FileDescriptor file, int index)
: base(proto, file, ComputeFullName(file, null, proto.Name), index) {
methods = DescriptorUtil.ConvertAndMakeReadOnly(proto.MethodList,
(method, i) => new MethodDescriptor(method, file, this, i));
file.DescriptorPool.AddSymbol(this);
}
/// <value>
/// An unmodifiable list of methods in this service.
/// </value>
public IList<MethodDescriptor> Methods {
get { return methods; }
}
internal void CrossLink() {
foreach (MethodDescriptor method in methods) {
method.CrossLink();
}
}
}
}
|