diff --git a/examples/cpp/route_guide/helper.cc b/examples/cpp/route_guide/helper.cc index c2415afdf7253562a569ab0bf4016dd89c2b3faf..f76990f6fce41e3941ef2007ee5d6b7d8fe5e019 100644 --- a/examples/cpp/route_guide/helper.cc +++ b/examples/cpp/route_guide/helper.cc @@ -40,7 +40,7 @@ #include <vector> #include "route_guide.grpc.pb.h" -namespace examples { +namespace routeguide { std::string GetDbFileContent(int argc, char** argv) { std::string db_path; @@ -174,5 +174,5 @@ void ParseDb(const std::string& db, std::vector<Feature>* feature_list) { } -} // namespace examples +} // namespace routeguide diff --git a/examples/cpp/route_guide/helper.h b/examples/cpp/route_guide/helper.h index 65c93c1d3477169c7f16893540848f213367211c..db36596f90c6e9254eb4bd533506af6579d895dc 100644 --- a/examples/cpp/route_guide/helper.h +++ b/examples/cpp/route_guide/helper.h @@ -37,14 +37,14 @@ #include <string> #include <vector> -namespace examples { +namespace routeguide { class Feature; std::string GetDbFileContent(int argc, char** argv); void ParseDb(const std::string& db, std::vector<Feature>* feature_list); -} // namespace examples +} // namespace routeguide #endif // GRPC_COMMON_CPP_ROUTE_GUIDE_HELPER_H_ diff --git a/examples/cpp/route_guide/route_guide_client.cc b/examples/cpp/route_guide/route_guide_client.cc index 814def27f357d16f93ac63abc26fa0fce5e621f9..10864229a24dadaf6b06f2bed25cf4a63977c713 100644 --- a/examples/cpp/route_guide/route_guide_client.cc +++ b/examples/cpp/route_guide/route_guide_client.cc @@ -53,12 +53,12 @@ using grpc::ClientReader; using grpc::ClientReaderWriter; using grpc::ClientWriter; using grpc::Status; -using examples::Point; -using examples::Feature; -using examples::Rectangle; -using examples::RouteSummary; -using examples::RouteNote; -using examples::RouteGuide; +using routeguide::Point; +using routeguide::Feature; +using routeguide::Rectangle; +using routeguide::RouteSummary; +using routeguide::RouteNote; +using routeguide::RouteGuide; Point MakePoint(long latitude, long longitude) { Point p; @@ -87,7 +87,7 @@ class RouteGuideClient { public: RouteGuideClient(std::shared_ptr<Channel> channel, const std::string& db) : stub_(RouteGuide::NewStub(channel)) { - examples::ParseDb(db, &feature_list_); + routeguide::ParseDb(db, &feature_list_); } void GetFeature() { @@ -100,7 +100,7 @@ class RouteGuideClient { } void ListFeatures() { - examples::Rectangle rect; + routeguide::Rectangle rect; Feature feature; ClientContext context; @@ -233,10 +233,9 @@ class RouteGuideClient { int main(int argc, char** argv) { // Expect only arg: --db_path=path/to/route_guide_db.json. - std::string db = examples::GetDbFileContent(argc, argv); + std::string db = routeguide::GetDbFileContent(argc, argv); RouteGuideClient guide( - grpc::CreateChannel("localhost:50051", grpc::InsecureCredentials(), - ChannelArguments()), + grpc::CreateChannel("localhost:50051", grpc::InsecureCredentials()), db); std::cout << "-------------- GetFeature --------------" << std::endl; diff --git a/examples/cpp/route_guide/route_guide_server.cc b/examples/cpp/route_guide/route_guide_server.cc index b37539299a3b3702a5840ad003e7ae7a8e7b11c6..aa808321a1a7a00550c1c6b9eaddd7fceff924c3 100644 --- a/examples/cpp/route_guide/route_guide_server.cc +++ b/examples/cpp/route_guide/route_guide_server.cc @@ -53,12 +53,12 @@ using grpc::ServerReader; using grpc::ServerReaderWriter; using grpc::ServerWriter; using grpc::Status; -using examples::Point; -using examples::Feature; -using examples::Rectangle; -using examples::RouteSummary; -using examples::RouteNote; -using examples::RouteGuide; +using routeguide::Point; +using routeguide::Feature; +using routeguide::Rectangle; +using routeguide::RouteSummary; +using routeguide::RouteNote; +using routeguide::RouteGuide; using std::chrono::system_clock; @@ -99,7 +99,7 @@ std::string GetFeatureName(const Point& point, class RouteGuideImpl final : public RouteGuide::Service { public: explicit RouteGuideImpl(const std::string& db) { - examples::ParseDb(db, &feature_list_); + routeguide::ParseDb(db, &feature_list_); } Status GetFeature(ServerContext* context, const Point* point, @@ -110,7 +110,7 @@ class RouteGuideImpl final : public RouteGuide::Service { } Status ListFeatures(ServerContext* context, - const examples::Rectangle* rectangle, + const routeguide::Rectangle* rectangle, ServerWriter<Feature>* writer) override { auto lo = rectangle->lo(); auto hi = rectangle->hi(); @@ -195,7 +195,7 @@ void RunServer(const std::string& db_path) { int main(int argc, char** argv) { // Expect only arg: --db_path=path/to/route_guide_db.json. - std::string db = examples::GetDbFileContent(argc, argv); + std::string db = routeguide::GetDbFileContent(argc, argv); RunServer(db); return 0;