diff options
Diffstat (limited to 'include/grpcpp/impl/codegen')
-rw-r--r-- | include/grpcpp/impl/codegen/async_stream.h | 27 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/async_unary_call.h | 9 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/call.h | 15 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/client_callback.h | 2 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/client_interceptor.h | 2 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/client_unary_call.h | 5 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/interceptor.h | 1 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/service_type.h | 2 |
8 files changed, 26 insertions, 37 deletions
diff --git a/include/grpcpp/impl/codegen/async_stream.h b/include/grpcpp/impl/codegen/async_stream.h index 258b73535e..6e58fd0eef 100644 --- a/include/grpcpp/impl/codegen/async_stream.h +++ b/include/grpcpp/impl/codegen/async_stream.h @@ -188,7 +188,7 @@ class ClientAsyncReaderFactory { ::grpc::internal::Call call = channel->CreateCall(method, context, cq); return new (g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncReader<R>))) - ClientAsyncReader<R>(std::move(call), context, request, start, tag); + ClientAsyncReader<R>(call, context, request, start, tag); } }; } // namespace internal @@ -264,7 +264,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { template <class W> ClientAsyncReader(::grpc::internal::Call call, ClientContext* context, const W& request, bool start, void* tag) - : context_(context), call_(std::move(call)), started_(start) { + : context_(context), call_(call), started_(start) { // TODO(ctiller): don't assert GPR_CODEGEN_ASSERT(init_ops_.SendMessage(request).ok()); init_ops_.ClientSendClose(); @@ -336,7 +336,7 @@ class ClientAsyncWriterFactory { ::grpc::internal::Call call = channel->CreateCall(method, context, cq); return new (g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncWriter<W>))) - ClientAsyncWriter<W>(std::move(call), context, response, start, tag); + ClientAsyncWriter<W>(call, context, response, start, tag); } }; } // namespace internal @@ -430,7 +430,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { template <class R> ClientAsyncWriter(::grpc::internal::Call call, ClientContext* context, R* response, bool start, void* tag) - : context_(context), call_(std::move(call)), started_(start) { + : context_(context), call_(call), started_(start) { finish_ops_.RecvMessage(response); finish_ops_.AllowNoMessage(); if (start) { @@ -501,7 +501,7 @@ class ClientAsyncReaderWriterFactory { return new (g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncReaderWriter<W, R>))) - ClientAsyncReaderWriter<W, R>(std::move(call), context, start, tag); + ClientAsyncReaderWriter<W, R>(call, context, start, tag); } }; } // namespace internal @@ -603,7 +603,7 @@ class ClientAsyncReaderWriter final friend class internal::ClientAsyncReaderWriterFactory<W, R>; ClientAsyncReaderWriter(::grpc::internal::Call call, ClientContext* context, bool start, void* tag) - : context_(context), call_(std::move(call)), started_(start) { + : context_(context), call_(call), started_(start) { if (start) { StartCallInternal(tag); } else { @@ -781,10 +781,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { } private: - ::grpc::internal::Call* BindCall(::grpc::internal::Call call) override { - call_ = std::move(call); - return &call_; - } + void BindCall(::grpc::internal::Call* call) override { call_ = *call; } ::grpc::internal::Call call_; ServerContext* ctx_; @@ -930,10 +927,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { } private: - ::grpc::internal::Call* BindCall(::grpc::internal::Call call) override { - call_ = std::move(call); - return &call_; - } + void BindCall(::grpc::internal::Call* call) override { call_ = *call; } template <class T> void EnsureInitialMetadataSent(T* ops) { @@ -1107,10 +1101,7 @@ class ServerAsyncReaderWriter final private: friend class ::grpc::Server; - ::grpc::internal::Call* BindCall(::grpc::internal::Call call) override { - call_ = std::move(call); - return &call_; - } + void BindCall(::grpc::internal::Call* call) override { call_ = *call; } template <class T> void EnsureInitialMetadataSent(T* ops) { diff --git a/include/grpcpp/impl/codegen/async_unary_call.h b/include/grpcpp/impl/codegen/async_unary_call.h index f34bc6b792..60ff8e2f05 100644 --- a/include/grpcpp/impl/codegen/async_unary_call.h +++ b/include/grpcpp/impl/codegen/async_unary_call.h @@ -87,7 +87,7 @@ class ClientAsyncResponseReaderFactory { ::grpc::internal::Call call = channel->CreateCall(method, context, cq); return new (g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncResponseReader<R>))) - ClientAsyncResponseReader<R>(std::move(call), context, request, start); + ClientAsyncResponseReader<R>(call, context, request, start); } }; } // namespace internal @@ -165,7 +165,7 @@ class ClientAsyncResponseReader final template <class W> ClientAsyncResponseReader(::grpc::internal::Call call, ClientContext* context, const W& request, bool start) - : context_(context), call_(std::move(call)), started_(start) { + : context_(context), call_(call), started_(start) { // Bind the metadata at time of StartCallInternal but set up the rest here // TODO(ctiller): don't assert GPR_CODEGEN_ASSERT(single_buf.SendMessage(request).ok()); @@ -286,10 +286,7 @@ class ServerAsyncResponseWriter final } private: - ::grpc::internal::Call* BindCall(::grpc::internal::Call call) override { - call_ = std::move(call); - return &call_; - } + void BindCall(::grpc::internal::Call* call) override { call_ = *call; } ::grpc::internal::Call call_; ServerContext* ctx_; diff --git a/include/grpcpp/impl/codegen/call.h b/include/grpcpp/impl/codegen/call.h index 1f9128d8db..684148efb6 100644 --- a/include/grpcpp/impl/codegen/call.h +++ b/include/grpcpp/impl/codegen/call.h @@ -19,8 +19,8 @@ #ifndef GRPCPP_IMPL_CODEGEN_CALL_H #define GRPCPP_IMPL_CODEGEN_CALL_H -#include <array> #include <assert.h> +#include <array> #include <cstring> #include <functional> #include <map> @@ -900,7 +900,7 @@ class InterceptorBatchMethodsImpl } virtual void Hijack() override { /* fill this */ - GPR_ASSERT(!reverse_); + GPR_CODEGEN_ASSERT(!reverse_); auto* rpc_info = call_->rpc_info(); rpc_info->hijacked_ = true; rpc_info->hijacked_interceptor_ = curr_iteration_; @@ -1158,17 +1158,18 @@ class CallOpSet : public CallOpSetInterface, this->Op4::AddOp(ops, &nops); this->Op5::AddOp(ops, &nops); this->Op6::AddOp(ops, &nops); - GPR_ASSERT(GRPC_CALL_OK == g_core_codegen_interface->grpc_call_start_batch( - call_.call(), ops, nops, cq_tag(), nullptr)); + GPR_CODEGEN_ASSERT(GRPC_CALL_OK == + g_core_codegen_interface->grpc_call_start_batch( + call_.call(), ops, nops, cq_tag(), nullptr)); } /* Should be called after interceptors are done running on the finalize result * path */ void ContinueFinalizeResultAfterInterception() override { done_intercepting_ = true; - GPR_ASSERT(GRPC_CALL_OK == - g_core_codegen_interface->grpc_call_start_batch( - call_.call(), nullptr, 0, cq_tag(), nullptr)); + GPR_CODEGEN_ASSERT(GRPC_CALL_OK == + g_core_codegen_interface->grpc_call_start_batch( + call_.call(), nullptr, 0, cq_tag(), nullptr)); } private: diff --git a/include/grpcpp/impl/codegen/client_callback.h b/include/grpcpp/impl/codegen/client_callback.h index ae9a8a95f9..4d4faea063 100644 --- a/include/grpcpp/impl/codegen/client_callback.h +++ b/include/grpcpp/impl/codegen/client_callback.h @@ -57,7 +57,7 @@ class CallbackUnaryCallImpl { std::function<void(Status)> on_completion) { CompletionQueue* cq = channel->CallbackCQ(); GPR_CODEGEN_ASSERT(cq != nullptr); - Call call = channel->CreateCall(method, context, cq); + Call call(channel->CreateCall(method, context, cq)); using FullCallOpSet = CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, diff --git a/include/grpcpp/impl/codegen/client_interceptor.h b/include/grpcpp/impl/codegen/client_interceptor.h index 6b02a89012..50272721f0 100644 --- a/include/grpcpp/impl/codegen/client_interceptor.h +++ b/include/grpcpp/impl/codegen/client_interceptor.h @@ -105,7 +105,7 @@ class ClientRpcInfo { void RunInterceptor( experimental::InterceptorBatchMethods* interceptor_methods, unsigned int pos) { - GPR_ASSERT(pos < interceptors_.size()); + GPR_CODEGEN_ASSERT(pos < interceptors_.size()); interceptors_[pos]->Intercept(interceptor_methods); } diff --git a/include/grpcpp/impl/codegen/client_unary_call.h b/include/grpcpp/impl/codegen/client_unary_call.h index dad31546cc..e4e8364e07 100644 --- a/include/grpcpp/impl/codegen/client_unary_call.h +++ b/include/grpcpp/impl/codegen/client_unary_call.h @@ -52,7 +52,7 @@ class BlockingUnaryCallImpl { CompletionQueue cq(grpc_completion_queue_attributes{ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, nullptr}); // Pluckable completion queue - call_ = std::move(channel->CreateCall(method, context, &cq)); + Call call(channel->CreateCall(method, context, &cq)); CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpClientSendClose, CallOpClientRecvStatus> @@ -68,7 +68,7 @@ class BlockingUnaryCallImpl { ops.AllowNoMessage(); ops.ClientSendClose(); ops.ClientRecvStatus(context, &status_); - call_.PerformOps(&ops); + call.PerformOps(&ops); if (cq.Pluck(&ops)) { if (!ops.got_message && status_.ok()) { status_ = Status(StatusCode::UNIMPLEMENTED, @@ -82,7 +82,6 @@ class BlockingUnaryCallImpl { private: Status status_; - Call call_; }; } // namespace internal diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h index 0b6d796d35..2409388695 100644 --- a/include/grpcpp/impl/codegen/interceptor.h +++ b/include/grpcpp/impl/codegen/interceptor.h @@ -21,6 +21,7 @@ #include <grpc/impl/codegen/grpc_types.h> #include <grpcpp/impl/codegen/config.h> +#include <grpcpp/impl/codegen/core_codegen_interface.h> // struct grpc_byte_buffer; // struct grpc_status_code; diff --git a/include/grpcpp/impl/codegen/service_type.h b/include/grpcpp/impl/codegen/service_type.h index e6ade93087..9f1a052168 100644 --- a/include/grpcpp/impl/codegen/service_type.h +++ b/include/grpcpp/impl/codegen/service_type.h @@ -50,7 +50,7 @@ class ServerAsyncStreamingInterface { private: friend class ::grpc::ServerInterface; - virtual Call* BindCall(Call call) = 0; + virtual void BindCall(Call* call) = 0; }; } // namespace internal |