diff options
author | 2018-10-30 00:12:55 -0700 | |
---|---|---|
committer | 2018-10-30 00:12:55 -0700 | |
commit | 3c1ca6bf3926b28cb36e6e1a29435d19e2cf98c6 (patch) | |
tree | ce14e383717db7f4ffd999c1a8f01430cee8e196 /include/grpcpp | |
parent | d7f5055b8dc73b7c4d67f6b0bb1ed52277640478 (diff) | |
parent | 145789e9ff5b579d2e31c84cb6a5b378a20aa89a (diff) |
Merge pull request #17034 from yashykt/interceptorcleanup
Get ClientContext included with ChannelInterface, and slight more cle…
Diffstat (limited to 'include/grpcpp')
-rw-r--r-- | include/grpcpp/impl/codegen/channel_interface.h | 1 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/client_interceptor.h | 1 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/interceptor.h | 2 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/server_interceptor.h | 1 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/server_interface.h | 7 | ||||
-rw-r--r-- | include/grpcpp/server.h | 14 |
6 files changed, 17 insertions, 9 deletions
diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h index 6fd1dd1d9b..e957ea6aab 100644 --- a/include/grpcpp/impl/codegen/channel_interface.h +++ b/include/grpcpp/impl/codegen/channel_interface.h @@ -21,6 +21,7 @@ #include <grpc/impl/codegen/connectivity_state.h> #include <grpcpp/impl/codegen/call.h> +#include <grpcpp/impl/codegen/client_context.h> #include <grpcpp/impl/codegen/status.h> #include <grpcpp/impl/codegen/time.h> diff --git a/include/grpcpp/impl/codegen/client_interceptor.h b/include/grpcpp/impl/codegen/client_interceptor.h index 00113f04aa..0e08a7ce01 100644 --- a/include/grpcpp/impl/codegen/client_interceptor.h +++ b/include/grpcpp/impl/codegen/client_interceptor.h @@ -21,7 +21,6 @@ #include <vector> -#include <grpc/impl/codegen/log.h> #include <grpcpp/impl/codegen/interceptor.h> #include <grpcpp/impl/codegen/string_ref.h> diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h index cdd34b80d1..15cab711e5 100644 --- a/include/grpcpp/impl/codegen/interceptor.h +++ b/include/grpcpp/impl/codegen/interceptor.h @@ -21,13 +21,13 @@ #include <grpc/impl/codegen/grpc_types.h> #include <grpcpp/impl/codegen/byte_buffer.h> -#include <grpcpp/impl/codegen/channel_interface.h> #include <grpcpp/impl/codegen/config.h> #include <grpcpp/impl/codegen/core_codegen_interface.h> #include <grpcpp/impl/codegen/metadata_map.h> namespace grpc { +class ChannelInterface; class Status; namespace experimental { diff --git a/include/grpcpp/impl/codegen/server_interceptor.h b/include/grpcpp/impl/codegen/server_interceptor.h index c39e9a988d..5fb5df28b7 100644 --- a/include/grpcpp/impl/codegen/server_interceptor.h +++ b/include/grpcpp/impl/codegen/server_interceptor.h @@ -22,7 +22,6 @@ #include <atomic> #include <vector> -#include <grpc/impl/codegen/log.h> #include <grpcpp/impl/codegen/interceptor.h> #include <grpcpp/impl/codegen/string_ref.h> diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h index 92c87a5f7e..3967e96cfe 100644 --- a/include/grpcpp/impl/codegen/server_interface.h +++ b/include/grpcpp/impl/codegen/server_interface.h @@ -333,7 +333,12 @@ class ServerInterface : public internal::CallHook { } private: - virtual const std::vector< + // EXPERIMENTAL + // Getter method for the vector of interceptor factory objects. + // Returns a nullptr (rather than being pure) since this is a new method and + // adding a new pure method to an interface would be a breaking change (even + // though this is private and non-API) + virtual std::vector< std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>* interceptor_creators() { return nullptr; diff --git a/include/grpcpp/server.h b/include/grpcpp/server.h index 2b89ffd317..82d60b0218 100644 --- a/include/grpcpp/server.h +++ b/include/grpcpp/server.h @@ -191,8 +191,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen { grpc_server* server() override { return server_; }; private: - const std::vector< - std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>* + std::vector<std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>* interceptor_creators() override { return &interceptor_creators_; } @@ -226,6 +225,14 @@ class Server : public ServerInterface, private GrpcLibraryCodegen { ServerInitializer* initializer(); + // A vector of interceptor factory objects. + // This should be destroyed after health_check_service_ and this requirement + // is satisfied by declaring interceptor_creators_ before + // health_check_service_. (C++ mandates that member objects be destroyed in + // the reverse order of initialization.) + std::vector<std::unique_ptr<experimental::ServerInterceptorFactoryInterface>> + interceptor_creators_; + const int max_receive_message_size_; /// The following completion queues are ONLY used in case of Sync API @@ -261,9 +268,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen { // A special handler for resource exhausted in sync case std::unique_ptr<internal::MethodHandler> resource_exhausted_handler_; - - std::vector<std::unique_ptr<experimental::ServerInterceptorFactoryInterface>> - interceptor_creators_; }; } // namespace grpc |