diff --git a/BUILD b/BUILD index 47fcfae1db1b2e59aaaf7305819fe052f3e156d3..d7f0e5a58811ccc791e5848677f87ca892d98212 100644 --- a/BUILD +++ b/BUILD @@ -577,7 +577,6 @@ cc_library( "src/cpp/client/secure_credentials.h", "src/cpp/server/secure_server_credentials.h", "src/cpp/client/channel.h", - "src/cpp/proto/proto_utils.h", "src/cpp/server/thread_pool.h", "src/cpp/client/secure_credentials.cc", "src/cpp/server/secure_server_credentials.cc", @@ -615,6 +614,7 @@ cc_library( "include/grpc++/client_context.h", "include/grpc++/completion_queue.h", "include/grpc++/config.h", + "include/grpc++/config_protobuf.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", "include/grpc++/generic_stub.h", @@ -622,6 +622,7 @@ cc_library( "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/grpc_library.h", "include/grpc++/impl/internal_stub.h", + "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", "include/grpc++/impl/serialization_traits.h", @@ -659,7 +660,6 @@ cc_library( name = "grpc++_unsecure", srcs = [ "src/cpp/client/channel.h", - "src/cpp/proto/proto_utils.h", "src/cpp/server/thread_pool.h", "src/cpp/client/channel.cc", "src/cpp/client/channel_arguments.cc", @@ -695,6 +695,7 @@ cc_library( "include/grpc++/client_context.h", "include/grpc++/completion_queue.h", "include/grpc++/config.h", + "include/grpc++/config_protobuf.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", "include/grpc++/generic_stub.h", @@ -702,6 +703,7 @@ cc_library( "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/grpc_library.h", "include/grpc++/impl/internal_stub.h", + "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", "include/grpc++/impl/serialization_traits.h", diff --git a/Makefile b/Makefile index a8b3ffa42041da8571305b56ab51d8923d016d5f..26899c5c051eaeeee41c20fabc05e1dc35f7ebbb 100644 --- a/Makefile +++ b/Makefile @@ -3433,6 +3433,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/client_context.h \ include/grpc++/completion_queue.h \ include/grpc++/config.h \ + include/grpc++/config_protobuf.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ include/grpc++/generic_stub.h \ @@ -3440,6 +3441,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/grpc_library.h \ include/grpc++/impl/internal_stub.h \ + include/grpc++/impl/proto_utils.h \ include/grpc++/impl/rpc_method.h \ include/grpc++/impl/rpc_service_method.h \ include/grpc++/impl/serialization_traits.h \ @@ -3721,6 +3723,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/client_context.h \ include/grpc++/completion_queue.h \ include/grpc++/config.h \ + include/grpc++/config_protobuf.h \ include/grpc++/create_channel.h \ include/grpc++/credentials.h \ include/grpc++/generic_stub.h \ @@ -3728,6 +3731,7 @@ PUBLIC_HEADERS_CXX += \ include/grpc++/impl/client_unary_call.h \ include/grpc++/impl/grpc_library.h \ include/grpc++/impl/internal_stub.h \ + include/grpc++/impl/proto_utils.h \ include/grpc++/impl/rpc_method.h \ include/grpc++/impl/rpc_service_method.h \ include/grpc++/impl/serialization_traits.h \ diff --git a/build.json b/build.json index f012cf827fae348a370810d4b98331746ed3d118..e01a419bbe6a1f928742be1cd5b3c043e56a769b 100644 --- a/build.json +++ b/build.json @@ -36,6 +36,7 @@ "include/grpc++/client_context.h", "include/grpc++/completion_queue.h", "include/grpc++/config.h", + "include/grpc++/config_protobuf.h", "include/grpc++/create_channel.h", "include/grpc++/credentials.h", "include/grpc++/generic_stub.h", @@ -43,6 +44,7 @@ "include/grpc++/impl/client_unary_call.h", "include/grpc++/impl/grpc_library.h", "include/grpc++/impl/internal_stub.h", + "include/grpc++/impl/proto_utils.h", "include/grpc++/impl/rpc_method.h", "include/grpc++/impl/rpc_service_method.h", "include/grpc++/impl/serialization_traits.h", @@ -66,7 +68,6 @@ ], "headers": [ "src/cpp/client/channel.h", - "src/cpp/proto/proto_utils.h", "src/cpp/server/thread_pool.h" ], "src": [ diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index a3e7a9c9f4041f87adcc45a32ddf36c8a7a74d48..f32cbff06cc93ff63dc32c26ce5c9339ae2f1f00 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -36,6 +36,7 @@ #include <grpc/support/time.h> #include <grpc++/impl/grpc_library.h> +#include <grpc++/status.h> #include <grpc++/time.h> struct grpc_completion_queue; @@ -70,7 +71,6 @@ class RpcMethod; class Server; class ServerBuilder; class ServerContext; -class Status; class CompletionQueueTag { public: diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 268e4f6d1fe92735ed2895ecd2c2d396df3e89d2..7b2a65e99bbc97762e7e4dc9f8bc8507d45ff777 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -154,13 +154,16 @@ namespace grpc { Status SerializeProto(const grpc::protobuf::Message& msg, grpc_byte_buffer** bp) { GrpcBufferWriter writer(bp); - return msg.SerializeToZeroCopyStream(&writer) ? Status::OK : Status(INVALID_ARGUMENT, "Failed to serialize message"); + return msg.SerializeToZeroCopyStream(&writer) + ? Status::OK + : Status(StatusCode::INVALID_ARGUMENT, + "Failed to serialize message"); } Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg, int max_message_size) { if (!buffer) { - return Status(INVALID_ARGUMENT, "No payload"); + return Status(StatusCode::INVALID_ARGUMENT, "No payload"); } GrpcBufferReader reader(buffer); ::grpc::protobuf::io::CodedInputStream decoder(&reader); @@ -168,10 +171,11 @@ Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg, decoder.SetTotalBytesLimit(max_message_size, max_message_size); } if (!msg->ParseFromCodedStream(&decoder)) { - return Status(INVALID_ARGUMENT, msg->InitializationErrorString()); + return Status(StatusCode::INVALID_ARGUMENT, + msg->InitializationErrorString()); } if (!decoder.ConsumedEntireMessage()) { - return Status(INVALID_ARGUMENT, "Did not read entire message"); + return Status(StatusCode::INVALID_ARGUMENT, "Did not read entire message"); } return Status::OK; } diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 79868464a149acb2adef9f4bd8a14a03a66c8108..f947b7823ebec799c2de6e4515692d3cbbfca1dd 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -760,7 +760,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/serialization_traits.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h +INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/config_protobuf.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/proto_utils.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/serialization_traits.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 48ae86c933186e0a8f0f54c0e27fbf8b2b5143bc..a19f89ac7befa0e1eb19e91d2d1bcabd7455c69e 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -760,7 +760,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/serialization_traits.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h src/cpp/client/secure_credentials.h src/cpp/server/secure_server_credentials.h src/cpp/client/channel.h src/cpp/proto/proto_utils.h src/cpp/server/thread_pool.h src/cpp/client/secure_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel.cc src/cpp/client/channel_arguments.cc src/cpp/client/client_context.cc src/cpp/client/create_channel.cc src/cpp/client/credentials.cc src/cpp/client/generic_stub.cc src/cpp/client/insecure_credentials.cc src/cpp/client/internal_stub.cc src/cpp/common/call.cc src/cpp/common/completion_queue.cc src/cpp/common/rpc_method.cc src/cpp/proto/proto_utils.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/server.cc src/cpp/server/server_builder.cc src/cpp/server/server_context.cc src/cpp/server/server_credentials.cc src/cpp/server/thread_pool.cc src/cpp/util/byte_buffer.cc src/cpp/util/slice.cc src/cpp/util/status.cc src/cpp/util/time.cc +INPUT = include/grpc++/async_generic_service.h include/grpc++/async_unary_call.h include/grpc++/byte_buffer.h include/grpc++/channel_arguments.h include/grpc++/channel_interface.h include/grpc++/client_context.h include/grpc++/completion_queue.h include/grpc++/config.h include/grpc++/config_protobuf.h include/grpc++/create_channel.h include/grpc++/credentials.h include/grpc++/generic_stub.h include/grpc++/impl/call.h include/grpc++/impl/client_unary_call.h include/grpc++/impl/grpc_library.h include/grpc++/impl/internal_stub.h include/grpc++/impl/proto_utils.h include/grpc++/impl/rpc_method.h include/grpc++/impl/rpc_service_method.h include/grpc++/impl/serialization_traits.h include/grpc++/impl/service_type.h include/grpc++/impl/sync.h include/grpc++/impl/sync_cxx11.h include/grpc++/impl/sync_no_cxx11.h include/grpc++/impl/thd.h include/grpc++/impl/thd_cxx11.h include/grpc++/impl/thd_no_cxx11.h include/grpc++/server.h include/grpc++/server_builder.h include/grpc++/server_context.h include/grpc++/server_credentials.h include/grpc++/slice.h include/grpc++/status.h include/grpc++/status_code_enum.h include/grpc++/stream.h include/grpc++/thread_pool_interface.h include/grpc++/time.h src/cpp/client/secure_credentials.h src/cpp/server/secure_server_credentials.h src/cpp/client/channel.h src/cpp/server/thread_pool.h src/cpp/client/secure_credentials.cc src/cpp/server/secure_server_credentials.cc src/cpp/client/channel.cc src/cpp/client/channel_arguments.cc src/cpp/client/client_context.cc src/cpp/client/create_channel.cc src/cpp/client/credentials.cc src/cpp/client/generic_stub.cc src/cpp/client/insecure_credentials.cc src/cpp/client/internal_stub.cc src/cpp/common/call.cc src/cpp/common/completion_queue.cc src/cpp/common/rpc_method.cc src/cpp/proto/proto_utils.cc src/cpp/server/async_generic_service.cc src/cpp/server/create_default_thread_pool.cc src/cpp/server/insecure_server_credentials.cc src/cpp/server/server.cc src/cpp/server/server_builder.cc src/cpp/server/server_context.cc src/cpp/server/server_credentials.cc src/cpp/server/thread_pool.cc src/cpp/util/byte_buffer.cc src/cpp/util/slice.cc src/cpp/util/status.cc src/cpp/util/time.cc # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/vsprojects/grpc++/grpc++.vcxproj b/vsprojects/grpc++/grpc++.vcxproj index 092b962aa00d15f6a7708d4ab5d2896bc71981f3..e7afd991899a95407e8cb96cc450523740bd7ca4 100644 --- a/vsprojects/grpc++/grpc++.vcxproj +++ b/vsprojects/grpc++/grpc++.vcxproj @@ -154,6 +154,7 @@ <ClInclude Include="..\..\include\grpc++\client_context.h" /> <ClInclude Include="..\..\include\grpc++\completion_queue.h" /> <ClInclude Include="..\..\include\grpc++\config.h" /> + <ClInclude Include="..\..\include\grpc++\config_protobuf.h" /> <ClInclude Include="..\..\include\grpc++\create_channel.h" /> <ClInclude Include="..\..\include\grpc++\credentials.h" /> <ClInclude Include="..\..\include\grpc++\generic_stub.h" /> @@ -161,6 +162,7 @@ <ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h" /> <ClInclude Include="..\..\include\grpc++\impl\grpc_library.h" /> <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h" /> + <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h" /> <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h" /> <ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h" /> <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h" /> @@ -186,7 +188,6 @@ <ClInclude Include="..\..\src\cpp\client\secure_credentials.h" /> <ClInclude Include="..\..\src\cpp\server\secure_server_credentials.h" /> <ClInclude Include="..\..\src\cpp\client\channel.h" /> - <ClInclude Include="..\..\src\cpp\proto\proto_utils.h" /> <ClInclude Include="..\..\src\cpp\server\thread_pool.h" /> </ItemGroup> <ItemGroup> diff --git a/vsprojects/grpc++/grpc++.vcxproj.filters b/vsprojects/grpc++/grpc++.vcxproj.filters index f44fb87fbceaca6a6aed75e58a7140eadc3a9492..fb0bcab09ddcb99d7309fed8bd557cf745b69732 100644 --- a/vsprojects/grpc++/grpc++.vcxproj.filters +++ b/vsprojects/grpc++/grpc++.vcxproj.filters @@ -105,6 +105,9 @@ <ClInclude Include="..\..\include\grpc++\config.h"> <Filter>include\grpc++</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc++\config_protobuf.h"> + <Filter>include\grpc++</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc++\create_channel.h"> <Filter>include\grpc++</Filter> </ClInclude> @@ -126,6 +129,9 @@ <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h"> <Filter>include\grpc++\impl</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h"> <Filter>include\grpc++\impl</Filter> </ClInclude> @@ -197,9 +203,6 @@ <ClInclude Include="..\..\src\cpp\client\channel.h"> <Filter>src\cpp\client</Filter> </ClInclude> - <ClInclude Include="..\..\src\cpp\proto\proto_utils.h"> - <Filter>src\cpp\proto</Filter> - </ClInclude> <ClInclude Include="..\..\src\cpp\server\thread_pool.h"> <Filter>src\cpp\server</Filter> </ClInclude> diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj index aabbdc04e7f4541872dca78f5c280e31e9bc4f2c..639f904cce8c5a2c59536ede558008d4a00776cd 100644 --- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj +++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj @@ -154,6 +154,7 @@ <ClInclude Include="..\..\include\grpc++\client_context.h" /> <ClInclude Include="..\..\include\grpc++\completion_queue.h" /> <ClInclude Include="..\..\include\grpc++\config.h" /> + <ClInclude Include="..\..\include\grpc++\config_protobuf.h" /> <ClInclude Include="..\..\include\grpc++\create_channel.h" /> <ClInclude Include="..\..\include\grpc++\credentials.h" /> <ClInclude Include="..\..\include\grpc++\generic_stub.h" /> @@ -161,6 +162,7 @@ <ClInclude Include="..\..\include\grpc++\impl\client_unary_call.h" /> <ClInclude Include="..\..\include\grpc++\impl\grpc_library.h" /> <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h" /> + <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h" /> <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h" /> <ClInclude Include="..\..\include\grpc++\impl\rpc_service_method.h" /> <ClInclude Include="..\..\include\grpc++\impl\serialization_traits.h" /> @@ -184,7 +186,6 @@ </ItemGroup> <ItemGroup> <ClInclude Include="..\..\src\cpp\client\channel.h" /> - <ClInclude Include="..\..\src\cpp\proto\proto_utils.h" /> <ClInclude Include="..\..\src\cpp\server\thread_pool.h" /> </ItemGroup> <ItemGroup> diff --git a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters index 23efb25ebe04c802fdbe6db634ba8871c6a3df14..974dc3e27a4ae0b72856feef096c688df193b4f2 100644 --- a/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters +++ b/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters @@ -99,6 +99,9 @@ <ClInclude Include="..\..\include\grpc++\config.h"> <Filter>include\grpc++</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc++\config_protobuf.h"> + <Filter>include\grpc++</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc++\create_channel.h"> <Filter>include\grpc++</Filter> </ClInclude> @@ -120,6 +123,9 @@ <ClInclude Include="..\..\include\grpc++\impl\internal_stub.h"> <Filter>include\grpc++\impl</Filter> </ClInclude> + <ClInclude Include="..\..\include\grpc++\impl\proto_utils.h"> + <Filter>include\grpc++\impl</Filter> + </ClInclude> <ClInclude Include="..\..\include\grpc++\impl\rpc_method.h"> <Filter>include\grpc++\impl</Filter> </ClInclude> @@ -185,9 +191,6 @@ <ClInclude Include="..\..\src\cpp\client\channel.h"> <Filter>src\cpp\client</Filter> </ClInclude> - <ClInclude Include="..\..\src\cpp\proto\proto_utils.h"> - <Filter>src\cpp\proto</Filter> - </ClInclude> <ClInclude Include="..\..\src\cpp\server\thread_pool.h"> <Filter>src\cpp\server</Filter> </ClInclude>