diff --git a/Makefile b/Makefile index a1c76e155df0d8a3d58a1a3b43b78e5fa33821e1..ec842cd1e96a36e235f735f0be6c471371133ea8 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 df59c0460ade897eb97f762b1a798773b9a84047..d07fd8e783a2ce0b9c6348eb9592ded556b606c5 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 0eaa717d0b65dbcf067bfbc229c5781fd8331c3e..b32fb3a27c00cce6611121400833460b6b8c97af 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 24a34bed89b9da26c6c91ef5d54b23d7681b0959..75fec356dd47dd0645ea472f741e856f6c47bd7f 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 f4fe01c06b64b63e48dd35c633e52357f3288d5d..15ff9cab1a4627e8666b2f1a15ae8596045ec968 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 14d5005dc033d22c0dcff8371246e5217df21933..43a04be931d5d2a1d218e41e9a4e0816f0ac2354 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 6c8879d57751e389dbf98910690446db4fdfbfb4..bcda4ed40ccbc845e5c9136594226dd9fd03756b 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 ec88ba5e7ed7ff16c65c79c4ba14af3c1ee16f99..51cb99d1b49c016254767f8bcae858d3ea0195c3 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 8067f42f85e819c5a49894c67a777d5cd4b71769..c8b2ccb10e26214af7fb41d8241a3eede316e54b 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 2130befa7d5344e4ddfeefc7a7cf6568dcc1b0db..d85748eea44b251300151e5e6f1d704ee34d07f2 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 3954f04f978ebcc9a44020d5e9fa423679d06302..b7b29c24066dbf019399bf33c49d7862f118284b 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 b55e647a63272b93a9bfef8fc4e174f5b9859330..6c424b937edefb407a4597a4f03b4d73dcac705d 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 1dcdd4202cad8efa573dff2b1557eb4223ac4b69..73b7025cb364708547b9ff051cb5e6885d974b6c 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 839f89cdb1ebd1d28e0717f8bbb3fd335d0017a3..f4dad60e22354202e6ed267317a3e15ed2c0289e 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;