diff options
Diffstat (limited to 'include/grpcpp/impl')
-rw-r--r-- | include/grpcpp/impl/codegen/call.h | 19 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/call_wrapper.h | 5 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/channel_interface.h | 10 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/completion_queue.h | 1 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/intercepted_channel.h | 4 |
5 files changed, 35 insertions, 4 deletions
diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h index f4aae6fdc8..51cc18e2b1 100644 --- a/include/grpcpp/impl/codegen/call.h +++ b/include/grpcpp/impl/codegen/call.h @@ -1145,6 +1145,25 @@ class CallOpSet : public CallOpSetInterface, public Op6 { public: CallOpSet() : cq_tag_(this), return_tag_(this) {} + // The copy constructor and assignment operator reset the value of + // cq_tag_ and return_tag_ since those are only meaningful on a specific + // object, not across objects. + CallOpSet(const CallOpSet& other) + : cq_tag_(this), + return_tag_(this), + call_(other.call_), + done_intercepting_(false), + interceptor_methods_(InterceptorBatchMethodsImpl()) {} + + CallOpSet& operator=(const CallOpSet& other) { + cq_tag_ = this; + return_tag_ = this; + call_ = other.call_; + done_intercepting_ = false; + interceptor_methods_ = InterceptorBatchMethodsImpl(); + return *this; + } + void FillOps(Call* call) override { done_intercepting_ = false; g_core_codegen_interface->grpc_call_ref(call->call()); diff --git a/include/grpcpp/impl/codegen/call_wrapper.h b/include/grpcpp/impl/codegen/call_wrapper.h index 42216f9b6e..675e36feb9 100644 --- a/include/grpcpp/impl/codegen/call_wrapper.h +++ b/include/grpcpp/impl/codegen/call_wrapper.h @@ -29,6 +29,7 @@ class ServerRpcInfo; } // namespace experimental namespace internal { class CallHook; +class CallOpSetInterface; /// Straightforward wrapping of the C call object class Call final { @@ -61,9 +62,7 @@ class Call final { max_receive_message_size_(max_receive_message_size), server_rpc_info_(rpc_info) {} - void PerformOps(CallOpSetInterface* ops) { - call_hook_->PerformOpsOnCall(ops, this); - } + void PerformOps(CallOpSetInterface* ops); grpc_call* call() const { return call_; } CompletionQueue* cq() const { return cq_; } diff --git a/include/grpcpp/impl/codegen/channel_interface.h b/include/grpcpp/impl/codegen/channel_interface.h index 4427f55f35..03fa502df6 100644 --- a/include/grpcpp/impl/codegen/channel_interface.h +++ b/include/grpcpp/impl/codegen/channel_interface.h @@ -20,6 +20,7 @@ #define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H #include <grpc/impl/codegen/connectivity_state.h> +#include <grpcpp/impl/codegen/call_wrapper.h> #include <grpcpp/impl/codegen/status.h> #include <grpcpp/impl/codegen/time.h> @@ -121,6 +122,15 @@ class ChannelInterface { CompletionQueue* cq, void* tag) = 0; virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline) = 0; + // This is needed to keep codegen_test_minimal happy. InterceptedChannel needs + // to make use of this but can't directly call Channel's implementation + // because of the test. + virtual internal::Call CreateCallInternal(const internal::RpcMethod& method, + ClientContext* context, + CompletionQueue* cq, + int interceptor_pos) { + return internal::Call(); + } // EXPERIMENTAL // A method to get the callbackable completion queue associated with this diff --git a/include/grpcpp/impl/codegen/completion_queue.h b/include/grpcpp/impl/codegen/completion_queue.h index 34c2a477ae..fc1ed3278a 100644 --- a/include/grpcpp/impl/codegen/completion_queue.h +++ b/include/grpcpp/impl/codegen/completion_queue.h @@ -390,6 +390,7 @@ class ServerCompletionQueue : public CompletionQueue { grpc_cq_polling_type polling_type_; friend class ServerBuilder; + friend class Server; }; } // namespace grpc diff --git a/include/grpcpp/impl/codegen/intercepted_channel.h b/include/grpcpp/impl/codegen/intercepted_channel.h index 545ad1d965..91d9cd84e3 100644 --- a/include/grpcpp/impl/codegen/intercepted_channel.h +++ b/include/grpcpp/impl/codegen/intercepted_channel.h @@ -43,7 +43,9 @@ class InterceptedChannel : public ChannelInterface { internal::Call CreateCall(const internal::RpcMethod& method, ClientContext* context, - CompletionQueue* cq) override; + CompletionQueue* cq) override { + return channel_->CreateCallInternal(method, context, cq, interceptor_pos_); + } void PerformOpsOnCall(internal::CallOpSetInterface* ops, internal::Call* call) override { |