diff --git a/BUILD b/BUILD index f2625120c35..26a4c26ddc9 100644 --- a/BUILD +++ b/BUILD @@ -329,6 +329,7 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/grpcpp.h", "include/grpcpp/health_check_service_interface.h", "include/grpcpp/impl/call_hook.h", + "include/grpcpp/impl/call_op_set_interface.h", "include/grpcpp/impl/call.h", "include/grpcpp/impl/channel_argument_option.h", "include/grpcpp/impl/client_unary_call.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index 1917ca9afb7..5707bfd7659 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3300,6 +3300,7 @@ foreach(_hdr include/grpcpp/health_check_service_interface.h include/grpcpp/impl/call.h include/grpcpp/impl/call_hook.h + include/grpcpp/impl/call_op_set_interface.h include/grpcpp/impl/channel_argument_option.h include/grpcpp/impl/client_unary_call.h include/grpcpp/impl/codegen/async_generic_service.h @@ -3971,6 +3972,7 @@ foreach(_hdr include/grpcpp/health_check_service_interface.h include/grpcpp/impl/call.h include/grpcpp/impl/call_hook.h + include/grpcpp/impl/call_op_set_interface.h include/grpcpp/impl/channel_argument_option.h include/grpcpp/impl/client_unary_call.h include/grpcpp/impl/codegen/async_generic_service.h diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index a9f6ff0ebe3..ad0b36f446f 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2634,6 +2634,7 @@ libs: - include/grpcpp/health_check_service_interface.h - include/grpcpp/impl/call.h - include/grpcpp/impl/call_hook.h + - include/grpcpp/impl/call_op_set_interface.h - include/grpcpp/impl/channel_argument_option.h - include/grpcpp/impl/client_unary_call.h - include/grpcpp/impl/codegen/async_generic_service.h @@ -3049,6 +3050,7 @@ libs: - include/grpcpp/health_check_service_interface.h - include/grpcpp/impl/call.h - include/grpcpp/impl/call_hook.h + - include/grpcpp/impl/call_op_set_interface.h - include/grpcpp/impl/channel_argument_option.h - include/grpcpp/impl/client_unary_call.h - include/grpcpp/impl/codegen/async_generic_service.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 28fe29c96af..1cc018f113b 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -94,6 +94,7 @@ Pod::Spec.new do |s| 'include/grpcpp/health_check_service_interface.h', 'include/grpcpp/impl/call.h', 'include/grpcpp/impl/call_hook.h', + 'include/grpcpp/impl/call_op_set_interface.h', 'include/grpcpp/impl/channel_argument_option.h', 'include/grpcpp/impl/client_unary_call.h', 'include/grpcpp/impl/codegen/async_generic_service.h', diff --git a/include/grpcpp/impl/call_op_set_interface.h b/include/grpcpp/impl/call_op_set_interface.h new file mode 100644 index 00000000000..43ed4ed94da --- /dev/null +++ b/include/grpcpp/impl/call_op_set_interface.h @@ -0,0 +1,61 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H +#define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H + +// IWYU pragma: private + +#include + +namespace grpc { +namespace internal { + +class Call; + +/// An abstract collection of call ops, used to generate the +/// grpc_call_op structure to pass down to the lower layers, +/// and as it is-a CompletionQueueTag, also massages the final +/// completion into the correct form for consumption in the C++ +/// API. +class CallOpSetInterface : public CompletionQueueTag { + public: + /// Fills in grpc_op, starting from ops[*nops] and moving + /// upwards. + virtual void FillOps(internal::Call* call) = 0; + + /// Get the tag to be used at the core completion queue. Generally, the + /// value of core_cq_tag will be "this". However, it can be overridden if we + /// want core to process the tag differently (e.g., as a core callback) + virtual void* core_cq_tag() = 0; + + // This will be called while interceptors are run if the RPC is a hijacked + // RPC. This should set hijacking state for each of the ops. + virtual void SetHijackingState() = 0; + + // Should be called after interceptors are done running + virtual void ContinueFillOpsAfterInterception() = 0; + + // Should be called after interceptors are done running on the finalize result + // path + virtual void ContinueFinalizeResultAfterInterception() = 0; +}; +} // namespace internal +} // namespace grpc + +#endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H diff --git a/include/grpcpp/impl/codegen/call_op_set_interface.h b/include/grpcpp/impl/codegen/call_op_set_interface.h index a8eed9f6193..ce5f2036d1b 100644 --- a/include/grpcpp/impl/codegen/call_op_set_interface.h +++ b/include/grpcpp/impl/codegen/call_op_set_interface.h @@ -21,41 +21,6 @@ // IWYU pragma: private -#include - -namespace grpc { -namespace internal { - -class Call; - -/// An abstract collection of call ops, used to generate the -/// grpc_call_op structure to pass down to the lower layers, -/// and as it is-a CompletionQueueTag, also massages the final -/// completion into the correct form for consumption in the C++ -/// API. -class CallOpSetInterface : public CompletionQueueTag { - public: - /// Fills in grpc_op, starting from ops[*nops] and moving - /// upwards. - virtual void FillOps(internal::Call* call) = 0; - - /// Get the tag to be used at the core completion queue. Generally, the - /// value of core_cq_tag will be "this". However, it can be overridden if we - /// want core to process the tag differently (e.g., as a core callback) - virtual void* core_cq_tag() = 0; - - // This will be called while interceptors are run if the RPC is a hijacked - // RPC. This should set hijacking state for each of the ops. - virtual void SetHijackingState() = 0; - - // Should be called after interceptors are done running - virtual void ContinueFillOpsAfterInterception() = 0; - - // Should be called after interceptors are done running on the finalize result - // path - virtual void ContinueFinalizeResultAfterInterception() = 0; -}; -} // namespace internal -} // namespace grpc +#include #endif // GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h index b084b7cef90..2595938c35b 100644 --- a/include/grpcpp/impl/codegen/interceptor_common.h +++ b/include/grpcpp/impl/codegen/interceptor_common.h @@ -25,8 +25,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/include/grpcpp/support/async_unary_call.h b/include/grpcpp/support/async_unary_call.h index f2c49e64e7b..a9886031f43 100644 --- a/include/grpcpp/support/async_unary_call.h +++ b/include/grpcpp/support/async_unary_call.h @@ -22,8 +22,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc index 4f92d670688..2164f2041b7 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -34,8 +34,7 @@ #include #include #include -#include -#include +#include #include #include #include diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 07475293320..af9c920750c 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -43,8 +43,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index e421c6c8d49..4d61b1b8805 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -42,8 +42,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 859bd040943..cecd320ca0b 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -956,6 +956,7 @@ include/grpcpp/grpcpp.h \ include/grpcpp/health_check_service_interface.h \ include/grpcpp/impl/call.h \ include/grpcpp/impl/call_hook.h \ +include/grpcpp/impl/call_op_set_interface.h \ include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/codegen/async_generic_service.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 87e745536bb..3643a512611 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -956,6 +956,7 @@ include/grpcpp/grpcpp.h \ include/grpcpp/health_check_service_interface.h \ include/grpcpp/impl/call.h \ include/grpcpp/impl/call_hook.h \ +include/grpcpp/impl/call_op_set_interface.h \ include/grpcpp/impl/channel_argument_option.h \ include/grpcpp/impl/client_unary_call.h \ include/grpcpp/impl/codegen/async_generic_service.h \