From 1b151096d1466191bc702aeec3ec76dd2801f38e Mon Sep 17 00:00:00 2001 From: yangg <yangg@google.com> Date: Fri, 9 Jan 2015 15:31:05 -0800 Subject: [PATCH] Add impl subdirectory under public and move headers that need to be installed to it. Change on 2015/01/09 by yangg <yangg@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83640373 --- Makefile | 3 +++ build.json | 6 +++--- .../client => include/grpc++/impl}/internal_stub.h | 6 +++--- {src/cpp => include/grpc++/impl}/rpc_method.h | 10 +++++----- .../grpc++/impl}/rpc_service_method.h | 14 ++++++-------- src/compiler/cpp_generator.cc | 11 +++++------ src/cpp/client/channel.cc | 2 +- src/cpp/client/internal_stub.cc | 2 +- src/cpp/{ => common}/rpc_method.cc | 2 +- src/cpp/server/server.cc | 2 +- src/cpp/server/server_rpc_handler.cc | 2 +- src/cpp/stream/stream_context.cc | 2 +- test/cpp/end2end/end2end_test.cc | 1 - test/cpp/end2end/sync_client_async_server_test.cc | 6 +++--- 14 files changed, 34 insertions(+), 35 deletions(-) rename {src/cpp/client => include/grpc++/impl}/internal_stub.h (92%) rename {src/cpp => include/grpc++/impl}/rpc_method.h (91%) rename {src/cpp/server => include/grpc++/impl}/rpc_service_method.h (96%) rename src/cpp/{ => common}/rpc_method.cc (97%) diff --git a/Makefile b/Makefile index a1c76e155d..ec842cd1e9 100644 --- a/Makefile +++ b/Makefile @@ -1597,6 +1597,9 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/config.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ + include/grpc++/impl/internal_stub.h \ + include/grpc++/impl/rpc_method.h \ + include/grpc++/impl/rpc_service_method.h \ include/grpc++/server_builder.h \ include/grpc++/server_context.h \ include/grpc++/server_credentials.h \ diff --git a/build.json b/build.json index df59c0460a..d07fd8e783 100644 --- a/build.json +++ b/build.json @@ -359,6 +359,9 @@ "include/grpc++/config.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", + "include/grpc++/impl/internal_stub.h", + "include/grpc++/impl/rpc_method.h", + "include/grpc++/impl/rpc_service_method.h", "include/grpc++/server_builder.h", "include/grpc++/server_context.h", "include/grpc++/server_credentials.h", @@ -369,10 +372,7 @@ ], "headers": [ "src/cpp/client/channel.h", - "src/cpp/client/internal_stub.h", "src/cpp/proto/proto_utils.h", - "src/cpp/rpc_method.h", - "src/cpp/server/rpc_service_method.h", "src/cpp/server/server_rpc_handler.h", "src/cpp/server/thread_pool.h", "src/cpp/stream/stream_context.h", diff --git a/src/cpp/client/internal_stub.h b/include/grpc++/impl/internal_stub.h similarity index 92% rename from src/cpp/client/internal_stub.h rename to include/grpc++/impl/internal_stub.h index 0eaa717d0b..b32fb3a27c 100644 --- a/src/cpp/client/internal_stub.h +++ b/include/grpc++/impl/internal_stub.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_CLIENT_INTERNAL_STUB_H__ -#define __GRPCPP_INTERNAL_CLIENT_INTERNAL_STUB_H__ +#ifndef __GRPCPP_IMPL_INTERNAL_STUB_H__ +#define __GRPCPP_IMPL_INTERNAL_STUB_H__ #include <memory> @@ -57,4 +57,4 @@ class InternalStub { } // namespace grpc -#endif // __GRPCPP_INTERNAL_CLIENT_INTERNAL_STUB_H__ +#endif // __GRPCPP_IMPL_INTERNAL_STUB_H__ diff --git a/src/cpp/rpc_method.h b/include/grpc++/impl/rpc_method.h similarity index 91% rename from src/cpp/rpc_method.h rename to include/grpc++/impl/rpc_method.h index 24a34bed89..75fec356dd 100644 --- a/src/cpp/rpc_method.h +++ b/include/grpc++/impl/rpc_method.h @@ -31,8 +31,8 @@ * */ -#ifndef __GRPCPP_INTERNAL_RPC_METHOD_H__ -#define __GRPCPP_INTERNAL_RPC_METHOD_H__ +#ifndef __GRPCPP_IMPL_RPC_METHOD_H__ +#define __GRPCPP_IMPL_RPC_METHOD_H__ namespace google { namespace protobuf { @@ -55,15 +55,15 @@ class RpcMethod { : name_(name), method_type_(NORMAL_RPC) {} RpcMethod(const char* name, RpcType type) : name_(name), method_type_(type) {} - const char *name() const { return name_; } + const char* name() const { return name_; } RpcType method_type() const { return method_type_; } private: - const char *name_; + const char* name_; const RpcType method_type_; }; } // namespace grpc -#endif // __GRPCPP_INTERNAL_RPC_METHOD_H__ +#endif // __GRPCPP_IMPL_RPC_METHOD_H__ diff --git a/src/cpp/server/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h similarity index 96% rename from src/cpp/server/rpc_service_method.h rename to include/grpc++/impl/rpc_service_method.h index f4fe01c06b..15ff9cab1a 100644 --- a/src/cpp/server/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -31,18 +31,18 @@ * */ -#ifndef __GRPCPP_INTERNAL_SERVER_RPC_SERVICE_METHOD_H__ -#define __GRPCPP_INTERNAL_SERVER_RPC_SERVICE_METHOD_H__ +#ifndef __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ +#define __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ #include <functional> #include <map> #include <memory> #include <vector> -#include "src/cpp/rpc_method.h" -#include <google/protobuf/message.h> +#include <grpc++/impl/rpc_method.h> #include <grpc++/status.h> #include <grpc++/stream.h> +#include <google/protobuf/message.h> namespace grpc { class ServerContext; @@ -200,9 +200,7 @@ class RpcService { methods_.push_back(std::unique_ptr<RpcServiceMethod>(method)); } - RpcServiceMethod* GetMethod(int i) { - return methods_[i].get(); - } + RpcServiceMethod* GetMethod(int i) { return methods_[i].get(); } int GetMethodCount() const { return methods_.size(); } private: @@ -211,4 +209,4 @@ class RpcService { } // namespace grpc -#endif // __GRPCPP_INTERNAL_SERVER_RPC_SERVICE_METHOD_H__ +#endif // __GRPCPP_IMPL_RPC_SERVICE_METHOD_H__ diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 14d5005dc0..43a04be931 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -53,8 +53,7 @@ bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) { } bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) { - return !method->client_streaming() && - method->server_streaming(); + return !method->client_streaming() && method->server_streaming(); } bool BidiStreaming(const google::protobuf::MethodDescriptor* method) { @@ -98,7 +97,7 @@ bool HasBidiStreaming(const google::protobuf::FileDescriptor* file) { string GetHeaderIncludes(const google::protobuf::FileDescriptor* file) { string temp = - "#include \"src/cpp/client/internal_stub.h\"\n" + "#include \"grpc++/impl/internal_stub.h\"\n" "#include \"grpc++/status.h\"\n" "\n" "namespace grpc {\n" @@ -126,9 +125,9 @@ string GetHeaderIncludes(const google::protobuf::FileDescriptor* file) { } string GetSourceIncludes() { - return "#include \"src/cpp/rpc_method.h\"\n" - "#include \"src/cpp/server/rpc_service_method.h\"\n" - "#include \"grpc++/channel_interface.h\"\n" + return "#include \"grpc++/channel_interface.h\"\n" + "#include \"grpc++/impl/rpc_method.h\"\n" + "#include \"grpc++/impl/rpc_service_method.h\"\n" "#include \"grpc++/stream.h\"\n"; } diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc index 6c8879d577..bcda4ed40c 100644 --- a/src/cpp/client/channel.cc +++ b/src/cpp/client/channel.cc @@ -41,13 +41,13 @@ #include <grpc/support/log.h> #include <grpc/support/slice.h> -#include "src/cpp/rpc_method.h" #include "src/cpp/proto/proto_utils.h" #include "src/cpp/stream/stream_context.h" #include <grpc++/channel_arguments.h> #include <grpc++/client_context.h> #include <grpc++/config.h> #include <grpc++/credentials.h> +#include <grpc++/impl/rpc_method.h> #include <grpc++/status.h> #include <google/protobuf/message.h> diff --git a/src/cpp/client/internal_stub.cc b/src/cpp/client/internal_stub.cc index ec88ba5e7e..51cb99d1b4 100644 --- a/src/cpp/client/internal_stub.cc +++ b/src/cpp/client/internal_stub.cc @@ -31,6 +31,6 @@ * */ -#include "src/cpp/client/internal_stub.h" +#include <grpc++/impl/internal_stub.h> namespace grpc {} // namespace grpc diff --git a/src/cpp/rpc_method.cc b/src/cpp/common/rpc_method.cc similarity index 97% rename from src/cpp/rpc_method.cc rename to src/cpp/common/rpc_method.cc index 8067f42f85..c8b2ccb10e 100644 --- a/src/cpp/rpc_method.cc +++ b/src/cpp/common/rpc_method.cc @@ -31,6 +31,6 @@ * */ -#include "src/cpp/rpc_method.h" +#include <grpc++/impl/rpc_method.h> namespace grpc {} // namespace grpc diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 2130befa7d..d85748eea4 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -37,11 +37,11 @@ #include <grpc/grpc.h> #include <grpc/grpc_security.h> #include <grpc/support/log.h> -#include "src/cpp/server/rpc_service_method.h" #include "src/cpp/server/server_rpc_handler.h" #include "src/cpp/server/thread_pool.h" #include <grpc++/async_server_context.h> #include <grpc++/completion_queue.h> +#include <grpc++/impl/rpc_service_method.h> #include <grpc++/server_credentials.h> namespace grpc { diff --git a/src/cpp/server/server_rpc_handler.cc b/src/cpp/server/server_rpc_handler.cc index 3954f04f97..b7b29c2406 100644 --- a/src/cpp/server/server_rpc_handler.cc +++ b/src/cpp/server/server_rpc_handler.cc @@ -34,10 +34,10 @@ #include "src/cpp/server/server_rpc_handler.h" #include <grpc/support/log.h> -#include "src/cpp/server/rpc_service_method.h" #include "src/cpp/server/server_context_impl.h" #include "src/cpp/stream/stream_context.h" #include <grpc++/async_server_context.h> +#include <grpc++/impl/rpc_service_method.h> namespace grpc { diff --git a/src/cpp/stream/stream_context.cc b/src/cpp/stream/stream_context.cc index b55e647a63..6c424b937e 100644 --- a/src/cpp/stream/stream_context.cc +++ b/src/cpp/stream/stream_context.cc @@ -34,11 +34,11 @@ #include "src/cpp/stream/stream_context.h" #include <grpc/support/log.h> -#include "src/cpp/rpc_method.h" #include "src/cpp/proto/proto_utils.h" #include "src/cpp/util/time.h" #include <grpc++/client_context.h> #include <grpc++/config.h> +#include <grpc++/impl/rpc_method.h> #include <google/protobuf/message.h> namespace grpc { diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 1dcdd4202c..73b7025cb3 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -36,7 +36,6 @@ #include "net/grpc/cpp/echo_duplicate_proto_cc.pb.h" #include "test/cpp/util/echo.pb.h" -#include "src/cpp/server/rpc_service_method.h" #include "src/cpp/util/time.h" #include <grpc++/channel_arguments.h> #include <grpc++/channel_interface.h> diff --git a/test/cpp/end2end/sync_client_async_server_test.cc b/test/cpp/end2end/sync_client_async_server_test.cc index 839f89cdb1..f4dad60e22 100644 --- a/test/cpp/end2end/sync_client_async_server_test.cc +++ b/test/cpp/end2end/sync_client_async_server_test.cc @@ -39,17 +39,17 @@ #include <grpc/grpc.h> #include <grpc/support/thd.h> -#include "src/cpp/client/internal_stub.h" -#include "src/cpp/rpc_method.h" #include "test/cpp/util/echo.pb.h" -#include "net/util/netutil.h" #include <grpc++/channel_arguments.h> #include <grpc++/channel_interface.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> +#include <grpc++/impl/internal_stub.h> +#include <grpc++/impl/rpc_method.h> #include <grpc++/status.h> #include <grpc++/stream.h> #include "test/cpp/end2end/async_test_server.h" +#include "net/util/netutil.h" #include <gtest/gtest.h> using grpc::cpp::test::util::EchoRequest; -- GitLab