blob: d1aab5778c6cbf36403323915b289c3d8c1a7728 [file] [log] [blame]
csharptest35b68522011-05-20 12:22:21 -05001// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT!
csharptestf1816be2011-05-19 12:01:16 -05002
3using pb = global::Google.ProtocolBuffers;
4using pbc = global::Google.ProtocolBuffers.Collections;
5using pbd = global::Google.ProtocolBuffers.Descriptors;
6using scg = global::System.Collections.Generic;
7namespace Google.ProtocolBuffers.TestProtos {
8
9 public static partial class UnitTestGenericServices {
10
11 #region Extension registration
12 public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
13 }
14 #endregion
15 #region Static variables
16 #endregion
17 #region Descriptor
18 public static pbd::FileDescriptor Descriptor {
19 get { return descriptor; }
20 }
21 private static pbd::FileDescriptor descriptor;
22
23 static UnitTestGenericServices() {
24 byte[] descriptorData = global::System.Convert.FromBase64String(
25 "CiZleHRlc3QvdW5pdHRlc3RfZ2VuZXJpY19zZXJ2aWNlcy5wcm90bxIRcHJv" +
26 "dG9idWZfdW5pdHRlc3QaJGdvb2dsZS9wcm90b2J1Zi9jc2hhcnBfb3B0aW9u" +
27 "cy5wcm90bxoeZ29vZ2xlL3Byb3RvYnVmL3VuaXR0ZXN0LnByb3RvGi1nb29n" +
28 "bGUvcHJvdG9idWYvdW5pdHRlc3RfY3VzdG9tX29wdGlvbnMucHJvdG8yoAEK" +
29 "ElRlc3RHZW5lcmljU2VydmljZRJECgNGb28SHS5wcm90b2J1Zl91bml0dGVz" +
30 "dC5Gb29SZXF1ZXN0Gh4ucHJvdG9idWZfdW5pdHRlc3QuRm9vUmVzcG9uc2US" +
31 "RAoDQmFyEh0ucHJvdG9idWZfdW5pdHRlc3QuQmFyUmVxdWVzdBoeLnByb3Rv" +
32 "YnVmX3VuaXR0ZXN0LkJhclJlc3BvbnNlMpUBCiNUZXN0R2VuZXJpY1NlcnZp" +
33 "Y2VXaXRoQ3VzdG9tT3B0aW9ucxJjCgNGb28SKS5wcm90b2J1Zl91bml0dGVz" +
34 "dC5DdXN0b21PcHRpb25Gb29SZXF1ZXN0GioucHJvdG9idWZfdW5pdHRlc3Qu" +
35 "Q3VzdG9tT3B0aW9uRm9vUmVzcG9uc2UiBeD6jB4CGgmQsose09uAy0lCREgB" +
36 "wj4/CiFHb29nbGUuUHJvdG9jb2xCdWZmZXJzLlRlc3RQcm90b3MSF1VuaXRU" +
37 "ZXN0R2VuZXJpY1NlcnZpY2VziA4B");
38 pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
39 descriptor = root;
40 pb::ExtensionRegistry registry = pb::ExtensionRegistry.CreateInstance();
41 RegisterAllExtensions(registry);
42 global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.RegisterAllExtensions(registry);
43 global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.RegisterAllExtensions(registry);
44 global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.RegisterAllExtensions(registry);
45 return registry;
46 };
47 pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
48 new pbd::FileDescriptor[] {
49 global::Google.ProtocolBuffers.DescriptorProtos.CSharpOptions.Descriptor,
50 global::Google.ProtocolBuffers.TestProtos.UnitTestProtoFile.Descriptor,
51 global::Google.ProtocolBuffers.TestProtos.UnitTestCustomOptionsProtoFile.Descriptor,
52 }, assigner);
53 }
54 #endregion
55
56 }
57 #region Services
58 public abstract class TestGenericService : pb::IService {
59 public abstract void Foo(
60 pb::IRpcController controller,
61 global::Google.ProtocolBuffers.TestProtos.FooRequest request,
62 global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done);
63 public abstract void Bar(
64 pb::IRpcController controller,
65 global::Google.ProtocolBuffers.TestProtos.BarRequest request,
66 global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done);
67
68 public static pbd::ServiceDescriptor Descriptor {
69 get { return UnitTestGenericServices.Descriptor.Services[0]; }
70 }
71 public pbd::ServiceDescriptor DescriptorForType {
72 get { return Descriptor; }
73 }
74
75 public void CallMethod(
76 pbd::MethodDescriptor method,
77 pb::IRpcController controller,
78 pb::IMessage request,
79 global::System.Action<pb::IMessage> done) {
80 if (method.Service != Descriptor) {
81 throw new global::System.ArgumentException(
82 "Service.CallMethod() given method descriptor for wrong service type.");
83 }
84 switch(method.Index) {
85 case 0:
86 this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.FooRequest) request,
87 pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse>(
88 done));
89 return;
90 case 1:
91 this.Bar(controller, (global::Google.ProtocolBuffers.TestProtos.BarRequest) request,
92 pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse>(
93 done));
94 return;
95 default:
96 throw new global::System.InvalidOperationException("Can't get here.");
97 }
98 }
99
100 public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
101 if (method.Service != Descriptor) {
102 throw new global::System.ArgumentException(
103 "Service.GetRequestPrototype() given method descriptor for wrong service type.");
104 }
105 switch(method.Index) {
106 case 0:
107 return global::Google.ProtocolBuffers.TestProtos.FooRequest.DefaultInstance;
108 case 1:
109 return global::Google.ProtocolBuffers.TestProtos.BarRequest.DefaultInstance;
110 default:
111 throw new global::System.InvalidOperationException("Can't get here.");
112 }
113 }
114
115 public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
116 if (method.Service != Descriptor) {
117 throw new global::System.ArgumentException(
118 "Service.GetResponsePrototype() given method descriptor for wrong service type.");
119 }
120 switch(method.Index) {
121 case 0:
122 return global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance;
123 case 1:
124 return global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance;
125 default:
126 throw new global::System.InvalidOperationException("Can't get here.");
127 }
128 }
129
130 public static Stub CreateStub(pb::IRpcChannel channel) {
131 return new Stub(channel);
132 }
133
134 public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericService {
135 internal Stub(pb::IRpcChannel channel) {
136 this.channel = channel;
137 }
138
139 private readonly pb::IRpcChannel channel;
140
141 public pb::IRpcChannel Channel {
142 get { return channel; }
143 }
144
145 public override void Foo(
146 pb::IRpcController controller,
147 global::Google.ProtocolBuffers.TestProtos.FooRequest request,
148 global::System.Action<global::Google.ProtocolBuffers.TestProtos.FooResponse> done) {
149 channel.CallMethod(Descriptor.Methods[0],
150 controller, request, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance,
151 pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.FooResponse, global::Google.ProtocolBuffers.TestProtos.FooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.FooResponse.DefaultInstance));
152 }
153
154 public override void Bar(
155 pb::IRpcController controller,
156 global::Google.ProtocolBuffers.TestProtos.BarRequest request,
157 global::System.Action<global::Google.ProtocolBuffers.TestProtos.BarResponse> done) {
158 channel.CallMethod(Descriptor.Methods[1],
159 controller, request, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance,
160 pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.BarResponse, global::Google.ProtocolBuffers.TestProtos.BarResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.BarResponse.DefaultInstance));
161 }
162 }
163 }
164 public abstract class TestGenericServiceWithCustomOptions : pb::IService {
165 public abstract void Foo(
166 pb::IRpcController controller,
167 global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request,
168 global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done);
169
170 public static pbd::ServiceDescriptor Descriptor {
171 get { return UnitTestGenericServices.Descriptor.Services[1]; }
172 }
173 public pbd::ServiceDescriptor DescriptorForType {
174 get { return Descriptor; }
175 }
176
177 public void CallMethod(
178 pbd::MethodDescriptor method,
179 pb::IRpcController controller,
180 pb::IMessage request,
181 global::System.Action<pb::IMessage> done) {
182 if (method.Service != Descriptor) {
183 throw new global::System.ArgumentException(
184 "Service.CallMethod() given method descriptor for wrong service type.");
185 }
186 switch(method.Index) {
187 case 0:
188 this.Foo(controller, (global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest) request,
189 pb::RpcUtil.SpecializeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse>(
190 done));
191 return;
192 default:
193 throw new global::System.InvalidOperationException("Can't get here.");
194 }
195 }
196
197 public pb::IMessage GetRequestPrototype(pbd::MethodDescriptor method) {
198 if (method.Service != Descriptor) {
199 throw new global::System.ArgumentException(
200 "Service.GetRequestPrototype() given method descriptor for wrong service type.");
201 }
202 switch(method.Index) {
203 case 0:
204 return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest.DefaultInstance;
205 default:
206 throw new global::System.InvalidOperationException("Can't get here.");
207 }
208 }
209
210 public pb::IMessage GetResponsePrototype(pbd::MethodDescriptor method) {
211 if (method.Service != Descriptor) {
212 throw new global::System.ArgumentException(
213 "Service.GetResponsePrototype() given method descriptor for wrong service type.");
214 }
215 switch(method.Index) {
216 case 0:
217 return global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance;
218 default:
219 throw new global::System.InvalidOperationException("Can't get here.");
220 }
221 }
222
223 public static Stub CreateStub(pb::IRpcChannel channel) {
224 return new Stub(channel);
225 }
226
227 public class Stub : global::Google.ProtocolBuffers.TestProtos.TestGenericServiceWithCustomOptions {
228 internal Stub(pb::IRpcChannel channel) {
229 this.channel = channel;
230 }
231
232 private readonly pb::IRpcChannel channel;
233
234 public pb::IRpcChannel Channel {
235 get { return channel; }
236 }
237
238 public override void Foo(
239 pb::IRpcController controller,
240 global::Google.ProtocolBuffers.TestProtos.CustomOptionFooRequest request,
241 global::System.Action<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse> done) {
242 channel.CallMethod(Descriptor.Methods[0],
243 controller, request, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance,
244 pb::RpcUtil.GeneralizeCallback<global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.Builder>(done, global::Google.ProtocolBuffers.TestProtos.CustomOptionFooResponse.DefaultInstance));
245 }
246 }
247 }
248 #endregion
249
250}