From 09685d224ee3cf3735f0564fcbf92e8acc994293 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 24 Jun 2016 15:15:55 -0700 Subject: [PATCH] regenerate files --- .../csharp/helloworld/Greeter/Helloworld.cs | 10 +- .../helloworld/Greeter/HelloworldGrpc.cs | 64 +------ .../route_guide/RouteGuide/RouteGuide.cs | 16 +- .../route_guide/RouteGuide/RouteGuideGrpc.cs | 161 +----------------- 4 files changed, 31 insertions(+), 220 deletions(-) diff --git a/examples/csharp/helloworld/Greeter/Helloworld.cs b/examples/csharp/helloworld/Greeter/Helloworld.cs index 3cacdebe27e..6477b4f35be 100644 --- a/examples/csharp/helloworld/Greeter/Helloworld.cs +++ b/examples/csharp/helloworld/Greeter/Helloworld.cs @@ -31,9 +31,9 @@ namespace Helloworld { "cm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null) + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Helloworld.HelloRequest), global::Helloworld.HelloRequest.Parser, new[]{ "Name" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Helloworld.HelloReply), global::Helloworld.HelloReply.Parser, new[]{ "Message" }, null, null, null) })); } #endregion @@ -76,7 +76,7 @@ namespace Helloworld { public string Name { get { return name_; } set { - name_ = pb::Preconditions.CheckNotNull(value, "value"); + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } @@ -182,7 +182,7 @@ namespace Helloworld { public string Message { get { return message_; } set { - message_ = pb::Preconditions.CheckNotNull(value, "value"); + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } diff --git a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs index 405f3bd7248..041f5a78d75 100644 --- a/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs +++ b/examples/csharp/helloworld/Greeter/HelloworldGrpc.cs @@ -61,38 +61,6 @@ namespace Helloworld { get { return global::Helloworld.HelloworldReflection.Descriptor.Services[0]; } } - /// Client for Greeter - [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] - public interface IGreeterClient - { - /// - /// Sends a greeting - /// - global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sends a greeting - /// - global::Helloworld.HelloReply SayHello(global::Helloworld.HelloRequest request, CallOptions options); - /// - /// Sends a greeting - /// - AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Sends a greeting - /// - AsyncUnaryCall SayHelloAsync(global::Helloworld.HelloRequest request, CallOptions options); - } - - /// Interface of server-side implementations of Greeter - [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] - public interface IGreeter - { - /// - /// Sends a greeting - /// - global::System.Threading.Tasks.Task SayHello(global::Helloworld.HelloRequest request, ServerCallContext context); - } - /// Base class for server-side implementations of Greeter public abstract class GreeterBase { @@ -107,21 +75,24 @@ namespace Helloworld { } /// Client for Greeter - #pragma warning disable 0618 - public class GreeterClient : ClientBase, IGreeterClient - #pragma warning restore 0618 + public class GreeterClient : ClientBase { + /// Creates a new client for Greeter + /// The channel to use to make remote calls. public GreeterClient(Channel channel) : base(channel) { } + /// Creates a new client for Greeter that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. public GreeterClient(CallInvoker callInvoker) : base(callInvoker) { } - ///Protected parameterless constructor to allow creation of test doubles. + /// Protected parameterless constructor to allow creation of test doubles. protected GreeterClient() : base() { } - ///Protected constructor to allow creation of configured clients. + /// Protected constructor to allow creation of configured clients. + /// The client configuration. protected GreeterClient(ClientBaseConfiguration configuration) : base(configuration) { } @@ -160,27 +131,10 @@ namespace Helloworld { } } - /// Creates a new client for Greeter - public static GreeterClient NewClient(Channel channel) - { - return new GreeterClient(channel); - } - - /// Creates service definition that can be registered with a server - #pragma warning disable 0618 - public static ServerServiceDefinition BindService(IGreeter serviceImpl) - #pragma warning restore 0618 - { - return ServerServiceDefinition.CreateBuilder(__ServiceName) - .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); - } - /// Creates service definition that can be registered with a server - #pragma warning disable 0618 public static ServerServiceDefinition BindService(GreeterBase serviceImpl) - #pragma warning restore 0618 { - return ServerServiceDefinition.CreateBuilder(__ServiceName) + return ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_SayHello, serviceImpl.SayHello).Build(); } diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs index bcd77ec5f52..446113de9d5 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.cs @@ -41,12 +41,12 @@ namespace Routeguide { "ZUIPUm91dGVHdWlkZVByb3RvUAGiAgNSVEdiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null), - new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null) + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Point), global::Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Rectangle), global::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.Feature), global::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.RouteNote), global::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Distance", "ElapsedTime" }, null, null, null) })); } #endregion @@ -383,7 +383,7 @@ namespace Routeguide { public string Name { get { return name_; } set { - name_ = pb::Preconditions.CheckNotNull(value, "value"); + name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } @@ -541,7 +541,7 @@ namespace Routeguide { public string Message { get { return message_; } set { - message_ = pb::Preconditions.CheckNotNull(value, "value"); + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs index a59906d9c13..eb70c8e2db5 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs +++ b/examples/csharp/route_guide/RouteGuide/RouteGuideGrpc.cs @@ -85,132 +85,6 @@ namespace Routeguide { get { return global::Routeguide.RouteGuideReflection.Descriptor.Services[0]; } } - /// Client for RouteGuide - [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] - public interface IRouteGuideClient - { - /// - /// A simple RPC. - /// - /// Obtains the feature at a given position. - /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. - /// - global::Routeguide.Feature GetFeature(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// A simple RPC. - /// - /// Obtains the feature at a given position. - /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. - /// - global::Routeguide.Feature GetFeature(global::Routeguide.Point request, CallOptions options); - /// - /// A simple RPC. - /// - /// Obtains the feature at a given position. - /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. - /// - AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// A simple RPC. - /// - /// Obtains the feature at a given position. - /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. - /// - AsyncUnaryCall GetFeatureAsync(global::Routeguide.Point request, CallOptions options); - /// - /// A server-to-client streaming RPC. - /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. - /// - AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// A server-to-client streaming RPC. - /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. - /// - AsyncServerStreamingCall ListFeatures(global::Routeguide.Rectangle request, CallOptions options); - /// - /// A client-to-server streaming RPC. - /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. - /// - AsyncClientStreamingCall RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// A client-to-server streaming RPC. - /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. - /// - AsyncClientStreamingCall RecordRoute(CallOptions options); - /// - /// A Bidirectional streaming RPC. - /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). - /// - AsyncDuplexStreamingCall RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// A Bidirectional streaming RPC. - /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). - /// - AsyncDuplexStreamingCall RouteChat(CallOptions options); - } - - /// Interface of server-side implementations of RouteGuide - [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] - public interface IRouteGuide - { - /// - /// A simple RPC. - /// - /// Obtains the feature at a given position. - /// - /// A feature with an empty name is returned if there's no feature at the given - /// position. - /// - global::System.Threading.Tasks.Task GetFeature(global::Routeguide.Point request, ServerCallContext context); - /// - /// A server-to-client streaming RPC. - /// - /// Obtains the Features available within the given Rectangle. Results are - /// streamed rather than returned at once (e.g. in a response message with a - /// repeated field), as the rectangle may cover a large area and contain a - /// huge number of features. - /// - global::System.Threading.Tasks.Task ListFeatures(global::Routeguide.Rectangle request, IServerStreamWriter responseStream, ServerCallContext context); - /// - /// A client-to-server streaming RPC. - /// - /// Accepts a stream of Points on a route being traversed, returning a - /// RouteSummary when traversal is completed. - /// - global::System.Threading.Tasks.Task RecordRoute(IAsyncStreamReader requestStream, ServerCallContext context); - /// - /// A Bidirectional streaming RPC. - /// - /// Accepts a stream of RouteNotes sent while a route is being traversed, - /// while receiving other RouteNotes (e.g. from other users). - /// - global::System.Threading.Tasks.Task RouteChat(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); - } - /// Base class for server-side implementations of RouteGuide public abstract class RouteGuideBase { @@ -265,21 +139,24 @@ namespace Routeguide { } /// Client for RouteGuide - #pragma warning disable 0618 - public class RouteGuideClient : ClientBase, IRouteGuideClient - #pragma warning restore 0618 + public class RouteGuideClient : ClientBase { + /// Creates a new client for RouteGuide + /// The channel to use to make remote calls. public RouteGuideClient(Channel channel) : base(channel) { } + /// Creates a new client for RouteGuide that uses a custom CallInvoker. + /// The callInvoker to use to make remote calls. public RouteGuideClient(CallInvoker callInvoker) : base(callInvoker) { } - ///Protected parameterless constructor to allow creation of test doubles. + /// Protected parameterless constructor to allow creation of test doubles. protected RouteGuideClient() : base() { } - ///Protected constructor to allow creation of configured clients. + /// Protected constructor to allow creation of configured clients. + /// The client configuration. protected RouteGuideClient(ClientBaseConfiguration configuration) : base(configuration) { } @@ -402,30 +279,10 @@ namespace Routeguide { } } - /// Creates a new client for RouteGuide - public static RouteGuideClient NewClient(Channel channel) - { - return new RouteGuideClient(channel); - } - - /// Creates service definition that can be registered with a server - #pragma warning disable 0618 - public static ServerServiceDefinition BindService(IRouteGuide serviceImpl) - #pragma warning restore 0618 - { - return ServerServiceDefinition.CreateBuilder(__ServiceName) - .AddMethod(__Method_GetFeature, serviceImpl.GetFeature) - .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures) - .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute) - .AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build(); - } - /// Creates service definition that can be registered with a server - #pragma warning disable 0618 public static ServerServiceDefinition BindService(RouteGuideBase serviceImpl) - #pragma warning restore 0618 { - return ServerServiceDefinition.CreateBuilder(__ServiceName) + return ServerServiceDefinition.CreateBuilder() .AddMethod(__Method_GetFeature, serviceImpl.GetFeature) .AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures) .AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)