diff options
author | 2015-08-26 14:36:43 -0700 | |
---|---|---|
committer | 2015-08-26 14:36:43 -0700 | |
commit | bcd57fc78d99bb680ca46502e12df2d7cd1fdf53 (patch) | |
tree | 347fab4c3574533015f19728bd93bcca438823ec | |
parent | b323aa406ba79ebd255c3b2aa82ddc6c83af7397 (diff) | |
parent | 654828fbd052589ab154492e607c5c0ee9798b01 (diff) |
Merge pull request #276 from yang-g/master
Update c++ examples to API changes.
-rw-r--r-- | cpp/cpptutorial.md | 3 | ||||
-rw-r--r-- | cpp/helloworld/greeter_async_client.cc | 9 | ||||
-rw-r--r-- | cpp/helloworld/greeter_async_server.cc | 2 | ||||
-rw-r--r-- | cpp/helloworld/greeter_client.cc | 8 | ||||
-rw-r--r-- | cpp/helloworld/greeter_server.cc | 1 | ||||
-rw-r--r-- | cpp/route_guide/route_guide_client.cc | 10 | ||||
-rw-r--r-- | cpp/route_guide/route_guide_server.cc | 2 |
7 files changed, 10 insertions, 25 deletions
diff --git a/cpp/cpptutorial.md b/cpp/cpptutorial.md index c6a16907b4..c19b472744 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 561b880ecb..d99f89b135 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 d3ff14775c..b8a0dbf0e2 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 44e4447f1f..dd0358ac95 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 e40bf1b3a1..c1efdf563c 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 734ea9fb8a..814def27f3 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 8a0ea26132..b37539299a 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" |