Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: math.proto |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 3 | // Original file comments: |
| 4 | // Copyright 2015, Google Inc. |
| 5 | // All rights reserved. |
| 6 | // |
| 7 | // Redistribution and use in source and binary forms, with or without |
| 8 | // modification, are permitted provided that the following conditions are |
| 9 | // met: |
| 10 | // |
| 11 | // * Redistributions of source code must retain the above copyright |
| 12 | // notice, this list of conditions and the following disclaimer. |
| 13 | // * Redistributions in binary form must reproduce the above |
| 14 | // copyright notice, this list of conditions and the following disclaimer |
| 15 | // in the documentation and/or other materials provided with the |
| 16 | // distribution. |
| 17 | // * Neither the name of Google Inc. nor the names of its |
| 18 | // contributors may be used to endorse or promote products derived from |
| 19 | // this software without specific prior written permission. |
| 20 | // |
| 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | // |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 33 | #region Designer generated code |
Jan Tattermusch | a7fff86 | 2015-02-13 11:08:08 -0800 | [diff] [blame] | 34 | |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 35 | using System; |
Jan Tattermusch | 3086862 | 2015-02-19 09:22:33 -0800 | [diff] [blame] | 36 | using System.Threading; |
| 37 | using System.Threading.Tasks; |
| 38 | using Grpc.Core; |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 39 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 40 | namespace Math { |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 41 | public static class Math |
| 42 | { |
| 43 | static readonly string __ServiceName = "math.Math"; |
| 44 | |
Jan Tattermusch | 7db4613 | 2015-08-03 09:25:38 -0700 | [diff] [blame] | 45 | static readonly Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 46 | static readonly Marshaller<global::Math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom); |
| 47 | static readonly Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom); |
| 48 | static readonly Marshaller<global::Math.Num> __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 49 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 50 | static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new Method<global::Math.DivArgs, global::Math.DivReply>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 51 | MethodType.Unary, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 52 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 53 | "Div", |
| 54 | __Marshaller_DivArgs, |
| 55 | __Marshaller_DivReply); |
| 56 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 57 | static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new Method<global::Math.DivArgs, global::Math.DivReply>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 58 | MethodType.DuplexStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 59 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 60 | "DivMany", |
| 61 | __Marshaller_DivArgs, |
| 62 | __Marshaller_DivReply); |
| 63 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 64 | static readonly Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new Method<global::Math.FibArgs, global::Math.Num>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 65 | MethodType.ServerStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 66 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 67 | "Fib", |
| 68 | __Marshaller_FibArgs, |
| 69 | __Marshaller_Num); |
| 70 | |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 71 | static readonly Method<global::Math.Num, global::Math.Num> __Method_Sum = new Method<global::Math.Num, global::Math.Num>( |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 72 | MethodType.ClientStreaming, |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 73 | __ServiceName, |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 74 | "Sum", |
| 75 | __Marshaller_Num, |
| 76 | __Marshaller_Num); |
| 77 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 78 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | 9ee27e1 | 2015-08-03 10:32:48 -0700 | [diff] [blame] | 79 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 80 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 81 | get { return global::Math.MathReflection.Descriptor.Services[0]; } |
Jan Tattermusch | 9ee27e1 | 2015-08-03 10:32:48 -0700 | [diff] [blame] | 82 | } |
| 83 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 84 | /// <summary>Client for Math</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 85 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 86 | public interface IMathClient |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 87 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 88 | /// <summary> |
| 89 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 90 | /// remainder. |
| 91 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 92 | global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 93 | /// <summary> |
| 94 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 95 | /// remainder. |
| 96 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 97 | global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 98 | /// <summary> |
| 99 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 100 | /// remainder. |
| 101 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 102 | AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 103 | /// <summary> |
| 104 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 105 | /// remainder. |
| 106 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 107 | AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 108 | /// <summary> |
| 109 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 110 | /// and sends back the results in the reply stream. The stream continues until |
| 111 | /// the client closes its end; the server does the same after sending all the |
| 112 | /// replies. The stream ends immediately if either end aborts. |
| 113 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 114 | AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 115 | /// <summary> |
| 116 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 117 | /// and sends back the results in the reply stream. The stream continues until |
| 118 | /// the client closes its end; the server does the same after sending all the |
| 119 | /// replies. The stream ends immediately if either end aborts. |
| 120 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 121 | AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 122 | /// <summary> |
| 123 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 124 | /// generates up to limit numbers; otherwise it continues until the call is |
| 125 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 126 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 127 | AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 128 | /// <summary> |
| 129 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 130 | /// generates up to limit numbers; otherwise it continues until the call is |
| 131 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 132 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 133 | AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 134 | /// <summary> |
| 135 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 136 | /// is closed. |
| 137 | /// </summary> |
Jan Tattermusch | 5c42d8d | 2015-08-03 08:14:30 -0700 | [diff] [blame] | 138 | AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 139 | /// <summary> |
| 140 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 141 | /// is closed. |
| 142 | /// </summary> |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 143 | AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options); |
Jan Tattermusch | 15111f5 | 2015-02-05 18:15:14 -0800 | [diff] [blame] | 144 | } |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 145 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 146 | /// <summary>Interface of server-side implementations of Math</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 147 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 148 | public interface IMath |
| 149 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 150 | /// <summary> |
| 151 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 152 | /// remainder. |
| 153 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 154 | global::System.Threading.Tasks.Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 155 | /// <summary> |
| 156 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 157 | /// and sends back the results in the reply stream. The stream continues until |
| 158 | /// the client closes its end; the server does the same after sending all the |
| 159 | /// replies. The stream ends immediately if either end aborts. |
| 160 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 161 | global::System.Threading.Tasks.Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServerStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 162 | /// <summary> |
| 163 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 164 | /// generates up to limit numbers; otherwise it continues until the call is |
| 165 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 166 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 167 | global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Num> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 168 | /// <summary> |
| 169 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 170 | /// is closed. |
| 171 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 172 | global::System.Threading.Tasks.Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStream, ServerCallContext context); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 173 | } |
| 174 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 175 | /// <summary>Base class for server-side implementations of Math</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 176 | public abstract class MathBase |
| 177 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 178 | /// <summary> |
| 179 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 180 | /// remainder. |
| 181 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 182 | public virtual global::System.Threading.Tasks.Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 183 | { |
| 184 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 185 | } |
| 186 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 187 | /// <summary> |
| 188 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 189 | /// and sends back the results in the reply stream. The stream continues until |
| 190 | /// the client closes its end; the server does the same after sending all the |
| 191 | /// replies. The stream ends immediately if either end aborts. |
| 192 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 193 | public virtual global::System.Threading.Tasks.Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServerStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 194 | { |
| 195 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 196 | } |
| 197 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 198 | /// <summary> |
| 199 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 200 | /// generates up to limit numbers; otherwise it continues until the call is |
| 201 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 202 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 203 | public virtual global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Num> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 204 | { |
| 205 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 206 | } |
| 207 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 208 | /// <summary> |
| 209 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 210 | /// is closed. |
| 211 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 212 | public virtual global::System.Threading.Tasks.Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 213 | { |
| 214 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 215 | } |
| 216 | |
| 217 | } |
| 218 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 219 | /// <summary>Client for Math</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 220 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 221 | public class MathClient : ClientBase<MathClient>, IMathClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 222 | #pragma warning restore 0618 |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 223 | { |
Jan Tattermusch | b533281 | 2015-07-14 19:29:35 -0700 | [diff] [blame] | 224 | public MathClient(Channel channel) : base(channel) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 225 | { |
| 226 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 227 | public MathClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 228 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 229 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 230 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 231 | protected MathClient() : base() |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 232 | { |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 233 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 234 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 235 | protected MathClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 236 | { |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 237 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 238 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 239 | /// <summary> |
| 240 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 241 | /// remainder. |
| 242 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 243 | public virtual global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 244 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 245 | return Div(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 246 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 247 | /// <summary> |
| 248 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 249 | /// remainder. |
| 250 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 251 | public virtual global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 252 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 253 | return CallInvoker.BlockingUnaryCall(__Method_Div, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 254 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 255 | /// <summary> |
| 256 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 257 | /// remainder. |
| 258 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 259 | public virtual AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 260 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 261 | return DivAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 262 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 263 | /// <summary> |
| 264 | /// Div divides args.dividend by args.divisor and returns the quotient and |
| 265 | /// remainder. |
| 266 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 267 | public virtual AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 268 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 269 | return CallInvoker.AsyncUnaryCall(__Method_Div, null, options, request); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 270 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 271 | /// <summary> |
| 272 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 273 | /// and sends back the results in the reply stream. The stream continues until |
| 274 | /// the client closes its end; the server does the same after sending all the |
| 275 | /// replies. The stream ends immediately if either end aborts. |
| 276 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 277 | public virtual AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 278 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 279 | return DivMany(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 280 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 281 | /// <summary> |
| 282 | /// DivMany accepts an arbitrary number of division args from the client stream |
| 283 | /// and sends back the results in the reply stream. The stream continues until |
| 284 | /// the client closes its end; the server does the same after sending all the |
| 285 | /// replies. The stream ends immediately if either end aborts. |
| 286 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 287 | public virtual AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options) |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 288 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 289 | return CallInvoker.AsyncDuplexStreamingCall(__Method_DivMany, null, options); |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 290 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 291 | /// <summary> |
| 292 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 293 | /// generates up to limit numbers; otherwise it continues until the call is |
| 294 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 295 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 296 | public virtual AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | cc97fed | 2015-08-05 00:44:29 -0700 | [diff] [blame] | 297 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 298 | return Fib(request, new CallOptions(headers, deadline, cancellationToken)); |
| 299 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 300 | /// <summary> |
| 301 | /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
| 302 | /// generates up to limit numbers; otherwise it continues until the call is |
| 303 | /// canceled. Unlike Fib above, Fib has no final FibReply. |
| 304 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 305 | public virtual AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options) |
| 306 | { |
| 307 | return CallInvoker.AsyncServerStreamingCall(__Method_Fib, null, options, request); |
| 308 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 309 | /// <summary> |
| 310 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 311 | /// is closed. |
| 312 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 313 | public virtual AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 314 | { |
| 315 | return Sum(new CallOptions(headers, deadline, cancellationToken)); |
| 316 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 317 | /// <summary> |
| 318 | /// Sum sums a stream of numbers, returning the final result once the stream |
| 319 | /// is closed. |
| 320 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 321 | public virtual AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options) |
| 322 | { |
| 323 | return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); |
| 324 | } |
| 325 | protected override MathClient NewInstance(ClientBaseConfiguration configuration) |
| 326 | { |
| 327 | return new MathClient(configuration); |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 328 | } |
| 329 | } |
| 330 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 331 | /// <summary>Creates a new client for Math</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 332 | public static MathClient NewClient(Channel channel) |
| 333 | { |
| 334 | return new MathClient(channel); |
| 335 | } |
| 336 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 337 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 338 | #pragma warning disable 0618 |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 339 | public static ServerServiceDefinition BindService(IMath serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 340 | #pragma warning restore 0618 |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 341 | { |
| 342 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 343 | .AddMethod(__Method_Div, serviceImpl.Div) |
| 344 | .AddMethod(__Method_DivMany, serviceImpl.DivMany) |
| 345 | .AddMethod(__Method_Fib, serviceImpl.Fib) |
| 346 | .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); |
| 347 | } |
| 348 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 349 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 350 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 351 | public static ServerServiceDefinition BindService(MathBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 352 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 353 | { |
| 354 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 355 | .AddMethod(__Method_Div, serviceImpl.Div) |
| 356 | .AddMethod(__Method_DivMany, serviceImpl.DivMany) |
| 357 | .AddMethod(__Method_Fib, serviceImpl.Fib) |
| 358 | .AddMethod(__Method_Sum, serviceImpl.Sum).Build(); |
| 359 | } |
| 360 | |
Jan Tattermusch | 085533e | 2015-05-07 14:34:45 -0700 | [diff] [blame] | 361 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 362 | } |
Jan Tattermusch | cd7e313 | 2015-05-07 15:10:23 -0700 | [diff] [blame] | 363 | #endregion |