diff --git a/cpp/cpptutorial.md b/cpp/cpptutorial.md index c6a16907b471e3a766f20eb37b4b1a4ebecf55e6..c19b4727443704047f8a5377c3dde4b8e8b9fc27 100644 --- a/cpp/cpptutorial.md +++ b/cpp/cpptutorial.md @@ -252,8 +252,7 @@ Now we can use the channel to create our stub using the `NewStub` method provide ```cpp public: - RouteGuideClient(std::shared_ptr<ChannelInterface> channel, - const std::string& db) + RouteGuideClient(std::shared_ptr<Channel> channel, const std::string& db) : stub_(RouteGuide::NewStub(channel)) { ... } diff --git a/cpp/helloworld/greeter_async_client.cc b/cpp/helloworld/greeter_async_client.cc index 561b880ecb6e791f748f7bfa5caa4b2f50e234a3..d99f89b13595a508f6be35bcc795891fd087c0d1 100644 --- a/cpp/helloworld/greeter_async_client.cc +++ b/cpp/helloworld/greeter_async_client.cc @@ -37,18 +37,15 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> -#include <grpc++/async_unary_call.h> -#include <grpc++/channel_arguments.h> -#include <grpc++/channel_interface.h> +#include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/completion_queue.h> #include <grpc++/create_channel.h> #include <grpc++/credentials.h> -#include <grpc++/status.h> #include "helloworld.grpc.pb.h" +using grpc::Channel; using grpc::ChannelArguments; -using grpc::ChannelInterface; using grpc::ClientAsyncResponseReader; using grpc::ClientContext; using grpc::CompletionQueue; @@ -59,7 +56,7 @@ using helloworld::Greeter; class GreeterClient { public: - explicit GreeterClient(std::shared_ptr<ChannelInterface> channel) + explicit GreeterClient(std::shared_ptr<Channel> channel) : stub_(Greeter::NewStub(channel)) {} std::string SayHello(const std::string& user) { diff --git a/cpp/helloworld/greeter_async_server.cc b/cpp/helloworld/greeter_async_server.cc index d3ff14775cebda91fa1a92336de9257e69788550..b8a0dbf0e2efe2865167262530e536b7e3a1fa31 100644 --- a/cpp/helloworld/greeter_async_server.cc +++ b/cpp/helloworld/greeter_async_server.cc @@ -38,13 +38,11 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> -#include <grpc++/async_unary_call.h> #include <grpc++/completion_queue.h> #include <grpc++/server.h> #include <grpc++/server_builder.h> #include <grpc++/server_context.h> #include <grpc++/server_credentials.h> -#include <grpc++/status.h> #include "helloworld.grpc.pb.h" using grpc::Server; diff --git a/cpp/helloworld/greeter_client.cc b/cpp/helloworld/greeter_client.cc index 44e4447f1f9045b0ba4dc48639dd4097ba67625c..dd0358ac95dbe1a6c12a7bdc9e03457d186a223e 100644 --- a/cpp/helloworld/greeter_client.cc +++ b/cpp/helloworld/greeter_client.cc @@ -36,16 +36,14 @@ #include <string> #include <grpc/grpc.h> -#include <grpc++/channel_arguments.h> -#include <grpc++/channel_interface.h> +#include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> #include <grpc++/credentials.h> -#include <grpc++/status.h> #include "helloworld.grpc.pb.h" +using grpc::Channel; using grpc::ChannelArguments; -using grpc::ChannelInterface; using grpc::ClientContext; using grpc::Status; using helloworld::HelloRequest; @@ -54,7 +52,7 @@ using helloworld::Greeter; class GreeterClient { public: - GreeterClient(std::shared_ptr<ChannelInterface> channel) + GreeterClient(std::shared_ptr<Channel> channel) : stub_(Greeter::NewStub(channel)) {} std::string SayHello(const std::string& user) { diff --git a/cpp/helloworld/greeter_server.cc b/cpp/helloworld/greeter_server.cc index e40bf1b3a1ae8ad637eca5b84b30382c3c858991..c1efdf563c4aa11b5e85cb6e88534f53322cb863 100644 --- a/cpp/helloworld/greeter_server.cc +++ b/cpp/helloworld/greeter_server.cc @@ -40,7 +40,6 @@ #include <grpc++/server_builder.h> #include <grpc++/server_context.h> #include <grpc++/server_credentials.h> -#include <grpc++/status.h> #include "helloworld.grpc.pb.h" using grpc::Server; diff --git a/cpp/route_guide/route_guide_client.cc b/cpp/route_guide/route_guide_client.cc index 734ea9fb8ad93d6d65235b8a8c3ecf4fc4c4c1bc..814def27f357d16f93ac63abc26fa0fce5e621f9 100644 --- a/cpp/route_guide/route_guide_client.cc +++ b/cpp/route_guide/route_guide_client.cc @@ -39,18 +39,15 @@ #include <thread> #include <grpc/grpc.h> -#include <grpc++/channel_arguments.h> -#include <grpc++/channel_interface.h> +#include <grpc++/channel.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> #include <grpc++/credentials.h> -#include <grpc++/status.h> -#include <grpc++/stream.h> #include "helper.h" #include "route_guide.grpc.pb.h" +using grpc::Channel; using grpc::ChannelArguments; -using grpc::ChannelInterface; using grpc::ClientContext; using grpc::ClientReader; using grpc::ClientReaderWriter; @@ -88,8 +85,7 @@ RouteNote MakeRouteNote(const std::string& message, class RouteGuideClient { public: - RouteGuideClient(std::shared_ptr<ChannelInterface> channel, - const std::string& db) + RouteGuideClient(std::shared_ptr<Channel> channel, const std::string& db) : stub_(RouteGuide::NewStub(channel)) { examples::ParseDb(db, &feature_list_); } diff --git a/cpp/route_guide/route_guide_server.cc b/cpp/route_guide/route_guide_server.cc index 8a0ea26132a49d8e53cd9753c05face446b276bb..b37539299a3b3702a5840ad003e7ae7a8e7b11c6 100644 --- a/cpp/route_guide/route_guide_server.cc +++ b/cpp/route_guide/route_guide_server.cc @@ -43,8 +43,6 @@ #include <grpc++/server_builder.h> #include <grpc++/server_context.h> #include <grpc++/server_credentials.h> -#include <grpc++/status.h> -#include <grpc++/stream.h> #include "helper.h" #include "route_guide.grpc.pb.h"