call_op_set_interface.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. //
  3. // Copyright 2018 gRPC authors.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. //
  17. //
  18. #ifndef GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H
  19. #define GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H
  20. // IWYU pragma: private
  21. #include <grpcpp/impl/completion_queue_tag.h>
  22. namespace grpc {
  23. namespace internal {
  24. class Call;
  25. /// An abstract collection of call ops, used to generate the
  26. /// grpc_call_op structure to pass down to the lower layers,
  27. /// and as it is-a CompletionQueueTag, also massages the final
  28. /// completion into the correct form for consumption in the C++
  29. /// API.
  30. class CallOpSetInterface : public CompletionQueueTag {
  31. public:
  32. /// Fills in grpc_op, starting from ops[*nops] and moving
  33. /// upwards.
  34. virtual void FillOps(internal::Call* call) = 0;
  35. /// Get the tag to be used at the core completion queue. Generally, the
  36. /// value of core_cq_tag will be "this". However, it can be overridden if we
  37. /// want core to process the tag differently (e.g., as a core callback)
  38. virtual void* core_cq_tag() = 0;
  39. // This will be called while interceptors are run if the RPC is a hijacked
  40. // RPC. This should set hijacking state for each of the ops.
  41. virtual void SetHijackingState() = 0;
  42. // Should be called after interceptors are done running
  43. virtual void ContinueFillOpsAfterInterception() = 0;
  44. // Should be called after interceptors are done running on the finalize result
  45. // path
  46. virtual void ContinueFinalizeResultAfterInterception() = 0;
  47. };
  48. } // namespace internal
  49. } // namespace grpc
  50. #endif // GRPCPP_IMPL_CALL_OP_SET_INTERFACE_H