From d36da04a55df317febe419f53a2b97aa53cb143f Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 25 Aug 2015 15:15:35 -0700 Subject: [PATCH 1/3] fix helloworld --- cpp/helloworld/greeter_async_client.cc | 9 +++------ cpp/helloworld/greeter_async_server.cc | 2 -- cpp/helloworld/greeter_client.cc | 8 +++----- cpp/helloworld/greeter_server.cc | 1 - 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/cpp/helloworld/greeter_async_client.cc b/cpp/helloworld/greeter_async_client.cc index 561b880ecb6..d99f89b1359 100644 --- a/cpp/helloworld/greeter_async_client.cc +++ b/cpp/helloworld/greeter_async_client.cc @@ -37,18 +37,15 @@ #include #include -#include -#include -#include +#include #include #include #include #include -#include #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 channel) + explicit GreeterClient(std::shared_ptr 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 d3ff14775ce..b8a0dbf0e2e 100644 --- a/cpp/helloworld/greeter_async_server.cc +++ b/cpp/helloworld/greeter_async_server.cc @@ -38,13 +38,11 @@ #include #include -#include #include #include #include #include #include -#include #include "helloworld.grpc.pb.h" using grpc::Server; diff --git a/cpp/helloworld/greeter_client.cc b/cpp/helloworld/greeter_client.cc index 44e4447f1f9..dd0358ac95d 100644 --- a/cpp/helloworld/greeter_client.cc +++ b/cpp/helloworld/greeter_client.cc @@ -36,16 +36,14 @@ #include #include -#include -#include +#include #include #include #include -#include #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 channel) + GreeterClient(std::shared_ptr 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 e40bf1b3a1a..c1efdf563c4 100644 --- a/cpp/helloworld/greeter_server.cc +++ b/cpp/helloworld/greeter_server.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include "helloworld.grpc.pb.h" using grpc::Server; From de36eb69be02d384ec2d03b93a1bb8e44448f361 Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 25 Aug 2015 15:16:44 -0700 Subject: [PATCH 2/3] fix route_guide --- cpp/route_guide/route_guide_client.cc | 10 +++------- cpp/route_guide/route_guide_server.cc | 2 -- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cpp/route_guide/route_guide_client.cc b/cpp/route_guide/route_guide_client.cc index 734ea9fb8ad..814def27f35 100644 --- a/cpp/route_guide/route_guide_client.cc +++ b/cpp/route_guide/route_guide_client.cc @@ -39,18 +39,15 @@ #include #include -#include -#include +#include #include #include #include -#include -#include #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 channel, - const std::string& db) + RouteGuideClient(std::shared_ptr 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 8a0ea26132a..b37539299a3 100644 --- a/cpp/route_guide/route_guide_server.cc +++ b/cpp/route_guide/route_guide_server.cc @@ -43,8 +43,6 @@ #include #include #include -#include -#include #include "helper.h" #include "route_guide.grpc.pb.h" From 654828fbd052589ab154492e607c5c0ee9798b01 Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 25 Aug 2015 15:24:42 -0700 Subject: [PATCH 3/3] update doc --- cpp/cpptutorial.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/cpptutorial.md b/cpp/cpptutorial.md index c6a16907b47..c19b4727443 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 channel, - const std::string& db) + RouteGuideClient(std::shared_ptr channel, const std::string& db) : stub_(RouteGuide::NewStub(channel)) { ... }