diff --git a/BUILD b/BUILD index 2d915db79e1..17a5350705e 100644 --- a/BUILD +++ b/BUILD @@ -341,6 +341,7 @@ GRPCXX_PUBLIC_HDRS = [ "include/grpcpp/impl/channel_interface.h", "include/grpcpp/impl/client_unary_call.h", "include/grpcpp/impl/codegen/core_codegen.h", + "include/grpcpp/impl/completion_queue_tag.h", "include/grpcpp/impl/grpc_library.h", "include/grpcpp/impl/method_handler_impl.h", "include/grpcpp/impl/rpc_method.h", diff --git a/CMakeLists.txt b/CMakeLists.txt index e368661f547..ea3d30ae05a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3448,6 +3448,7 @@ foreach(_hdr include/grpcpp/impl/codegen/sync.h include/grpcpp/impl/codegen/sync_stream.h include/grpcpp/impl/codegen/time.h + include/grpcpp/impl/completion_queue_tag.h include/grpcpp/impl/grpc_library.h include/grpcpp/impl/method_handler_impl.h include/grpcpp/impl/rpc_method.h @@ -4133,6 +4134,7 @@ foreach(_hdr include/grpcpp/impl/codegen/sync.h include/grpcpp/impl/codegen/sync_stream.h include/grpcpp/impl/codegen/time.h + include/grpcpp/impl/completion_queue_tag.h include/grpcpp/impl/grpc_library.h include/grpcpp/impl/method_handler_impl.h include/grpcpp/impl/rpc_method.h diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index a95634776ee..48a46cf525d 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -2826,6 +2826,7 @@ libs: - include/grpcpp/impl/codegen/sync.h - include/grpcpp/impl/codegen/sync_stream.h - include/grpcpp/impl/codegen/time.h + - include/grpcpp/impl/completion_queue_tag.h - include/grpcpp/impl/grpc_library.h - include/grpcpp/impl/method_handler_impl.h - include/grpcpp/impl/rpc_method.h @@ -3242,6 +3243,7 @@ libs: - include/grpcpp/impl/codegen/sync.h - include/grpcpp/impl/codegen/sync_stream.h - include/grpcpp/impl/codegen/time.h + - include/grpcpp/impl/completion_queue_tag.h - include/grpcpp/impl/grpc_library.h - include/grpcpp/impl/method_handler_impl.h - include/grpcpp/impl/rpc_method.h diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 8992f638228..881f0ca3e4f 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -146,6 +146,7 @@ Pod::Spec.new do |s| 'include/grpcpp/impl/codegen/sync.h', 'include/grpcpp/impl/codegen/sync_stream.h', 'include/grpcpp/impl/codegen/time.h', + 'include/grpcpp/impl/completion_queue_tag.h', 'include/grpcpp/impl/grpc_library.h', 'include/grpcpp/impl/method_handler_impl.h', 'include/grpcpp/impl/rpc_method.h', diff --git a/include/grpcpp/alarm.h b/include/grpcpp/alarm.h index 649e088d1a5..da47c63d573 100644 --- a/include/grpcpp/alarm.h +++ b/include/grpcpp/alarm.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/include/grpcpp/completion_queue.h b/include/grpcpp/completion_queue.h index 14657f12319..51e0de627e2 100644 --- a/include/grpcpp/completion_queue.h +++ b/include/grpcpp/completion_queue.h @@ -35,12 +35,12 @@ #include #include -#include #include #include #include #include #include +#include #include struct grpc_completion_queue; diff --git a/include/grpcpp/impl/call_op_set.h b/include/grpcpp/impl/call_op_set.h index dd59b139e08..2bfd659e689 100644 --- a/include/grpcpp/impl/call_op_set.h +++ b/include/grpcpp/impl/call_op_set.h @@ -31,10 +31,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/include/grpcpp/impl/call_op_set_interface.h b/include/grpcpp/impl/call_op_set_interface.h index 43ed4ed94da..416fe8fe0c3 100644 --- a/include/grpcpp/impl/call_op_set_interface.h +++ b/include/grpcpp/impl/call_op_set_interface.h @@ -21,7 +21,7 @@ // IWYU pragma: private -#include +#include namespace grpc { namespace internal { diff --git a/include/grpcpp/impl/codegen/completion_queue_tag.h b/include/grpcpp/impl/codegen/completion_queue_tag.h index 9af470b7502..7ca70306a61 100644 --- a/include/grpcpp/impl/codegen/completion_queue_tag.h +++ b/include/grpcpp/impl/codegen/completion_queue_tag.h @@ -21,36 +21,7 @@ // IWYU pragma: private -namespace grpc { - -namespace internal { -/// An interface allowing implementors to process and filter event tags. -class CompletionQueueTag { - public: - virtual ~CompletionQueueTag() {} - - /// FinalizeResult must be called before informing user code that the - /// operation bound to the underlying core completion queue tag has - /// completed. In practice, this means: - /// - /// 1. For the sync API - before returning from Pluck - /// 2. For the CQ-based async API - before returning from Next - /// 3. For the callback-based API - before invoking the user callback - /// - /// This is the method that translates from core-side tag/status to - /// C++ API-observable tag/status. - /// - /// The return value is the status of the operation (returning status is the - /// general behavior of this function). If this function returns false, the - /// tag is dropped and not returned from the completion queue: this concept is - /// for events that are observed at core but not requested by the user - /// application (e.g., server shutdown, for server unimplemented method - /// responses, or for cases where a server-side RPC doesn't have a completion - /// notification registered using AsyncNotifyWhenDone) - virtual bool FinalizeResult(void** tag, bool* status) = 0; -}; -} // namespace internal - -} // namespace grpc +/// TODO(chengyuc): Remove this file after solving compatibility. +#include #endif // GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H diff --git a/include/grpcpp/impl/codegen/server_interface.h b/include/grpcpp/impl/codegen/server_interface.h index 2f20dadec4e..635d26e796d 100644 --- a/include/grpcpp/impl/codegen/server_interface.h +++ b/include/grpcpp/impl/codegen/server_interface.h @@ -26,11 +26,11 @@ #include #include #include -#include #include #include #include #include +#include #include namespace grpc { diff --git a/include/grpcpp/impl/completion_queue_tag.h b/include/grpcpp/impl/completion_queue_tag.h new file mode 100644 index 00000000000..5828e54eb66 --- /dev/null +++ b/include/grpcpp/impl/completion_queue_tag.h @@ -0,0 +1,54 @@ +/* + * + * Copyright 2015 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_COMPLETION_QUEUE_TAG_H +#define GRPCPP_IMPL_COMPLETION_QUEUE_TAG_H + +namespace grpc { + +namespace internal { +/// An interface allowing implementors to process and filter event tags. +class CompletionQueueTag { + public: + virtual ~CompletionQueueTag() {} + + /// FinalizeResult must be called before informing user code that the + /// operation bound to the underlying core completion queue tag has + /// completed. In practice, this means: + /// + /// 1. For the sync API - before returning from Pluck + /// 2. For the CQ-based async API - before returning from Next + /// 3. For the callback-based API - before invoking the user callback + /// + /// This is the method that translates from core-side tag/status to + /// C++ API-observable tag/status. + /// + /// The return value is the status of the operation (returning status is the + /// general behavior of this function). If this function returns false, the + /// tag is dropped and not returned from the completion queue: this concept is + /// for events that are observed at core but not requested by the user + /// application (e.g., server shutdown, for server unimplemented method + /// responses, or for cases where a server-side RPC doesn't have a completion + /// notification registered using AsyncNotifyWhenDone) + virtual bool FinalizeResult(void** tag, bool* status) = 0; +}; +} // namespace internal + +} // namespace grpc + +#endif // GRPCPP_IMPL_COMPLETION_QUEUE_TAG_H diff --git a/include/grpcpp/server_context.h b/include/grpcpp/server_context.h index 4ebe8fa42c6..352a4ce8a78 100644 --- a/include/grpcpp/server_context.h +++ b/include/grpcpp/server_context.h @@ -31,9 +31,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/include/grpcpp/support/callback_common.h b/include/grpcpp/support/callback_common.h index 2ff18e2fe54..6a906df75df 100644 --- a/include/grpcpp/support/callback_common.h +++ b/include/grpcpp/support/callback_common.h @@ -24,8 +24,8 @@ #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 5a6b2893ee2..0a4781d1206 100644 --- a/src/cpp/client/channel_cc.cc +++ b/src/cpp/client/channel_cc.cc @@ -35,9 +35,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/cpp/common/alarm.cc b/src/cpp/common/alarm.cc index ecf9bc5fc96..bc1e0e5b2d1 100644 --- a/src/cpp/common/alarm.cc +++ b/src/cpp/common/alarm.cc @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "src/core/lib/gprpp/time.h" diff --git a/src/cpp/common/completion_queue_cc.cc b/src/cpp/common/completion_queue_cc.cc index d42743e66f7..c518b7a9f87 100644 --- a/src/cpp/common/completion_queue_cc.cc +++ b/src/cpp/common/completion_queue_cc.cc @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include "src/core/lib/gpr/useful.h" diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 7d0fdb39695..5a1a48c1a2e 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -45,12 +45,12 @@ #include #include #include -#include #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 53f0028deea..4ff84ccfe86 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -44,9 +44,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index 2d664cb8768..5e05ee075ea 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -1010,6 +1010,7 @@ include/grpcpp/impl/codegen/stub_options.h \ include/grpcpp/impl/codegen/sync.h \ include/grpcpp/impl/codegen/sync_stream.h \ include/grpcpp/impl/codegen/time.h \ +include/grpcpp/impl/completion_queue_tag.h \ include/grpcpp/impl/grpc_library.h \ include/grpcpp/impl/method_handler_impl.h \ include/grpcpp/impl/rpc_method.h \ diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index bc0734c17b0..6c6d9bf610e 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -1010,6 +1010,7 @@ include/grpcpp/impl/codegen/stub_options.h \ include/grpcpp/impl/codegen/sync.h \ include/grpcpp/impl/codegen/sync_stream.h \ include/grpcpp/impl/codegen/time.h \ +include/grpcpp/impl/completion_queue_tag.h \ include/grpcpp/impl/grpc_library.h \ include/grpcpp/impl/method_handler_impl.h \ include/grpcpp/impl/rpc_method.h \