diff options
author | thegeorg <thegeorg@yandex-team.com> | 2023-03-28 10:11:46 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2023-03-28 10:11:46 +0300 |
commit | 14a9357e8d2d937e22b789d5aea09219a3e92c31 (patch) | |
tree | 9e899edffa271e32ae6272be3034a371b3742c2a /contrib/libs/grpc/include/grpcpp/impl/codegen | |
parent | 1911ec1bf2da9ae39eb5f31511a92b06b9631da1 (diff) | |
download | ydb-14a9357e8d2d937e22b789d5aea09219a3e92c31.tar.gz |
Update contrib/libs/grpc to 1.45.2
Diffstat (limited to 'contrib/libs/grpc/include/grpcpp/impl/codegen')
22 files changed, 774 insertions, 789 deletions
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h index 6499f63f68..8aaeb2b824 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h @@ -73,8 +73,8 @@ class AsyncGenericService final { void RequestCall(GenericServerContext* ctx, GenericServerAsyncReaderWriter* reader_writer, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, void* tag); + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag); private: friend class grpc::Server; @@ -92,7 +92,7 @@ class GenericCallbackServerContext final : public grpc::CallbackServerContext { const TString& host() const { return host_; } private: - friend class ::grpc::Server; + friend class grpc::Server; TString method_; TString host_; @@ -124,7 +124,7 @@ class CallbackGenericService { internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>* Handler() { return new internal::CallbackBidiHandler<ByteBuffer, ByteBuffer>( - [this](::grpc::CallbackServerContext* ctx) { + [this](grpc::CallbackServerContext* ctx) { return CreateReactor(static_cast<GenericCallbackServerContext*>(ctx)); }); } diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h index db5b3747a2..5b63c30173 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h @@ -75,7 +75,7 @@ class ClientAsyncStreamingInterface { /// /// \param[in] tag Tag identifying this request. /// \param[out] status To be updated with the operation status. - virtual void Finish(::grpc::Status* status, void* tag) = 0; + virtual void Finish(grpc::Status* status, void* tag) = 0; }; /// An interface that yields a sequence of messages of type \a R. @@ -135,7 +135,7 @@ class AsyncWriterInterface { /// \param[in] msg The message to be written. /// \param[in] options The WriteOptions to be used to write this message. /// \param[in] tag The tag identifying the operation. - virtual void Write(const W& msg, ::grpc::WriteOptions options, void* tag) = 0; + virtual void Write(const W& msg, grpc::WriteOptions options, void* tag) = 0; /// Request the writing of \a msg and coalesce it with the writing /// of trailing metadata, using WriteOptions \a options with @@ -155,7 +155,7 @@ class AsyncWriterInterface { /// \param[in] msg The message to be written. /// \param[in] options The WriteOptions to be used to write this message. /// \param[in] tag The tag identifying the operation. - void WriteLast(const W& msg, ::grpc::WriteOptions options, void* tag) { + void WriteLast(const W& msg, grpc::WriteOptions options, void* tag) { Write(msg, options.set_last_message(), tag); } }; @@ -179,13 +179,13 @@ class ClientAsyncReaderFactory { /// Note that \a context will be used to fill in custom initial metadata /// used to send to the server when starting the call. template <class W> - static ClientAsyncReader<R>* Create(::grpc::ChannelInterface* channel, - ::grpc::CompletionQueue* cq, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, + static ClientAsyncReader<R>* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const W& request, bool start, void* tag) { - ::grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncReader<R>))) ClientAsyncReader<R>(call, context, request, start, tag); } @@ -248,7 +248,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { /// Side effect: /// - the \a ClientContext associated with this call is updated with /// possible initial and trailing metadata received from the server. - void Finish(::grpc::Status* status, void* tag) override { + void Finish(grpc::Status* status, void* tag) override { GPR_CODEGEN_ASSERT(started_); finish_ops_.set_output_tag(tag); if (!context_->initial_metadata_received_) { @@ -261,7 +261,7 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { private: friend class internal::ClientAsyncReaderFactory<R>; template <class W> - ClientAsyncReader(::grpc::internal::Call call, ::grpc::ClientContext* context, + ClientAsyncReader(grpc::internal::Call call, grpc::ClientContext* context, const W& request, bool start, void* tag) : context_(context), call_(call), started_(start) { // TODO(ctiller): don't assert @@ -281,20 +281,20 @@ class ClientAsyncReader final : public ClientAsyncReaderInterface<R> { call_.PerformOps(&init_ops_); } - ::grpc::ClientContext* context_; - ::grpc::internal::Call call_; + grpc::ClientContext* context_; + grpc::internal::Call call_; bool started_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> init_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpRecvMessage<R>> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpRecvMessage<R>> read_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpClientRecvStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpClientRecvStatus> finish_ops_; }; @@ -327,13 +327,13 @@ class ClientAsyncWriterFactory { /// message from the server upon a successful call to the \a Finish /// method of this instance. template <class R> - static ClientAsyncWriter<W>* Create(::grpc::ChannelInterface* channel, - ::grpc::CompletionQueue* cq, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, - R* response, bool start, void* tag) { - ::grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + static ClientAsyncWriter<W>* Create(grpc::ChannelInterface* channel, + grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response, + bool start, void* tag) { + grpc::internal::Call call = channel->CreateCall(method, context, cq); + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncWriter<W>))) ClientAsyncWriter<W>(call, context, response, start, tag); } @@ -388,7 +388,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { call_.PerformOps(&write_ops_); } - void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { GPR_CODEGEN_ASSERT(started_); write_ops_.set_output_tag(tag); if (options.is_last_message()) { @@ -414,7 +414,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { /// possible initial and trailing metadata received from the server. /// - attempts to fill in the \a response parameter passed to this class's /// constructor with the server's response message. - void Finish(::grpc::Status* status, void* tag) override { + void Finish(grpc::Status* status, void* tag) override { GPR_CODEGEN_ASSERT(started_); finish_ops_.set_output_tag(tag); if (!context_->initial_metadata_received_) { @@ -427,7 +427,7 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { private: friend class internal::ClientAsyncWriterFactory<W>; template <class R> - ClientAsyncWriter(::grpc::internal::Call call, ::grpc::ClientContext* context, + ClientAsyncWriter(grpc::internal::Call call, grpc::ClientContext* context, R* response, bool start, void* tag) : context_(context), call_(call), started_(start) { finish_ops_.RecvMessage(response); @@ -450,18 +450,18 @@ class ClientAsyncWriter final : public ClientAsyncWriterInterface<W> { } } - ::grpc::ClientContext* context_; - ::grpc::internal::Call call_; + grpc::ClientContext* context_; + grpc::internal::Call call_; bool started_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> write_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpGenericRecvMessage, - ::grpc::internal::CallOpClientRecvStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpGenericRecvMessage, + grpc::internal::CallOpClientRecvStatus> finish_ops_; }; @@ -493,12 +493,12 @@ class ClientAsyncReaderWriterFactory { /// Note that \a context will be used to fill in custom initial metadata /// used to send to the server when starting the call. static ClientAsyncReaderWriter<W, R>* Create( - ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq, - const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, bool start, void* tag) { - ::grpc::internal::Call call = channel->CreateCall(method, context, cq); + grpc::internal::Call call = channel->CreateCall(method, context, cq); - return new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + return new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncReaderWriter<W, R>))) ClientAsyncReaderWriter<W, R>(call, context, start, tag); } @@ -565,7 +565,7 @@ class ClientAsyncReaderWriter final call_.PerformOps(&write_ops_); } - void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { GPR_CODEGEN_ASSERT(started_); write_ops_.set_output_tag(tag); if (options.is_last_message()) { @@ -588,7 +588,7 @@ class ClientAsyncReaderWriter final /// Side effect /// - the \a ClientContext associated with this call is updated with /// possible initial and trailing metadata sent from the server. - void Finish(::grpc::Status* status, void* tag) override { + void Finish(grpc::Status* status, void* tag) override { GPR_CODEGEN_ASSERT(started_); finish_ops_.set_output_tag(tag); if (!context_->initial_metadata_received_) { @@ -600,8 +600,8 @@ class ClientAsyncReaderWriter final private: friend class internal::ClientAsyncReaderWriterFactory<W, R>; - ClientAsyncReaderWriter(::grpc::internal::Call call, - ::grpc::ClientContext* context, bool start, void* tag) + ClientAsyncReaderWriter(grpc::internal::Call call, + grpc::ClientContext* context, bool start, void* tag) : context_(context), call_(call), started_(start) { if (start) { StartCallInternal(tag); @@ -621,26 +621,26 @@ class ClientAsyncReaderWriter final } } - ::grpc::ClientContext* context_; - ::grpc::internal::Call call_; + grpc::ClientContext* context_; + grpc::internal::Call call_; bool started_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpRecvMessage<R>> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpRecvMessage<R>> read_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> write_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpClientRecvStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpClientRecvStatus> finish_ops_; }; template <class W, class R> class ServerAsyncReaderInterface - : public ::grpc::internal::ServerAsyncStreamingInterface, + : public grpc::internal::ServerAsyncStreamingInterface, public internal::AsyncReaderInterface<R> { public: /// Indicate that the stream is to be finished with a certain status code @@ -665,8 +665,7 @@ class ServerAsyncReaderInterface /// \param[in] tag Tag identifying this request. /// \param[in] status To be sent to the client as the result of this call. /// \param[in] msg To be sent to the client as the response for this call. - virtual void Finish(const W& msg, const ::grpc::Status& status, - void* tag) = 0; + virtual void Finish(const W& msg, const grpc::Status& status, void* tag) = 0; /// Indicate that the stream is to be finished with a certain /// non-OK status code. @@ -689,7 +688,7 @@ class ServerAsyncReaderInterface /// \param[in] tag Tag identifying this request. /// \param[in] status To be sent to the client as the result of this call. /// - Note: \a status must have a non-OK code. - virtual void FinishWithError(const ::grpc::Status& status, void* tag) = 0; + virtual void FinishWithError(const grpc::Status& status, void* tag) = 0; }; /// Async server-side API for doing client-streaming RPCs, @@ -698,7 +697,7 @@ class ServerAsyncReaderInterface template <class W, class R> class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { public: - explicit ServerAsyncReader(::grpc::ServerContext* ctx) + explicit ServerAsyncReader(grpc::ServerContext* ctx) : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. @@ -736,7 +735,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { /// /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it /// is safe to deallocate once Finish returns. - void Finish(const W& msg, const ::grpc::Status& status, void* tag) override { + void Finish(const W& msg, const grpc::Status& status, void* tag) override { finish_ops_.set_output_tag(tag); if (!ctx_->sent_initial_metadata_) { finish_ops_.SendInitialMetadata(&ctx_->initial_metadata_, @@ -765,7 +764,7 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { /// /// gRPC doesn't take ownership or a reference to \a status, so it is safe to /// to deallocate once FinishWithError returns. - void FinishWithError(const ::grpc::Status& status, void* tag) override { + void FinishWithError(const grpc::Status& status, void* tag) override { GPR_CODEGEN_ASSERT(!status.ok()); finish_ops_.set_output_tag(tag); if (!ctx_->sent_initial_metadata_) { @@ -781,22 +780,22 @@ class ServerAsyncReader final : public ServerAsyncReaderInterface<W, R> { } private: - void BindCall(::grpc::internal::Call* call) override { call_ = *call; } + void BindCall(grpc::internal::Call* call) override { call_ = *call; } - ::grpc::internal::Call call_; - ::grpc::ServerContext* ctx_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_ops_; }; template <class W> class ServerAsyncWriterInterface - : public ::grpc::internal::ServerAsyncStreamingInterface, + : public grpc::internal::ServerAsyncStreamingInterface, public internal::AsyncWriterInterface<W> { public: /// Indicate that the stream is to be finished with a certain status code. @@ -820,7 +819,7 @@ class ServerAsyncWriterInterface /// /// \param[in] tag Tag identifying this request. /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const ::grpc::Status& status, void* tag) = 0; + virtual void Finish(const grpc::Status& status, void* tag) = 0; /// Request the writing of \a msg and coalesce it with trailing metadata which /// contains \a status, using WriteOptions options with @@ -836,8 +835,8 @@ class ServerAsyncWriterInterface /// \param[in] options The WriteOptions to be used to write this message. /// \param[in] status The Status that server returns to client. /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options, - const ::grpc::Status& status, void* tag) = 0; + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; }; /// Async server-side API for doing server streaming RPCs, @@ -845,7 +844,7 @@ class ServerAsyncWriterInterface template <class W> class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { public: - explicit ServerAsyncWriter(::grpc::ServerContext* ctx) + explicit ServerAsyncWriter(grpc::ServerContext* ctx) : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. @@ -876,7 +875,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { call_.PerformOps(&write_ops_); } - void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { write_ops_.set_output_tag(tag); if (options.is_last_message()) { options.set_buffer_hint(); @@ -898,8 +897,8 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { /// /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, ::grpc::WriteOptions options, - const ::grpc::Status& status, void* tag) override { + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { write_ops_.set_output_tag(tag); EnsureInitialMetadataSent(&write_ops_); options.set_buffer_hint(); @@ -919,7 +918,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { /// /// gRPC doesn't take ownership or a reference to \a status, so it is safe to /// to deallocate once Finish returns. - void Finish(const ::grpc::Status& status, void* tag) override { + void Finish(const grpc::Status& status, void* tag) override { finish_ops_.set_output_tag(tag); EnsureInitialMetadataSent(&finish_ops_); finish_ops_.ServerSendStatus(&ctx_->trailing_metadata_, status); @@ -927,7 +926,7 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { } private: - void BindCall(::grpc::internal::Call* call) override { call_ = *call; } + void BindCall(grpc::internal::Call* call) override { call_ = *call; } template <class T> void EnsureInitialMetadataSent(T* ops) { @@ -941,23 +940,23 @@ class ServerAsyncWriter final : public ServerAsyncWriterInterface<W> { } } - ::grpc::internal::Call call_; - ::grpc::ServerContext* ctx_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> write_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpServerSendStatus> finish_ops_; }; /// Server-side interface for asynchronous bi-directional streaming. template <class W, class R> class ServerAsyncReaderWriterInterface - : public ::grpc::internal::ServerAsyncStreamingInterface, + : public grpc::internal::ServerAsyncStreamingInterface, public internal::AsyncWriterInterface<W>, public internal::AsyncReaderInterface<R> { public: @@ -983,7 +982,7 @@ class ServerAsyncReaderWriterInterface /// /// \param[in] tag Tag identifying this request. /// \param[in] status To be sent to the client as the result of this call. - virtual void Finish(const ::grpc::Status& status, void* tag) = 0; + virtual void Finish(const grpc::Status& status, void* tag) = 0; /// Request the writing of \a msg and coalesce it with trailing metadata which /// contains \a status, using WriteOptions options with @@ -999,8 +998,8 @@ class ServerAsyncReaderWriterInterface /// \param[in] options The WriteOptions to be used to write this message. /// \param[in] status The Status that server returns to client. /// \param[in] tag The tag identifying the operation. - virtual void WriteAndFinish(const W& msg, ::grpc::WriteOptions options, - const ::grpc::Status& status, void* tag) = 0; + virtual void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) = 0; }; /// Async server-side API for doing bidirectional streaming RPCs, @@ -1011,7 +1010,7 @@ template <class W, class R> class ServerAsyncReaderWriter final : public ServerAsyncReaderWriterInterface<W, R> { public: - explicit ServerAsyncReaderWriter(::grpc::ServerContext* ctx) + explicit ServerAsyncReaderWriter(grpc::ServerContext* ctx) : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. @@ -1048,7 +1047,7 @@ class ServerAsyncReaderWriter final call_.PerformOps(&write_ops_); } - void Write(const W& msg, ::grpc::WriteOptions options, void* tag) override { + void Write(const W& msg, grpc::WriteOptions options, void* tag) override { write_ops_.set_output_tag(tag); if (options.is_last_message()) { options.set_buffer_hint(); @@ -1069,8 +1068,8 @@ class ServerAsyncReaderWriter final // /// gRPC doesn't take ownership or a reference to \a msg and \a status, so it /// is safe to deallocate once WriteAndFinish returns. - void WriteAndFinish(const W& msg, ::grpc::WriteOptions options, - const ::grpc::Status& status, void* tag) override { + void WriteAndFinish(const W& msg, grpc::WriteOptions options, + const grpc::Status& status, void* tag) override { write_ops_.set_output_tag(tag); EnsureInitialMetadataSent(&write_ops_); options.set_buffer_hint(); @@ -1090,7 +1089,7 @@ class ServerAsyncReaderWriter final // /// gRPC doesn't take ownership or a reference to \a status, so it is safe to /// to deallocate once Finish returns. - void Finish(const ::grpc::Status& status, void* tag) override { + void Finish(const grpc::Status& status, void* tag) override { finish_ops_.set_output_tag(tag); EnsureInitialMetadataSent(&finish_ops_); @@ -1099,9 +1098,9 @@ class ServerAsyncReaderWriter final } private: - friend class ::grpc::Server; + friend class grpc::Server; - void BindCall(::grpc::internal::Call* call) override { call_ = *call; } + void BindCall(grpc::internal::Call* call) override { call_ = *call; } template <class T> void EnsureInitialMetadataSent(T* ops) { @@ -1115,17 +1114,17 @@ class ServerAsyncReaderWriter final } } - ::grpc::internal::Call call_; - ::grpc::ServerContext* ctx_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> read_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> read_ops_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> write_ops_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpServerSendStatus> finish_ops_; }; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h index d7a3b57314..0034d21058 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h @@ -70,7 +70,7 @@ class ClientAsyncResponseReaderInterface { /// \param[in] tag Tag identifying this request. /// \param[out] status To be updated with the operation status. /// \param[out] msg To be filled in with the server's response message. - virtual void Finish(R* msg, ::grpc::Status* status, void* tag) = 0; + virtual void Finish(R* msg, grpc::Status* status, void* tag) = 0; }; namespace internal { @@ -91,12 +91,12 @@ class ClientAsyncResponseReaderHelper { /// extraneous parameter just to provide the needed type information. template <class R, class W, class BaseR = R, class BaseW = W> static ClientAsyncResponseReader<R>* Create( - ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq, - const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, const W& request) /* __attribute__((noinline)) */ { - ::grpc::internal::Call call = channel->CreateCall(method, context, cq); + grpc::internal::Call call = channel->CreateCall(method, context, cq); ClientAsyncResponseReader<R>* result = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientAsyncResponseReader<R>))) ClientAsyncResponseReader<R>(call, context); SetupRequest<BaseR, BaseW>( @@ -111,7 +111,7 @@ class ClientAsyncResponseReaderHelper { template <class R, class W> static void SetupRequest( grpc_call* call, - ::grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, + grpc::internal::CallOpSendInitialMetadata** single_buf_ptr, std::function<void(ClientContext*, internal::Call*, internal::CallOpSendInitialMetadata*, void*)>* read_initial_metadata, @@ -121,14 +121,14 @@ class ClientAsyncResponseReaderHelper { internal::CallOpSetInterface**, void*, Status*, void*)>* finish, const W& request) { using SingleBufType = - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose, - ::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpRecvMessage<R>, - ::grpc::internal::CallOpClientRecvStatus>; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose, + grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpRecvMessage<R>, + grpc::internal::CallOpClientRecvStatus>; SingleBufType* single_buf = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call, sizeof(SingleBufType))) SingleBufType; *single_buf_ptr = single_buf; // TODO(ctiller): don't assert @@ -162,11 +162,11 @@ class ClientAsyncResponseReaderHelper { internal::CallOpSetInterface** finish_buf_ptr, void* msg, Status* status, void* tag) { if (initial_metadata_read) { - using FinishBufType = ::grpc::internal::CallOpSet< - ::grpc::internal::CallOpRecvMessage<R>, - ::grpc::internal::CallOpClientRecvStatus>; + using FinishBufType = + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>, + grpc::internal::CallOpClientRecvStatus>; FinishBufType* finish_buf = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call->call(), sizeof(FinishBufType))) FinishBufType; *finish_buf_ptr = finish_buf; finish_buf->set_output_tag(tag); @@ -186,9 +186,8 @@ class ClientAsyncResponseReaderHelper { }; } - static void StartCall( - ::grpc::ClientContext* context, - ::grpc::internal::CallOpSendInitialMetadata* single_buf) { + static void StartCall(grpc::ClientContext* context, + grpc::internal::CallOpSendInitialMetadata* single_buf) { single_buf->SendInitialMetadata(&context->send_initial_metadata_, context->initial_metadata_flags()); } @@ -201,8 +200,8 @@ class ClientAsyncResponseReaderFactory { public: template <class W> static ClientAsyncResponseReader<R>* Create( - ::grpc::ChannelInterface* channel, ::grpc::CompletionQueue* cq, - const ::grpc::internal::RpcMethod& method, ::grpc::ClientContext* context, + grpc::ChannelInterface* channel, grpc::CompletionQueue* cq, + const grpc::internal::RpcMethod& method, grpc::ClientContext* context, const W& request, bool start) { auto* result = ClientAsyncResponseReaderHelper::Create<R>( channel, cq, method, context, request); @@ -257,7 +256,7 @@ class ClientAsyncResponseReader final /// Side effect: /// - the \a ClientContext associated with this call is updated with /// possible initial and trailing metadata sent from the server. - void Finish(R* msg, ::grpc::Status* status, void* tag) override { + void Finish(R* msg, grpc::Status* status, void* tag) override { GPR_CODEGEN_DEBUG_ASSERT(started_); finish_(context_, &call_, initial_metadata_read_, single_buf_, &finish_buf_, static_cast<void*>(msg), status, tag); @@ -265,13 +264,13 @@ class ClientAsyncResponseReader final private: friend class internal::ClientAsyncResponseReaderHelper; - ::grpc::ClientContext* const context_; - ::grpc::internal::Call call_; + grpc::ClientContext* const context_; + grpc::internal::Call call_; bool started_ = false; bool initial_metadata_read_ = false; - ClientAsyncResponseReader(::grpc::internal::Call call, - ::grpc::ClientContext* context) + ClientAsyncResponseReader(grpc::internal::Call call, + grpc::ClientContext* context) : context_(context), call_(call) {} // disable operator new @@ -294,9 +293,9 @@ class ClientAsyncResponseReader final /// response message sent to the client is of type \a W. template <class W> class ServerAsyncResponseWriter final - : public ::grpc::internal::ServerAsyncStreamingInterface { + : public grpc::internal::ServerAsyncStreamingInterface { public: - explicit ServerAsyncResponseWriter(::grpc::ServerContext* ctx) + explicit ServerAsyncResponseWriter(grpc::ServerContext* ctx) : call_(nullptr, nullptr, nullptr), ctx_(ctx) {} /// See \a ServerAsyncStreamingInterface::SendInitialMetadata for semantics. @@ -334,7 +333,11 @@ class ServerAsyncResponseWriter final /// Note: if \a status has a non-OK code, then \a msg will not be sent, /// and the client will receive only the status with possible trailing /// metadata. - void Finish(const W& msg, const ::grpc::Status& status, void* tag) { + /// + /// gRPC doesn't take ownership or a reference to msg and status, so it is + /// safe to deallocate them once the Finish operation is complete (i.e. a + /// result arrives in the completion queue). + void Finish(const W& msg, const grpc::Status& status, void* tag) { finish_buf_.set_output_tag(tag); finish_buf_.set_core_cq_tag(&finish_buf_); if (!ctx_->sent_initial_metadata_) { @@ -367,7 +370,11 @@ class ServerAsyncResponseWriter final /// Side effect: /// - also sends initial metadata if not already sent (using the /// \a ServerContext associated with this call). - void FinishWithError(const ::grpc::Status& status, void* tag) { + /// + /// gRPC doesn't take ownership or a reference to status, so it is safe to + /// deallocate them once the Finish operation is complete (i.e. a result + /// arrives in the completion queue). + void FinishWithError(const grpc::Status& status, void* tag) { GPR_CODEGEN_ASSERT(!status.ok()); finish_buf_.set_output_tag(tag); if (!ctx_->sent_initial_metadata_) { @@ -383,15 +390,15 @@ class ServerAsyncResponseWriter final } private: - void BindCall(::grpc::internal::Call* call) override { call_ = *call; } + void BindCall(grpc::internal::Call* call) override { call_ = *call; } - ::grpc::internal::Call call_; - ::grpc::ServerContext* ctx_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::Call call_; + grpc::ServerContext* ctx_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_buf_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_buf_; }; @@ -399,12 +406,12 @@ class ServerAsyncResponseWriter final namespace std { template <class R> -class default_delete<::grpc::ClientAsyncResponseReader<R>> { +class default_delete<grpc::ClientAsyncResponseReader<R>> { public: void operator()(void* /*p*/) {} }; template <class R> -class default_delete<::grpc::ClientAsyncResponseReaderInterface<R>> { +class default_delete<grpc::ClientAsyncResponseReaderInterface<R>> { public: void operator()(void* /*p*/) {} }; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h index d94ac3bc7b..a9ba7d16fc 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h @@ -42,10 +42,10 @@ class CallbackUnaryHandler; template <class RequestType, class ResponseType> class CallbackServerStreamingHandler; template <class RequestType> -void* UnaryDeserializeHelper(grpc_byte_buffer*, ::grpc::Status*, RequestType*); +void* UnaryDeserializeHelper(grpc_byte_buffer*, grpc::Status*, RequestType*); template <class ServiceType, class RequestType, class ResponseType> class ServerStreamingHandler; -template <::grpc::StatusCode code> +template <grpc::StatusCode code> class ErrorMethodHandler; class CallOpSendMessage; template <class R> @@ -172,7 +172,7 @@ class ByteBuffer final { friend class internal::CallOpGenericRecvMessage; template <class RequestType> friend void* internal::UnaryDeserializeHelper(grpc_byte_buffer*, - ::grpc::Status*, RequestType*); + grpc::Status*, RequestType*); template <class ServiceType, class RequestType, class ResponseType> friend class internal::ServerStreamingHandler; template <class RequestType, class ResponseType> diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h index 96d0de53e3..90d54bc5d8 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h @@ -42,13 +42,13 @@ class Call final { call_(nullptr), max_receive_message_size_(-1) {} /** call is owned by the caller */ - Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq) + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq) : call_hook_(call_hook), cq_(cq), call_(call), max_receive_message_size_(-1) {} - Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq, + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, experimental::ClientRpcInfo* rpc_info) : call_hook_(call_hook), cq_(cq), @@ -56,7 +56,7 @@ class Call final { max_receive_message_size_(-1), client_rpc_info_(rpc_info) {} - Call(grpc_call* call, CallHook* call_hook, ::grpc::CompletionQueue* cq, + Call(grpc_call* call, CallHook* call_hook, grpc::CompletionQueue* cq, int max_receive_message_size, experimental::ServerRpcInfo* rpc_info) : call_hook_(call_hook), cq_(cq), @@ -69,7 +69,7 @@ class Call final { } grpc_call* call() const { return call_; } - ::grpc::CompletionQueue* cq() const { return cq_; } + grpc::CompletionQueue* cq() const { return cq_; } int max_receive_message_size() const { return max_receive_message_size_; } @@ -83,7 +83,7 @@ class Call final { private: CallHook* call_hook_; - ::grpc::CompletionQueue* cq_; + grpc::CompletionQueue* cq_; grpc_call* call_; int max_receive_message_size_; experimental::ClientRpcInfo* client_rpc_info_ = nullptr; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h index 5ad0a74d83..283f299f95 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h @@ -171,6 +171,12 @@ class WriteOptions { return *this; } + /// Get value for the flag indicating that this is the last message, and + /// should be coalesced with trailing metadata. + /// + /// \sa GRPC_WRITE_LAST_MESSAGE + bool is_last_message() const { return last_message_; } + /// Guarantee that all bytes have been written to the socket before completing /// this write (usually writes are completed when they pass flow control). inline WriteOptions& set_write_through() { @@ -178,13 +184,12 @@ class WriteOptions { return *this; } - inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); } + inline WriteOptions& clear_write_through() { + ClearBit(GRPC_WRITE_THROUGH); + return *this; + } - /// Get value for the flag indicating that this is the last message, and - /// should be coalesced with trailing metadata. - /// - /// \sa GRPC_WRITE_LAST_MESSAGE - bool is_last_message() const { return last_message_; } + inline bool is_write_through() const { return GetBit(GRPC_WRITE_THROUGH); } private: void SetBit(const uint32_t mask) { flags_ |= mask; } @@ -728,7 +733,7 @@ class CallOpRecvInitialMetadata { public: CallOpRecvInitialMetadata() : metadata_map_(nullptr) {} - void RecvInitialMetadata(::grpc::ClientContext* context) { + void RecvInitialMetadata(grpc::ClientContext* context) { context->initial_metadata_received_ = true; metadata_map_ = &context->recv_initial_metadata_; } @@ -777,7 +782,7 @@ class CallOpClientRecvStatus { CallOpClientRecvStatus() : recv_status_(nullptr), debug_error_string_(nullptr) {} - void ClientRecvStatus(::grpc::ClientContext* context, Status* status) { + void ClientRecvStatus(grpc::ClientContext* context, Status* status) { client_context_ = context; metadata_map_ = &client_context_->trailing_metadata_; recv_status_ = status; @@ -844,7 +849,7 @@ class CallOpClientRecvStatus { private: bool hijacked_ = false; - ::grpc::ClientContext* client_context_; + grpc::ClientContext* client_context_; MetadataMap* metadata_map_; Status* recv_status_; const char* debug_error_string_; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h index 09e67ae45d..106dd56c93 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h @@ -85,7 +85,7 @@ class ChannelInterface { /// deadline expires. \a GetState needs to called to get the current state. template <typename T> void NotifyOnStateChange(grpc_connectivity_state last_observed, T deadline, - ::grpc::CompletionQueue* cq, void* tag) { + grpc::CompletionQueue* cq, void* tag) { TimePoint<T> deadline_tp(deadline); NotifyOnStateChangeImpl(last_observed, deadline_tp.raw_time(), cq, tag); } @@ -110,41 +110,41 @@ class ChannelInterface { private: template <class R> - friend class ::grpc::ClientReader; + friend class grpc::ClientReader; template <class W> - friend class ::grpc::ClientWriter; + friend class grpc::ClientWriter; template <class W, class R> - friend class ::grpc::ClientReaderWriter; + friend class grpc::ClientReaderWriter; template <class R> - friend class ::grpc::internal::ClientAsyncReaderFactory; + friend class grpc::internal::ClientAsyncReaderFactory; template <class W> - friend class ::grpc::internal::ClientAsyncWriterFactory; + friend class grpc::internal::ClientAsyncWriterFactory; template <class W, class R> - friend class ::grpc::internal::ClientAsyncReaderWriterFactory; - friend class ::grpc::internal::ClientAsyncResponseReaderHelper; + friend class grpc::internal::ClientAsyncReaderWriterFactory; + friend class grpc::internal::ClientAsyncResponseReaderHelper; template <class W, class R> - friend class ::grpc::internal::ClientCallbackReaderWriterFactory; + friend class grpc::internal::ClientCallbackReaderWriterFactory; template <class R> - friend class ::grpc::internal::ClientCallbackReaderFactory; + friend class grpc::internal::ClientCallbackReaderFactory; template <class W> - friend class ::grpc::internal::ClientCallbackWriterFactory; - friend class ::grpc::internal::ClientCallbackUnaryFactory; + friend class grpc::internal::ClientCallbackWriterFactory; + friend class grpc::internal::ClientCallbackUnaryFactory; template <class InputMessage, class OutputMessage> - friend class ::grpc::internal::BlockingUnaryCallImpl; + friend class grpc::internal::BlockingUnaryCallImpl; template <class InputMessage, class OutputMessage> - friend class ::grpc::internal::CallbackUnaryCallImpl; - friend class ::grpc::internal::RpcMethod; - friend class ::grpc::experimental::DelegatingChannel; - friend class ::grpc::internal::InterceptedChannel; + friend class grpc::internal::CallbackUnaryCallImpl; + friend class grpc::internal::RpcMethod; + friend class grpc::experimental::DelegatingChannel; + friend class grpc::internal::InterceptedChannel; virtual internal::Call CreateCall(const internal::RpcMethod& method, - ::grpc::ClientContext* context, - ::grpc::CompletionQueue* cq) = 0; + grpc::ClientContext* context, + grpc::CompletionQueue* cq) = 0; virtual void PerformOpsOnCall(internal::CallOpSetInterface* ops, internal::Call* call) = 0; virtual void* RegisterMethod(const char* method) = 0; virtual void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline, - ::grpc::CompletionQueue* cq, + grpc::CompletionQueue* cq, void* tag) = 0; virtual bool WaitForStateChangeImpl(grpc_connectivity_state last_observed, gpr_timespec deadline) = 0; @@ -157,8 +157,8 @@ class ChannelInterface { // method and adding a new pure method to an interface would be a breaking // change (even though this is private and non-API) virtual internal::Call CreateCallInternal( - const internal::RpcMethod& /*method*/, ::grpc::ClientContext* /*context*/, - ::grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) { + const internal::RpcMethod& /*method*/, grpc::ClientContext* /*context*/, + grpc::CompletionQueue* /*cq*/, size_t /*interceptor_pos*/) { return internal::Call(); } @@ -169,7 +169,7 @@ class ChannelInterface { // Returns nullptr (rather than being pure) since this is a post-1.0 method // and adding a new pure method to an interface would be a breaking change // (even though this is private and non-API) - virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; } + virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; } }; } // namespace grpc diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h index ca65f6f414..06fef2e929 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h @@ -48,11 +48,11 @@ class RpcMethod; template <class InputMessage, class OutputMessage, class BaseInputMessage = InputMessage, class BaseOutputMessage = OutputMessage> -void CallbackUnaryCall(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, +void CallbackUnaryCall(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const InputMessage* request, OutputMessage* result, - std::function<void(::grpc::Status)> on_completion) { + std::function<void(grpc::Status)> on_completion) { static_assert(std::is_base_of<BaseInputMessage, InputMessage>::value, "Invalid input message specification"); static_assert(std::is_base_of<BaseOutputMessage, OutputMessage>::value, @@ -64,17 +64,17 @@ void CallbackUnaryCall(::grpc::ChannelInterface* channel, template <class InputMessage, class OutputMessage> class CallbackUnaryCallImpl { public: - CallbackUnaryCallImpl(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, + CallbackUnaryCallImpl(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const InputMessage* request, OutputMessage* result, - std::function<void(::grpc::Status)> on_completion) { - ::grpc::CompletionQueue* cq = channel->CallbackCQ(); + std::function<void(grpc::Status)> on_completion) { + grpc::CompletionQueue* cq = channel->CallbackCQ(); GPR_CODEGEN_ASSERT(cq != nullptr); grpc::internal::Call call(channel->CreateCall(method, context, cq)); using FullCallOpSet = grpc::internal::CallOpSet< - ::grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpRecvInitialMetadata, grpc::internal::CallOpRecvMessage<OutputMessage>, @@ -87,14 +87,14 @@ class CallbackUnaryCallImpl { }; const size_t alloc_sz = sizeof(OpSetAndTag); auto* const alloced = static_cast<OpSetAndTag*>( - ::grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(), - alloc_sz)); + grpc::g_core_codegen_interface->grpc_call_arena_alloc(call.call(), + alloc_sz)); auto* ops = new (&alloced->opset) FullCallOpSet; auto* tag = new (&alloced->tag) grpc::internal::CallbackWithStatusTag(call.call(), on_completion, ops); // TODO(vjpai): Unify code with sync API as much as possible - ::grpc::Status s = ops->SendMessagePtr(request); + grpc::Status s = ops->SendMessagePtr(request); if (!s.ok()) { tag->force_run(s); return; @@ -123,7 +123,7 @@ class ClientReactor { /// hold). /// /// \param[in] s The status outcome of this RPC - virtual void OnDone(const ::grpc::Status& /*s*/) = 0; + virtual void OnDone(const grpc::Status& /*s*/) = 0; /// InternalScheduleOnDone is not part of the API and is not meant to be /// overridden. It is virtual to allow successful builds for certain bazel @@ -132,7 +132,7 @@ class ClientReactor { /// the virtual call is slower than a direct call, this function is /// heavyweight and the cost of the virtual call is not much in comparison. /// This function may be removed or devirtualized in the future. - virtual void InternalScheduleOnDone(::grpc::Status s); + virtual void InternalScheduleOnDone(grpc::Status s); /// InternalTrailersOnly is not part of the API and is not meant to be /// overridden. It is virtual to allow successful builds for certain bazel @@ -163,7 +163,7 @@ class ClientCallbackReaderWriter { public: virtual ~ClientCallbackReaderWriter() {} virtual void StartCall() = 0; - virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0; + virtual void Write(const Request* req, grpc::WriteOptions options) = 0; virtual void WritesDone() = 0; virtual void Read(Response* resp) = 0; virtual void AddHold(int holds) = 0; @@ -195,9 +195,9 @@ class ClientCallbackWriter { public: virtual ~ClientCallbackWriter() {} virtual void StartCall() = 0; - void Write(const Request* req) { Write(req, ::grpc::WriteOptions()); } - virtual void Write(const Request* req, ::grpc::WriteOptions options) = 0; - void WriteLast(const Request* req, ::grpc::WriteOptions options) { + void Write(const Request* req) { Write(req, grpc::WriteOptions()); } + virtual void Write(const Request* req, grpc::WriteOptions options) = 0; + void WriteLast(const Request* req, grpc::WriteOptions options) { Write(req, options.set_last_message()); } virtual void WritesDone() = 0; @@ -258,9 +258,7 @@ class ClientBidiReactor : public internal::ClientReactor { /// \param[in] req The message to be written. The library does not take /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. - void StartWrite(const Request* req) { - StartWrite(req, ::grpc::WriteOptions()); - } + void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); } /// Initiate/post a write operation with specified options. /// @@ -268,7 +266,7 @@ class ClientBidiReactor : public internal::ClientReactor { /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. /// \param[in] options The WriteOptions to use for writing this message - void StartWrite(const Request* req, ::grpc::WriteOptions options) { + void StartWrite(const Request* req, grpc::WriteOptions options) { stream_->Write(req, options); } @@ -281,7 +279,7 @@ class ClientBidiReactor : public internal::ClientReactor { /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. /// \param[in] options The WriteOptions to use for writing this message - void StartWriteLast(const Request* req, ::grpc::WriteOptions options) { + void StartWriteLast(const Request* req, grpc::WriteOptions options) { StartWrite(req, options.set_last_message()); } @@ -328,7 +326,7 @@ class ClientBidiReactor : public internal::ClientReactor { /// (like failure to remove a hold). /// /// \param[in] s The status outcome of this RPC - void OnDone(const ::grpc::Status& /*s*/) override {} + void OnDone(const grpc::Status& /*s*/) override {} /// Notifies the application that a read of initial metadata from the /// server is done. If the application chooses not to implement this method, @@ -385,7 +383,7 @@ class ClientReadReactor : public internal::ClientReactor { } void RemoveHold() { reader_->RemoveHold(); } - void OnDone(const ::grpc::Status& /*s*/) override {} + void OnDone(const grpc::Status& /*s*/) override {} virtual void OnReadInitialMetadataDone(bool /*ok*/) {} virtual void OnReadDone(bool /*ok*/) {} @@ -401,13 +399,11 @@ template <class Request> class ClientWriteReactor : public internal::ClientReactor { public: void StartCall() { writer_->StartCall(); } - void StartWrite(const Request* req) { - StartWrite(req, ::grpc::WriteOptions()); - } - void StartWrite(const Request* req, ::grpc::WriteOptions options) { + void StartWrite(const Request* req) { StartWrite(req, grpc::WriteOptions()); } + void StartWrite(const Request* req, grpc::WriteOptions options) { writer_->Write(req, options); } - void StartWriteLast(const Request* req, ::grpc::WriteOptions options) { + void StartWriteLast(const Request* req, grpc::WriteOptions options) { StartWrite(req, options.set_last_message()); } void StartWritesDone() { writer_->WritesDone(); } @@ -419,7 +415,7 @@ class ClientWriteReactor : public internal::ClientReactor { } void RemoveHold() { writer_->RemoveHold(); } - void OnDone(const ::grpc::Status& /*s*/) override {} + void OnDone(const grpc::Status& /*s*/) override {} virtual void OnReadInitialMetadataDone(bool /*ok*/) {} virtual void OnWriteDone(bool /*ok*/) {} virtual void OnWritesDoneDone(bool /*ok*/) {} @@ -445,7 +441,7 @@ class ClientWriteReactor : public internal::ClientReactor { class ClientUnaryReactor : public internal::ClientReactor { public: void StartCall() { call_->StartCall(); } - void OnDone(const ::grpc::Status& /*s*/) override {} + void OnDone(const grpc::Status& /*s*/) override {} virtual void OnReadInitialMetadataDone(bool /*ok*/) {} private: @@ -534,7 +530,7 @@ class ClientCallbackReaderWriterImpl call_.PerformOps(&read_ops_); } - void Write(const Request* msg, ::grpc::WriteOptions options) + void Write(const Request* msg, grpc::WriteOptions options) Y_ABSL_LOCKS_EXCLUDED(start_mu_) override { if (options.is_last_message()) { options.set_buffer_hint(); @@ -593,7 +589,7 @@ class ClientCallbackReaderWriterImpl friend class ClientCallbackReaderWriterFactory<Request, Response>; ClientCallbackReaderWriterImpl(grpc::internal::Call call, - ::grpc::ClientContext* context, + grpc::ClientContext* context, ClientBidiReactor<Request, Response>* reactor) : context_(context), call_(call), @@ -651,11 +647,11 @@ class ClientCallbackReaderWriterImpl void MaybeFinish(bool from_reaction) { if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub( 1, std::memory_order_acq_rel) == 1)) { - ::grpc::Status s = std::move(finish_status_); + grpc::Status s = std::move(finish_status_); auto* reactor = reactor_; auto* call = call_.call(); this->~ClientCallbackReaderWriterImpl(); - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); if (GPR_LIKELY(from_reaction)) { reactor->OnDone(s); } else { @@ -664,7 +660,7 @@ class ClientCallbackReaderWriterImpl } } - ::grpc::ClientContext* const context_; + grpc::ClientContext* const context_; grpc::internal::Call call_; ClientBidiReactor<Request, Response>* const reactor_; @@ -678,7 +674,7 @@ class ClientCallbackReaderWriterImpl grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_; grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::Status finish_status_; + grpc::Status finish_status_; grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, @@ -711,15 +707,15 @@ class ClientCallbackReaderWriterImpl template <class Request, class Response> class ClientCallbackReaderWriterFactory { public: - static void Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, + static void Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, ClientBidiReactor<Request, Response>* reactor) { grpc::internal::Call call = channel->CreateCall(method, context, channel->CallbackCQ()); - ::grpc::g_core_codegen_interface->grpc_call_ref(call.call()); - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + grpc::g_core_codegen_interface->grpc_call_ref(call.call()); + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientCallbackReaderWriterImpl<Request, Response>))) ClientCallbackReaderWriterImpl<Request, Response>(call, context, reactor); @@ -810,8 +806,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> { friend class ClientCallbackReaderFactory<Response>; template <class Request> - ClientCallbackReaderImpl(::grpc::internal::Call call, - ::grpc::ClientContext* context, Request* request, + ClientCallbackReaderImpl(grpc::internal::Call call, + grpc::ClientContext* context, Request* request, ClientReadReactor<Response>* reactor) : context_(context), call_(call), reactor_(reactor) { this->BindReactor(reactor); @@ -824,11 +820,11 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> { void MaybeFinish(bool from_reaction) { if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub( 1, std::memory_order_acq_rel) == 1)) { - ::grpc::Status s = std::move(finish_status_); + grpc::Status s = std::move(finish_status_); auto* reactor = reactor_; auto* call = call_.call(); this->~ClientCallbackReaderImpl(); - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); if (GPR_LIKELY(from_reaction)) { reactor->OnDone(s); } else { @@ -837,7 +833,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> { } } - ::grpc::ClientContext* const context_; + grpc::ClientContext* const context_; grpc::internal::Call call_; ClientReadReactor<Response>* const reactor_; @@ -850,7 +846,7 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> { grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> finish_ops_; grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::Status finish_status_; + grpc::Status finish_status_; grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<Response>> read_ops_; @@ -871,15 +867,15 @@ template <class Response> class ClientCallbackReaderFactory { public: template <class Request> - static void Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, const Request* request, + static void Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const Request* request, ClientReadReactor<Response>* reactor) { grpc::internal::Call call = channel->CreateCall(method, context, channel->CallbackCQ()); - ::grpc::g_core_codegen_interface->grpc_call_ref(call.call()); - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + grpc::g_core_codegen_interface->grpc_call_ref(call.call()); + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientCallbackReaderImpl<Response>))) ClientCallbackReaderImpl<Response>(call, context, request, reactor); } @@ -932,7 +928,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> { this->MaybeFinish(/*from_reaction=*/false); } - void Write(const Request* msg, ::grpc::WriteOptions options) + void Write(const Request* msg, grpc::WriteOptions options) Y_ABSL_LOCKS_EXCLUDED(start_mu_) override { if (GPR_UNLIKELY(options.is_last_message())) { options.set_buffer_hint(); @@ -995,8 +991,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> { friend class ClientCallbackWriterFactory<Request>; template <class Response> - ClientCallbackWriterImpl(::grpc::internal::Call call, - ::grpc::ClientContext* context, Response* response, + ClientCallbackWriterImpl(grpc::internal::Call call, + grpc::ClientContext* context, Response* response, ClientWriteReactor<Request>* reactor) : context_(context), call_(call), @@ -1042,11 +1038,11 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> { void MaybeFinish(bool from_reaction) { if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub( 1, std::memory_order_acq_rel) == 1)) { - ::grpc::Status s = std::move(finish_status_); + grpc::Status s = std::move(finish_status_); auto* reactor = reactor_; auto* call = call_.call(); this->~ClientCallbackWriterImpl(); - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); if (GPR_LIKELY(from_reaction)) { reactor->OnDone(s); } else { @@ -1055,7 +1051,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> { } } - ::grpc::ClientContext* const context_; + grpc::ClientContext* const context_; grpc::internal::Call call_; ClientWriteReactor<Request>* const reactor_; @@ -1071,7 +1067,7 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> { grpc::internal::CallOpClientRecvStatus> finish_ops_; grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::Status finish_status_; + grpc::Status finish_status_; grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, @@ -1100,15 +1096,15 @@ template <class Request> class ClientCallbackWriterFactory { public: template <class Response> - static void Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, Response* response, + static void Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, Response* response, ClientWriteReactor<Request>* reactor) { grpc::internal::Call call = channel->CreateCall(method, context, channel->CallbackCQ()); - ::grpc::g_core_codegen_interface->grpc_call_ref(call.call()); - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + grpc::g_core_codegen_interface->grpc_call_ref(call.call()); + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientCallbackWriterImpl<Request>))) ClientCallbackWriterImpl<Request>(call, context, response, reactor); } @@ -1159,8 +1155,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary { friend class ClientCallbackUnaryFactory; template <class Request, class Response> - ClientCallbackUnaryImpl(::grpc::internal::Call call, - ::grpc::ClientContext* context, Request* request, + ClientCallbackUnaryImpl(grpc::internal::Call call, + grpc::ClientContext* context, Request* request, Response* response, ClientUnaryReactor* reactor) : context_(context), call_(call), reactor_(reactor) { this->BindReactor(reactor); @@ -1177,16 +1173,16 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary { void MaybeFinish() { if (GPR_UNLIKELY(callbacks_outstanding_.fetch_sub( 1, std::memory_order_acq_rel) == 1)) { - ::grpc::Status s = std::move(finish_status_); + grpc::Status s = std::move(finish_status_); auto* reactor = reactor_; auto* call = call_.call(); this->~ClientCallbackUnaryImpl(); - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); reactor->OnDone(s); } } - ::grpc::ClientContext* const context_; + grpc::ClientContext* const context_; grpc::internal::Call call_; ClientUnaryReactor* const reactor_; @@ -1201,7 +1197,7 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary { grpc::internal::CallOpClientRecvStatus> finish_ops_; grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::Status finish_status_; + grpc::Status finish_status_; // This call will have 2 callbacks: start and finish std::atomic<intptr_t> callbacks_outstanding_{2}; @@ -1211,16 +1207,16 @@ class ClientCallbackUnaryFactory { public: template <class Request, class Response, class BaseRequest = Request, class BaseResponse = Response> - static void Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, const Request* request, + static void Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const Request* request, Response* response, ClientUnaryReactor* reactor) { grpc::internal::Call call = channel->CreateCall(method, context, channel->CallbackCQ()); - ::grpc::g_core_codegen_interface->grpc_call_ref(call.call()); + grpc::g_core_codegen_interface->grpc_call_ref(call.call()); - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call.call(), sizeof(ClientCallbackUnaryImpl))) ClientCallbackUnaryImpl(call, context, static_cast<const BaseRequest*>(request), diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h index f657e94968..fc4d09a297 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h @@ -431,38 +431,38 @@ class ClientContext { ClientContext(const ClientContext&); ClientContext& operator=(const ClientContext&); - friend class ::grpc::testing::InteropClientContextInspector; - friend class ::grpc::testing::ClientContextTestPeer; - friend class ::grpc::internal::CallOpClientRecvStatus; - friend class ::grpc::internal::CallOpRecvInitialMetadata; - friend class ::grpc::Channel; + friend class grpc::testing::InteropClientContextInspector; + friend class grpc::testing::ClientContextTestPeer; + friend class grpc::internal::CallOpClientRecvStatus; + friend class grpc::internal::CallOpRecvInitialMetadata; + friend class grpc::Channel; template <class R> - friend class ::grpc::ClientReader; + friend class grpc::ClientReader; template <class W> - friend class ::grpc::ClientWriter; + friend class grpc::ClientWriter; template <class W, class R> - friend class ::grpc::ClientReaderWriter; + friend class grpc::ClientReaderWriter; template <class R> - friend class ::grpc::ClientAsyncReader; + friend class grpc::ClientAsyncReader; template <class W> - friend class ::grpc::ClientAsyncWriter; + friend class grpc::ClientAsyncWriter; template <class W, class R> - friend class ::grpc::ClientAsyncReaderWriter; + friend class grpc::ClientAsyncReaderWriter; template <class R> - friend class ::grpc::ClientAsyncResponseReader; - friend class ::grpc::internal::ClientAsyncResponseReaderHelper; + friend class grpc::ClientAsyncResponseReader; + friend class grpc::internal::ClientAsyncResponseReaderHelper; template <class InputMessage, class OutputMessage> - friend class ::grpc::internal::BlockingUnaryCallImpl; + friend class grpc::internal::BlockingUnaryCallImpl; template <class InputMessage, class OutputMessage> - friend class ::grpc::internal::CallbackUnaryCallImpl; + friend class grpc::internal::CallbackUnaryCallImpl; template <class Request, class Response> - friend class ::grpc::internal::ClientCallbackReaderWriterImpl; + friend class grpc::internal::ClientCallbackReaderWriterImpl; template <class Response> - friend class ::grpc::internal::ClientCallbackReaderImpl; + friend class grpc::internal::ClientCallbackReaderImpl; template <class Request> - friend class ::grpc::internal::ClientCallbackWriterImpl; - friend class ::grpc::internal::ClientCallbackUnaryImpl; - friend class ::grpc::internal::ClientContextAccessor; + friend class grpc::internal::ClientCallbackWriterImpl; + friend class grpc::internal::ClientCallbackUnaryImpl; + friend class grpc::internal::ClientContextAccessor; // Used by friend class CallOpClientRecvStatus void set_debug_error_string(const TString& debug_error_string) { @@ -470,8 +470,7 @@ class ClientContext { } grpc_call* call() const { return call_; } - void set_call(grpc_call* call, - const std::shared_ptr<::grpc::Channel>& channel); + void set_call(grpc_call* call, const std::shared_ptr<grpc::Channel>& channel); grpc::experimental::ClientRpcInfo* set_client_rpc_info( const char* method, const char* suffix_for_stats, @@ -508,7 +507,7 @@ class ClientContext { bool wait_for_ready_explicitly_set_; bool idempotent_; bool cacheable_; - std::shared_ptr<::grpc::Channel> channel_; + std::shared_ptr<grpc::Channel> channel_; grpc::internal::Mutex mu_; grpc_call* call_; bool call_canceled_; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h index bad60a23bc..86adb3e33e 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h @@ -60,10 +60,10 @@ class BlockingUnaryCallImpl { BlockingUnaryCallImpl(ChannelInterface* channel, const RpcMethod& method, grpc::ClientContext* context, const InputMessage& request, OutputMessage* result) { - ::grpc::CompletionQueue cq(grpc_completion_queue_attributes{ + grpc::CompletionQueue cq(grpc_completion_queue_attributes{ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, nullptr}); // Pluckable completion queue - ::grpc::internal::Call call(channel->CreateCall(method, context, &cq)); + grpc::internal::Call call(channel->CreateCall(method, context, &cq)); CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>, CallOpClientSendClose, CallOpClientRecvStatus> diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h index ef0c7f1498..33786f6e65 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h @@ -64,8 +64,8 @@ class ServerReaderWriterBody; template <class ResponseType> void UnaryRunHandlerHelper( - const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*, - ::grpc::Status&); + const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*, + grpc::Status&); template <class ServiceType, class RequestType, class ResponseType, class BaseRequestType, class BaseResponseType> class RpcMethodHandler; @@ -75,7 +75,7 @@ template <class ServiceType, class RequestType, class ResponseType> class ServerStreamingHandler; template <class Streamer, bool WriteNeeded> class TemplatedBidiStreamingHandler; -template <::grpc::StatusCode code> +template <grpc::StatusCode code> class ErrorMethodHandler; } // namespace internal @@ -101,7 +101,7 @@ extern CoreCodegenInterface* g_core_codegen_interface; /// src/core/lib/surface/completion_queue.h). /// See \ref doc/cpp/perf_notes.md for notes on best practices for high /// performance servers. -class CompletionQueue : private ::grpc::GrpcLibraryCodegen { +class CompletionQueue : private grpc::GrpcLibraryCodegen { public: /// Default constructor. Implicitly creates a \a grpc_completion_queue /// instance. @@ -117,7 +117,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { /// Destructor. Destroys the owned wrapped completion queue / instance. ~CompletionQueue() override { - ::grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_); + grpc::g_core_codegen_interface->grpc_completion_queue_destroy(cq_); } /// Tri-state return for AsyncNext: SHUTDOWN, GOT_EVENT, TIMEOUT. @@ -183,7 +183,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { // false. // GOT_EVENT - we actually got an event, return true. return (AsyncNextInternal(tag, ok, - ::grpc::g_core_codegen_interface->gpr_inf_future( + grpc::g_core_codegen_interface->gpr_inf_future( GPR_CLOCK_REALTIME)) == GOT_EVENT); } @@ -200,7 +200,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { /// \return The type of event read. template <typename T> NextStatus AsyncNext(void** tag, bool* ok, const T& deadline) { - ::grpc::TimePoint<T> deadline_tp(deadline); + grpc::TimePoint<T> deadline_tp(deadline); return AsyncNextInternal(tag, ok, deadline_tp.raw_time()); } @@ -251,8 +251,8 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { protected: /// Private constructor of CompletionQueue only visible to friend classes explicit CompletionQueue(const grpc_completion_queue_attributes& attributes) { - cq_ = ::grpc::g_core_codegen_interface->grpc_completion_queue_create( - ::grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup( + cq_ = grpc::g_core_codegen_interface->grpc_completion_queue_create( + grpc::g_core_codegen_interface->grpc_completion_queue_factory_lookup( &attributes), &attributes, nullptr); InitialAvalanching(); // reserve this for the future shutdown @@ -261,46 +261,46 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { private: // Friends for access to server registration lists that enable checking and // logging on shutdown - friend class ::grpc::ServerBuilder; - friend class ::grpc::Server; + friend class grpc::ServerBuilder; + friend class grpc::Server; // Friend synchronous wrappers so that they can access Pluck(), which is // a semi-private API geared towards the synchronous implementation. template <class R> - friend class ::grpc::ClientReader; + friend class grpc::ClientReader; template <class W> - friend class ::grpc::ClientWriter; + friend class grpc::ClientWriter; template <class W, class R> - friend class ::grpc::ClientReaderWriter; + friend class grpc::ClientReaderWriter; template <class R> - friend class ::grpc::ServerReader; + friend class grpc::ServerReader; template <class W> - friend class ::grpc::ServerWriter; + friend class grpc::ServerWriter; template <class W, class R> - friend class ::grpc::internal::ServerReaderWriterBody; + friend class grpc::internal::ServerReaderWriterBody; template <class ResponseType> - friend void ::grpc::internal::UnaryRunHandlerHelper( - const ::grpc::internal::MethodHandler::HandlerParameter&, ResponseType*, - ::grpc::Status&); + friend void grpc::internal::UnaryRunHandlerHelper( + const grpc::internal::MethodHandler::HandlerParameter&, ResponseType*, + grpc::Status&); template <class ServiceType, class RequestType, class ResponseType> - friend class ::grpc::internal::ClientStreamingHandler; + friend class grpc::internal::ClientStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> - friend class ::grpc::internal::ServerStreamingHandler; + friend class grpc::internal::ServerStreamingHandler; template <class Streamer, bool WriteNeeded> - friend class ::grpc::internal::TemplatedBidiStreamingHandler; - template <::grpc::StatusCode code> - friend class ::grpc::internal::ErrorMethodHandler; - friend class ::grpc::ServerContextBase; - friend class ::grpc::ServerInterface; + friend class grpc::internal::TemplatedBidiStreamingHandler; + template <grpc::StatusCode code> + friend class grpc::internal::ErrorMethodHandler; + friend class grpc::ServerContextBase; + friend class grpc::ServerInterface; template <class InputMessage, class OutputMessage> - friend class ::grpc::internal::BlockingUnaryCallImpl; + friend class grpc::internal::BlockingUnaryCallImpl; // Friends that need access to constructor for callback CQ - friend class ::grpc::Channel; + friend class grpc::Channel; // For access to Register/CompleteAvalanching template <class Op1, class Op2, class Op3, class Op4, class Op5, class Op6> - friend class ::grpc::internal::CallOpSet; + friend class grpc::internal::CallOpSet; /// EXPERIMENTAL /// Creates a Thread Local cache to store the first event @@ -321,11 +321,11 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { /// Wraps \a grpc_completion_queue_pluck. /// \warning Must not be mixed with calls to \a Next. - bool Pluck(::grpc::internal::CompletionQueueTag* tag) { + bool Pluck(grpc::internal::CompletionQueueTag* tag) { auto deadline = - ::grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME); + grpc::g_core_codegen_interface->gpr_inf_future(GPR_CLOCK_REALTIME); while (true) { - auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck( + auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck( cq_, tag, deadline, nullptr); bool ok = ev.success != 0; void* ignored = tag; @@ -344,10 +344,10 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { /// implementation to simple call the other TryPluck function with a zero /// timeout. i.e: /// TryPluck(tag, gpr_time_0(GPR_CLOCK_REALTIME)) - void TryPluck(::grpc::internal::CompletionQueueTag* tag) { + void TryPluck(grpc::internal::CompletionQueueTag* tag) { auto deadline = - ::grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME); - auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck( + grpc::g_core_codegen_interface->gpr_time_0(GPR_CLOCK_REALTIME); + auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck( cq_, tag, deadline, nullptr); if (ev.type == GRPC_QUEUE_TIMEOUT) return; bool ok = ev.success != 0; @@ -361,9 +361,9 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { /// /// This exects tag->FinalizeResult (if called) to return 'false' i.e expects /// that the tag is internal not something that is returned to the user. - void TryPluck(::grpc::internal::CompletionQueueTag* tag, + void TryPluck(grpc::internal::CompletionQueueTag* tag, gpr_timespec deadline) { - auto ev = ::grpc::g_core_codegen_interface->grpc_completion_queue_pluck( + auto ev = grpc::g_core_codegen_interface->grpc_completion_queue_pluck( cq_, tag, deadline, nullptr); if (ev.type == GRPC_QUEUE_TIMEOUT || ev.type == GRPC_QUEUE_SHUTDOWN) { return; @@ -390,18 +390,18 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { void CompleteAvalanching() { if (gpr_atm_no_barrier_fetch_add(&avalanches_in_flight_, static_cast<gpr_atm>(-1)) == 1) { - ::grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_); + grpc::g_core_codegen_interface->grpc_completion_queue_shutdown(cq_); } } - void RegisterServer(const ::grpc::Server* server) { + void RegisterServer(const grpc::Server* server) { (void)server; #ifndef NDEBUG grpc::internal::MutexLock l(&server_list_mutex_); server_list_.push_back(server); #endif } - void UnregisterServer(const ::grpc::Server* server) { + void UnregisterServer(const grpc::Server* server) { (void)server; #ifndef NDEBUG grpc::internal::MutexLock l(&server_list_mutex_); @@ -427,7 +427,7 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen { // NDEBUG, instantiate it in all cases since otherwise the size will be // inconsistent. mutable grpc::internal::Mutex server_list_mutex_; - std::list<const ::grpc::Server*> + std::list<const grpc::Server*> server_list_ /* GUARDED_BY(server_list_mutex_) */; }; @@ -457,8 +457,8 @@ class ServerCompletionQueue : public CompletionQueue { polling_type_(polling_type) {} grpc_cq_polling_type polling_type_; - friend class ::grpc::ServerBuilder; - friend class ::grpc::Server; + friend class grpc::ServerBuilder; + friend class grpc::Server; }; } // namespace grpc diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h index d3df6caa04..57c97dd60f 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h @@ -48,8 +48,8 @@ class InterceptedChannel : public ChannelInterface { InterceptedChannel(ChannelInterface* channel, size_t pos) : channel_(channel), interceptor_pos_(pos) {} - Call CreateCall(const RpcMethod& method, ::grpc::ClientContext* context, - ::grpc::CompletionQueue* cq) override { + Call CreateCall(const RpcMethod& method, grpc::ClientContext* context, + grpc::CompletionQueue* cq) override { return channel_->CreateCallInternal(method, context, cq, interceptor_pos_); } @@ -61,8 +61,7 @@ class InterceptedChannel : public ChannelInterface { } void NotifyOnStateChangeImpl(grpc_connectivity_state last_observed, - gpr_timespec deadline, - ::grpc::CompletionQueue* cq, + gpr_timespec deadline, grpc::CompletionQueue* cq, void* tag) override { return channel_->NotifyOnStateChangeImpl(last_observed, deadline, cq, tag); } @@ -71,7 +70,7 @@ class InterceptedChannel : public ChannelInterface { return channel_->WaitForStateChangeImpl(last_observed, deadline); } - ::grpc::CompletionQueue* CallbackCQ() override { + grpc::CompletionQueue* CallbackCQ() override { return channel_->CallbackCQ(); } diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h index 090d672ae2..3b6afaa2c7 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h @@ -43,8 +43,8 @@ template <class Callable> try { return handler(); } catch (...) { - return ::grpc::Status(::grpc::StatusCode::UNKNOWN, - "Unexpected error in RPC handling"); + return grpc::Status(grpc::StatusCode::UNKNOWN, + "Unexpected error in RPC handling"); } #else // GRPC_ALLOW_EXCEPTIONS return handler(); @@ -57,11 +57,11 @@ template <class Callable> template <class ResponseType> void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param, - ResponseType* rsp, ::grpc::Status& status) { + ResponseType* rsp, grpc::Status& status) { GPR_CODEGEN_ASSERT(!param.server_context->sent_initial_metadata_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> ops; ops.SendInitialMetadata(¶m.server_context->initial_metadata_, param.server_context->initial_metadata_flags()); @@ -79,11 +79,11 @@ void UnaryRunHandlerHelper(const MethodHandler::HandlerParameter& param, /// A helper function with reduced templating to do deserializing. template <class RequestType> -void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status, +void* UnaryDeserializeHelper(grpc_byte_buffer* req, grpc::Status* status, RequestType* request) { - ::grpc::ByteBuffer buf; + grpc::ByteBuffer buf; buf.set_buffer(req); - *status = ::grpc::SerializationTraits<RequestType>::Deserialize( + *status = grpc::SerializationTraits<RequestType>::Deserialize( &buf, static_cast<RequestType*>(request)); buf.Release(); if (status->ok()) { @@ -97,22 +97,22 @@ void* UnaryDeserializeHelper(grpc_byte_buffer* req, ::grpc::Status* status, template <class ServiceType, class RequestType, class ResponseType, class BaseRequestType = RequestType, class BaseResponseType = ResponseType> -class RpcMethodHandler : public ::grpc::internal::MethodHandler { +class RpcMethodHandler : public grpc::internal::MethodHandler { public: RpcMethodHandler( - std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*, - const RequestType*, ResponseType*)> + std::function<grpc::Status(ServiceType*, grpc::ServerContext*, + const RequestType*, ResponseType*)> func, ServiceType* service) : func_(func), service_(service) {} void RunHandler(const HandlerParameter& param) final { ResponseType rsp; - ::grpc::Status status = param.status; + grpc::Status status = param.status; if (status.ok()) { status = CatchingFunctionHandler([this, ¶m, &rsp] { return func_(service_, - static_cast<::grpc::ServerContext*>(param.server_context), + static_cast<grpc::ServerContext*>(param.server_context), static_cast<RequestType*>(param.request), &rsp); }); static_cast<RequestType*>(param.request)->~RequestType(); @@ -121,18 +121,17 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler { } void* Deserialize(grpc_call* call, grpc_byte_buffer* req, - ::grpc::Status* status, void** /*handler_data*/) final { - auto* request = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(RequestType))) RequestType; + grpc::Status* status, void** /*handler_data*/) final { + auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(RequestType))) RequestType; return UnaryDeserializeHelper(req, status, static_cast<BaseRequestType*>(request)); } private: /// Application provided rpc handler function. - std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*, - const RequestType*, ResponseType*)> + std::function<grpc::Status(ServiceType*, grpc::ServerContext*, + const RequestType*, ResponseType*)> func_; // The class the above handler function lives in. ServiceType* service_; @@ -140,29 +139,29 @@ class RpcMethodHandler : public ::grpc::internal::MethodHandler { /// A wrapper class of an application provided client streaming handler. template <class ServiceType, class RequestType, class ResponseType> -class ClientStreamingHandler : public ::grpc::internal::MethodHandler { +class ClientStreamingHandler : public grpc::internal::MethodHandler { public: ClientStreamingHandler( - std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*, - ServerReader<RequestType>*, ResponseType*)> + std::function<grpc::Status(ServiceType*, grpc::ServerContext*, + ServerReader<RequestType>*, ResponseType*)> func, ServiceType* service) : func_(func), service_(service) {} void RunHandler(const HandlerParameter& param) final { ServerReader<RequestType> reader( - param.call, static_cast<::grpc::ServerContext*>(param.server_context)); + param.call, static_cast<grpc::ServerContext*>(param.server_context)); ResponseType rsp; - ::grpc::Status status = CatchingFunctionHandler([this, ¶m, &reader, - &rsp] { - return func_(service_, - static_cast<::grpc::ServerContext*>(param.server_context), - &reader, &rsp); - }); - - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::Status status = + CatchingFunctionHandler([this, ¶m, &reader, &rsp] { + return func_(service_, + static_cast<grpc::ServerContext*>(param.server_context), + &reader, &rsp); + }); + + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> ops; if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(¶m.server_context->initial_metadata_, @@ -180,39 +179,38 @@ class ClientStreamingHandler : public ::grpc::internal::MethodHandler { } private: - std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*, - ServerReader<RequestType>*, ResponseType*)> + std::function<grpc::Status(ServiceType*, grpc::ServerContext*, + ServerReader<RequestType>*, ResponseType*)> func_; ServiceType* service_; }; /// A wrapper class of an application provided server streaming handler. template <class ServiceType, class RequestType, class ResponseType> -class ServerStreamingHandler : public ::grpc::internal::MethodHandler { +class ServerStreamingHandler : public grpc::internal::MethodHandler { public: - ServerStreamingHandler(std::function<::grpc::Status( - ServiceType*, ::grpc::ServerContext*, + ServerStreamingHandler(std::function<grpc::Status( + ServiceType*, grpc::ServerContext*, const RequestType*, ServerWriter<ResponseType>*)> func, ServiceType* service) : func_(func), service_(service) {} void RunHandler(const HandlerParameter& param) final { - ::grpc::Status status = param.status; + grpc::Status status = param.status; if (status.ok()) { ServerWriter<ResponseType> writer( - param.call, - static_cast<::grpc::ServerContext*>(param.server_context)); + param.call, static_cast<grpc::ServerContext*>(param.server_context)); status = CatchingFunctionHandler([this, ¶m, &writer] { return func_(service_, - static_cast<::grpc::ServerContext*>(param.server_context), + static_cast<grpc::ServerContext*>(param.server_context), static_cast<RequestType*>(param.request), &writer); }); static_cast<RequestType*>(param.request)->~RequestType(); } - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpServerSendStatus> ops; if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(¶m.server_context->initial_metadata_, @@ -230,14 +228,13 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler { } void* Deserialize(grpc_call* call, grpc_byte_buffer* req, - ::grpc::Status* status, void** /*handler_data*/) final { - ::grpc::ByteBuffer buf; + grpc::Status* status, void** /*handler_data*/) final { + grpc::ByteBuffer buf; buf.set_buffer(req); - auto* request = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(RequestType))) RequestType(); + auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(RequestType))) RequestType(); *status = - ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); + grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); buf.Release(); if (status->ok()) { return request; @@ -247,8 +244,8 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler { } private: - std::function<::grpc::Status(ServiceType*, ::grpc::ServerContext*, - const RequestType*, ServerWriter<ResponseType>*)> + std::function<grpc::Status(ServiceType*, grpc::ServerContext*, + const RequestType*, ServerWriter<ResponseType>*)> func_; ServiceType* service_; }; @@ -261,22 +258,22 @@ class ServerStreamingHandler : public ::grpc::internal::MethodHandler { /// Instead, it is expected to be an implicitly-captured argument of func /// (through bind or something along those lines) template <class Streamer, bool WriteNeeded> -class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler { +class TemplatedBidiStreamingHandler : public grpc::internal::MethodHandler { public: explicit TemplatedBidiStreamingHandler( - std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func) + std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func) : func_(func), write_needed_(WriteNeeded) {} void RunHandler(const HandlerParameter& param) final { Streamer stream(param.call, - static_cast<::grpc::ServerContext*>(param.server_context)); - ::grpc::Status status = CatchingFunctionHandler([this, ¶m, &stream] { - return func_(static_cast<::grpc::ServerContext*>(param.server_context), + static_cast<grpc::ServerContext*>(param.server_context)); + grpc::Status status = CatchingFunctionHandler([this, ¶m, &stream] { + return func_(static_cast<grpc::ServerContext*>(param.server_context), &stream); }); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpServerSendStatus> ops; if (!param.server_context->sent_initial_metadata_) { ops.SendInitialMetadata(¶m.server_context->initial_metadata_, @@ -287,8 +284,8 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler { if (write_needed_ && status.ok()) { // If we needed a write but never did one, we need to mark the // status as a fail - status = ::grpc::Status(::grpc::StatusCode::INTERNAL, - "Service did not provide response message"); + status = grpc::Status(grpc::StatusCode::INTERNAL, + "Service did not provide response message"); } } ops.ServerSendStatus(¶m.server_context->trailing_metadata_, status); @@ -300,7 +297,7 @@ class TemplatedBidiStreamingHandler : public ::grpc::internal::MethodHandler { } private: - std::function<::grpc::Status(::grpc::ServerContext*, Streamer*)> func_; + std::function<grpc::Status(grpc::ServerContext*, Streamer*)> func_; const bool write_needed_; }; @@ -309,8 +306,8 @@ class BidiStreamingHandler : public TemplatedBidiStreamingHandler< ServerReaderWriter<ResponseType, RequestType>, false> { public: - BidiStreamingHandler(std::function<::grpc::Status( - ServiceType*, ::grpc::ServerContext*, + BidiStreamingHandler(std::function<grpc::Status( + ServiceType*, grpc::ServerContext*, ServerReaderWriter<ResponseType, RequestType>*)> func, ServiceType* service) @@ -318,7 +315,7 @@ class BidiStreamingHandler : TemplatedBidiStreamingHandler< ServerReaderWriter<ResponseType, RequestType>, false>( [func, service]( - ::grpc::ServerContext* ctx, + grpc::ServerContext* ctx, ServerReaderWriter<ResponseType, RequestType>* streamer) { return func(service, ctx, streamer); }) {} @@ -331,8 +328,8 @@ class StreamedUnaryHandler public: explicit StreamedUnaryHandler( std::function< - ::grpc::Status(::grpc::ServerContext*, - ServerUnaryStreamer<RequestType, ResponseType>*)> + grpc::Status(grpc::ServerContext*, + ServerUnaryStreamer<RequestType, ResponseType>*)> func) : TemplatedBidiStreamingHandler< ServerUnaryStreamer<RequestType, ResponseType>, true>( @@ -346,8 +343,8 @@ class SplitServerStreamingHandler public: explicit SplitServerStreamingHandler( std::function< - ::grpc::Status(::grpc::ServerContext*, - ServerSplitStreamer<RequestType, ResponseType>*)> + grpc::Status(grpc::ServerContext*, + ServerSplitStreamer<RequestType, ResponseType>*)> func) : TemplatedBidiStreamingHandler< ServerSplitStreamer<RequestType, ResponseType>, false>( @@ -356,15 +353,15 @@ class SplitServerStreamingHandler /// General method handler class for errors that prevent real method use /// e.g., handle unknown method by returning UNIMPLEMENTED error. -template <::grpc::StatusCode code> -class ErrorMethodHandler : public ::grpc::internal::MethodHandler { +template <grpc::StatusCode code> +class ErrorMethodHandler : public grpc::internal::MethodHandler { public: explicit ErrorMethodHandler(const TString& message) : message_(message) {} template <class T> - static void FillOps(::grpc::ServerContextBase* context, + static void FillOps(grpc::ServerContextBase* context, const TString& message, T* ops) { - ::grpc::Status status(code, message); + grpc::Status status(code, message); if (!context->sent_initial_metadata_) { ops->SendInitialMetadata(&context->initial_metadata_, context->initial_metadata_flags()); @@ -377,8 +374,8 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler { } void RunHandler(const HandlerParameter& param) final { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpServerSendStatus> ops; FillOps(param.server_context, message_, &ops); param.call->PerformOps(&ops); @@ -386,10 +383,10 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler { } void* Deserialize(grpc_call* /*call*/, grpc_byte_buffer* req, - ::grpc::Status* /*status*/, void** /*handler_data*/) final { + grpc::Status* /*status*/, void** /*handler_data*/) final { // We have to destroy any request payload if (req != nullptr) { - ::grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req); + grpc::g_core_codegen_interface->grpc_byte_buffer_destroy(req); } return nullptr; } @@ -398,9 +395,9 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler { const TString message_; }; -typedef ErrorMethodHandler<::grpc::StatusCode::UNIMPLEMENTED> +typedef ErrorMethodHandler<grpc::StatusCode::UNIMPLEMENTED> UnknownMethodHandler; -typedef ErrorMethodHandler<::grpc::StatusCode::RESOURCE_EXHAUSTED> +typedef ErrorMethodHandler<grpc::StatusCode::RESOURCE_EXHAUSTED> ResourceExhaustedHandler; } // namespace internal diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h index d3baa2cd29..ecc0e30109 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h @@ -45,7 +45,7 @@ extern CoreCodegenInterface* g_core_codegen_interface; /// /// Read more about ZeroCopyInputStream interface here: /// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyInputStream -class ProtoBufferReader : public ::grpc::protobuf::io::ZeroCopyInputStream { +class ProtoBufferReader : public grpc::protobuf::io::ZeroCopyInputStream { public: /// Constructs buffer reader from \a buffer. Will set \a status() to non ok /// if \a buffer is invalid (the internal buffer has not been initialized). diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h index 204620bb01..552c6a70fa 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h @@ -52,7 +52,7 @@ const int kProtoBufferWriterMaxBufferLength = 1024 * 1024; /// /// Read more about ZeroCopyOutputStream interface here: /// https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.zero_copy_stream#ZeroCopyOutputStream -class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream { +class ProtoBufferWriter : public grpc::protobuf::io::ZeroCopyOutputStream { public: /// Constructor for this derived class /// diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h index f34cc8b17c..6f6730a1f1 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h @@ -51,7 +51,7 @@ class MethodHandler { /// \param requester : used only by the callback API. It is a function /// called by the RPC Controller to request another RPC (and also /// to set up the state required to make that request possible) - HandlerParameter(Call* c, ::grpc::ServerContextBase* context, void* req, + HandlerParameter(Call* c, grpc::ServerContextBase* context, void* req, Status req_status, void* handler_data, std::function<void()> requester) : call(c), @@ -62,7 +62,7 @@ class MethodHandler { call_requester(std::move(requester)) {} ~HandlerParameter() {} Call* const call; - ::grpc::ServerContextBase* const server_context; + grpc::ServerContextBase* const server_context; void* const request; const Status status; void* const internal_data; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h index fb6bdbccac..962a27d4cc 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h @@ -193,7 +193,7 @@ class ServerBidiReactor; class ServerCallbackUnary : public internal::ServerCallbackCall { public: ~ServerCallbackUnary() override {} - virtual void Finish(::grpc::Status s) = 0; + virtual void Finish(grpc::Status s) = 0; virtual void SendInitialMetadata() = 0; protected: @@ -209,7 +209,7 @@ template <class Request> class ServerCallbackReader : public internal::ServerCallbackCall { public: ~ServerCallbackReader() override {} - virtual void Finish(::grpc::Status s) = 0; + virtual void Finish(grpc::Status s) = 0; virtual void SendInitialMetadata() = 0; virtual void Read(Request* msg) = 0; @@ -224,11 +224,11 @@ class ServerCallbackWriter : public internal::ServerCallbackCall { public: ~ServerCallbackWriter() override {} - virtual void Finish(::grpc::Status s) = 0; + virtual void Finish(grpc::Status s) = 0; virtual void SendInitialMetadata() = 0; - virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0; - virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options, - ::grpc::Status s) = 0; + virtual void Write(const Response* msg, grpc::WriteOptions options) = 0; + virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options, + grpc::Status s) = 0; protected: void BindReactor(ServerWriteReactor<Response>* reactor) { @@ -241,12 +241,12 @@ class ServerCallbackReaderWriter : public internal::ServerCallbackCall { public: ~ServerCallbackReaderWriter() override {} - virtual void Finish(::grpc::Status s) = 0; + virtual void Finish(grpc::Status s) = 0; virtual void SendInitialMetadata() = 0; virtual void Read(Request* msg) = 0; - virtual void Write(const Response* msg, ::grpc::WriteOptions options) = 0; - virtual void WriteAndFinish(const Response* msg, ::grpc::WriteOptions options, - ::grpc::Status s) = 0; + virtual void Write(const Response* msg, grpc::WriteOptions options) = 0; + virtual void WriteAndFinish(const Response* msg, grpc::WriteOptions options, + grpc::Status s) = 0; protected: void BindReactor(ServerBidiReactor<Request, Response>* reactor) { @@ -318,7 +318,7 @@ class ServerBidiReactor : public internal::ServerReactor { /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. void StartWrite(const Response* resp) { - StartWrite(resp, ::grpc::WriteOptions()); + StartWrite(resp, grpc::WriteOptions()); } /// Initiate a write operation with specified options. @@ -327,7 +327,7 @@ class ServerBidiReactor : public internal::ServerReactor { /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. /// \param[in] options The WriteOptions to use for writing this message - void StartWrite(const Response* resp, ::grpc::WriteOptions options) + void StartWrite(const Response* resp, grpc::WriteOptions options) Y_ABSL_LOCKS_EXCLUDED(stream_mu_) { ServerCallbackReaderWriter<Request, Response>* stream = stream_.load(std::memory_order_acquire); @@ -356,8 +356,8 @@ class ServerBidiReactor : public internal::ServerReactor { /// not deleted or modified until OnDone is called. /// \param[in] options The WriteOptions to use for writing this message /// \param[in] s The status outcome of this RPC - void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options, - ::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(stream_mu_) { + void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options, + grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(stream_mu_) { ServerCallbackReaderWriter<Request, Response>* stream = stream_.load(std::memory_order_acquire); if (stream == nullptr) { @@ -382,7 +382,7 @@ class ServerBidiReactor : public internal::ServerReactor { /// ownership but the caller must ensure that the message is /// not deleted or modified until OnWriteDone is called. /// \param[in] options The WriteOptions to use for writing this message - void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) { + void StartWriteLast(const Response* resp, grpc::WriteOptions options) { StartWrite(resp, options.set_last_message()); } @@ -392,7 +392,7 @@ class ServerBidiReactor : public internal::ServerReactor { /// cancelled. /// /// \param[in] s The status outcome of this RPC - void Finish(::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(stream_mu_) { + void Finish(grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(stream_mu_) { ServerCallbackReaderWriter<Request, Response>* stream = stream_.load(std::memory_order_acquire); if (stream == nullptr) { @@ -481,8 +481,8 @@ class ServerBidiReactor : public internal::ServerReactor { bool finish_wanted = false; Request* read_wanted = nullptr; const Response* write_wanted = nullptr; - ::grpc::WriteOptions write_options_wanted; - ::grpc::Status status_wanted; + grpc::WriteOptions write_options_wanted; + grpc::Status status_wanted; }; PreBindBacklog backlog_ Y_ABSL_GUARDED_BY(stream_mu_); }; @@ -521,7 +521,7 @@ class ServerReadReactor : public internal::ServerReactor { } reader->Read(req); } - void Finish(::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(reader_mu_) { + void Finish(grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(reader_mu_) { ServerCallbackReader<Request>* reader = reader_.load(std::memory_order_acquire); if (reader == nullptr) { @@ -570,7 +570,7 @@ class ServerReadReactor : public internal::ServerReactor { bool send_initial_metadata_wanted = false; bool finish_wanted = false; Request* read_wanted = nullptr; - ::grpc::Status status_wanted; + grpc::Status status_wanted; }; PreBindBacklog backlog_ Y_ABSL_GUARDED_BY(reader_mu_); }; @@ -597,9 +597,9 @@ class ServerWriteReactor : public internal::ServerReactor { writer->SendInitialMetadata(); } void StartWrite(const Response* resp) { - StartWrite(resp, ::grpc::WriteOptions()); + StartWrite(resp, grpc::WriteOptions()); } - void StartWrite(const Response* resp, ::grpc::WriteOptions options) + void StartWrite(const Response* resp, grpc::WriteOptions options) Y_ABSL_LOCKS_EXCLUDED(writer_mu_) { ServerCallbackWriter<Response>* writer = writer_.load(std::memory_order_acquire); @@ -614,8 +614,8 @@ class ServerWriteReactor : public internal::ServerReactor { } writer->Write(resp, options); } - void StartWriteAndFinish(const Response* resp, ::grpc::WriteOptions options, - ::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(writer_mu_) { + void StartWriteAndFinish(const Response* resp, grpc::WriteOptions options, + grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(writer_mu_) { ServerCallbackWriter<Response>* writer = writer_.load(std::memory_order_acquire); if (writer == nullptr) { @@ -631,10 +631,10 @@ class ServerWriteReactor : public internal::ServerReactor { } writer->WriteAndFinish(resp, options, std::move(s)); } - void StartWriteLast(const Response* resp, ::grpc::WriteOptions options) { + void StartWriteLast(const Response* resp, grpc::WriteOptions options) { StartWrite(resp, options.set_last_message()); } - void Finish(::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(writer_mu_) { + void Finish(grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(writer_mu_) { ServerCallbackWriter<Response>* writer = writer_.load(std::memory_order_acquire); if (writer == nullptr) { @@ -690,8 +690,8 @@ class ServerWriteReactor : public internal::ServerReactor { bool write_and_finish_wanted = false; bool finish_wanted = false; const Response* write_wanted = nullptr; - ::grpc::WriteOptions write_options_wanted; - ::grpc::Status status_wanted; + grpc::WriteOptions write_options_wanted; + grpc::Status status_wanted; }; PreBindBacklog backlog_ Y_ABSL_GUARDED_BY(writer_mu_); }; @@ -717,7 +717,7 @@ class ServerUnaryReactor : public internal::ServerReactor { /// Finish is similar to ServerBidiReactor except for one detail. /// If the status is non-OK, any message will not be sent. Instead, /// the client will only receive the status and any trailing metadata. - void Finish(::grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(call_mu_) { + void Finish(grpc::Status s) Y_ABSL_LOCKS_EXCLUDED(call_mu_) { ServerCallbackUnary* call = call_.load(std::memory_order_acquire); if (call == nullptr) { grpc::internal::MutexLock l(&call_mu_); @@ -759,7 +759,7 @@ class ServerUnaryReactor : public internal::ServerReactor { struct PreBindBacklog { bool send_initial_metadata_wanted = false; bool finish_wanted = false; - ::grpc::Status status_wanted; + grpc::Status status_wanted; }; PreBindBacklog backlog_ Y_ABSL_GUARDED_BY(call_mu_); }; @@ -769,7 +769,7 @@ namespace internal { template <class Base> class FinishOnlyReactor : public Base { public: - explicit FinishOnlyReactor(::grpc::Status s) { this->Finish(std::move(s)); } + explicit FinishOnlyReactor(grpc::Status s) { this->Finish(std::move(s)); } void OnDone() override { this->~FinishOnlyReactor(); } }; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h index 8713d3eb30..eac524f653 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h @@ -30,10 +30,10 @@ namespace grpc { namespace internal { template <class RequestType, class ResponseType> -class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { +class CallbackUnaryHandler : public grpc::internal::MethodHandler { public: explicit CallbackUnaryHandler( - std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*, + std::function<ServerUnaryReactor*(grpc::CallbackServerContext*, const RequestType*, ResponseType*)> get_reactor) : get_reactor_(std::move(get_reactor)) {} @@ -45,33 +45,33 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { void RunHandler(const HandlerParameter& param) final { // Arena allocate a controller structure (that includes request/response) - ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); + grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); auto* allocator_state = static_cast<MessageHolder<RequestType, ResponseType>*>( param.internal_data); - auto* call = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + auto* call = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(ServerCallbackUnaryImpl))) ServerCallbackUnaryImpl( - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), param.call, allocator_state, param.call_requester); param.server_context->BeginCompletionOp( param.call, [call](bool) { call->MaybeDone(); }, call); ServerUnaryReactor* reactor = nullptr; if (param.status.ok()) { - reactor = ::grpc::internal::CatchingReactorGetter<ServerUnaryReactor>( + reactor = grpc::internal::CatchingReactorGetter<ServerUnaryReactor>( get_reactor_, - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), call->request(), call->response()); } if (reactor == nullptr) { // if deserialization or reactor creator failed, we need to fail the call - reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(UnimplementedUnaryReactor))) UnimplementedUnaryReactor( - ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); + grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "")); } /// Invoke SetupReactor as the last part of the handler @@ -79,8 +79,8 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { } void* Deserialize(grpc_call* call, grpc_byte_buffer* req, - ::grpc::Status* status, void** handler_data) final { - ::grpc::ByteBuffer buf; + grpc::Status* status, void** handler_data) final { + grpc::ByteBuffer buf; buf.set_buffer(req); RequestType* request = nullptr; MessageHolder<RequestType, ResponseType>* allocator_state; @@ -88,14 +88,14 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { allocator_state = allocator_->AllocateMessages(); } else { allocator_state = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( call, sizeof(DefaultMessageHolder<RequestType, ResponseType>))) DefaultMessageHolder<RequestType, ResponseType>(); } *handler_data = allocator_state; request = allocator_state->request(); *status = - ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); + grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); buf.Release(); if (status->ok()) { return request; @@ -104,14 +104,14 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { } private: - std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*, + std::function<ServerUnaryReactor*(grpc::CallbackServerContext*, const RequestType*, ResponseType*)> get_reactor_; MessageAllocator<RequestType, ResponseType>* allocator_ = nullptr; class ServerCallbackUnaryImpl : public ServerCallbackUnary { public: - void Finish(::grpc::Status s) override { + void Finish(grpc::Status s) override { // A callback that only contains a call to MaybeDone can be run as an // inline callback regardless of whether or not OnDone is inlineable // because if the actual OnDone callback needs to be scheduled, MaybeDone @@ -177,7 +177,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { friend class CallbackUnaryHandler<RequestType, ResponseType>; ServerCallbackUnaryImpl( - ::grpc::CallbackServerContext* ctx, ::grpc::internal::Call* call, + grpc::CallbackServerContext* ctx, grpc::internal::Call* call, MessageHolder<RequestType, ResponseType>* allocator_state, std::function<void()> call_requester) : ctx_(ctx), @@ -210,7 +210,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { ctx_->context_allocator()->Release(ctx_); } this->~ServerCallbackUnaryImpl(); // explicitly call destructor - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); call_requester(); } @@ -218,17 +218,17 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { return reactor_.load(std::memory_order_relaxed); } - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallbackWithSuccessTag meta_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallbackWithSuccessTag meta_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_ops_; - ::grpc::internal::CallbackWithSuccessTag finish_tag_; + grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::CallbackServerContext* const ctx_; - ::grpc::internal::Call call_; + grpc::CallbackServerContext* const ctx_; + grpc::internal::Call call_; MessageHolder<RequestType, ResponseType>* const allocator_state_; std::function<void()> call_requester_; // reactor_ can always be loaded/stored with relaxed memory ordering because @@ -249,21 +249,21 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler { }; template <class RequestType, class ResponseType> -class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { +class CallbackClientStreamingHandler : public grpc::internal::MethodHandler { public: explicit CallbackClientStreamingHandler( std::function<ServerReadReactor<RequestType>*( - ::grpc::CallbackServerContext*, ResponseType*)> + grpc::CallbackServerContext*, ResponseType*)> get_reactor) : get_reactor_(std::move(get_reactor)) {} void RunHandler(const HandlerParameter& param) final { // Arena allocate a reader structure (that includes response) - ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); + grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); - auto* reader = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + auto* reader = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(ServerCallbackReaderImpl))) ServerCallbackReaderImpl( - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), param.call, param.call_requester); // Inlineable OnDone can be false in the CompletionOp callback because there // is no read reactor that has an inlineable OnDone; this only applies to @@ -275,32 +275,32 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { ServerReadReactor<RequestType>* reactor = nullptr; if (param.status.ok()) { - reactor = ::grpc::internal::CatchingReactorGetter< - ServerReadReactor<RequestType>>( - get_reactor_, - static_cast<::grpc::CallbackServerContext*>(param.server_context), - reader->response()); + reactor = + grpc::internal::CatchingReactorGetter<ServerReadReactor<RequestType>>( + get_reactor_, + static_cast<grpc::CallbackServerContext*>(param.server_context), + reader->response()); } if (reactor == nullptr) { // if deserialization or reactor creator failed, we need to fail the call - reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(UnimplementedReadReactor<RequestType>))) UnimplementedReadReactor<RequestType>( - ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); + grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "")); } reader->SetupReactor(reactor); } private: - std::function<ServerReadReactor<RequestType>*(::grpc::CallbackServerContext*, + std::function<ServerReadReactor<RequestType>*(grpc::CallbackServerContext*, ResponseType*)> get_reactor_; class ServerCallbackReaderImpl : public ServerCallbackReader<RequestType> { public: - void Finish(::grpc::Status s) override { + void Finish(grpc::Status s) override { // A finish tag with only MaybeDone can have its callback inlined // regardless even if OnDone is not inlineable because this callback just // checks a ref and then decides whether or not to dispatch OnDone. @@ -366,8 +366,8 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { private: friend class CallbackClientStreamingHandler<RequestType, ResponseType>; - ServerCallbackReaderImpl(::grpc::CallbackServerContext* ctx, - ::grpc::internal::Call* call, + ServerCallbackReaderImpl(grpc::CallbackServerContext* ctx, + grpc::internal::Call* call, std::function<void()> call_requester) : ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {} @@ -407,7 +407,7 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { ctx_->context_allocator()->Release(ctx_); } this->~ServerCallbackReaderImpl(); // explicitly call destructor - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); call_requester(); } @@ -415,21 +415,20 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { return reactor_.load(std::memory_order_relaxed); } - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallbackWithSuccessTag meta_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallbackWithSuccessTag meta_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_ops_; - ::grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::internal::CallOpSet< - ::grpc::internal::CallOpRecvMessage<RequestType>> + grpc::internal::CallbackWithSuccessTag finish_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>> read_ops_; - ::grpc::internal::CallbackWithSuccessTag read_tag_; + grpc::internal::CallbackWithSuccessTag read_tag_; - ::grpc::CallbackServerContext* const ctx_; - ::grpc::internal::Call call_; + grpc::CallbackServerContext* const ctx_; + grpc::internal::Call call_; ResponseType resp_; std::function<void()> call_requester_; // The memory ordering of reactor_ follows ServerCallbackUnaryImpl. @@ -441,21 +440,21 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler { }; template <class RequestType, class ResponseType> -class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { +class CallbackServerStreamingHandler : public grpc::internal::MethodHandler { public: explicit CallbackServerStreamingHandler( std::function<ServerWriteReactor<ResponseType>*( - ::grpc::CallbackServerContext*, const RequestType*)> + grpc::CallbackServerContext*, const RequestType*)> get_reactor) : get_reactor_(std::move(get_reactor)) {} void RunHandler(const HandlerParameter& param) final { // Arena allocate a writer structure - ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); + grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); - auto* writer = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + auto* writer = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(ServerCallbackWriterImpl))) ServerCallbackWriterImpl( - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), param.call, static_cast<RequestType*>(param.request), param.call_requester); // Inlineable OnDone can be false in the CompletionOp callback because there @@ -468,32 +467,31 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { ServerWriteReactor<ResponseType>* reactor = nullptr; if (param.status.ok()) { - reactor = ::grpc::internal::CatchingReactorGetter< + reactor = grpc::internal::CatchingReactorGetter< ServerWriteReactor<ResponseType>>( get_reactor_, - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), writer->request()); } if (reactor == nullptr) { // if deserialization or reactor creator failed, we need to fail the call - reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(UnimplementedWriteReactor<ResponseType>))) UnimplementedWriteReactor<ResponseType>( - ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); + grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "")); } writer->SetupReactor(reactor); } void* Deserialize(grpc_call* call, grpc_byte_buffer* req, - ::grpc::Status* status, void** /*handler_data*/) final { - ::grpc::ByteBuffer buf; + grpc::Status* status, void** /*handler_data*/) final { + grpc::ByteBuffer buf; buf.set_buffer(req); - auto* request = - new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( - call, sizeof(RequestType))) RequestType(); + auto* request = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( + call, sizeof(RequestType))) RequestType(); *status = - ::grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); + grpc::SerializationTraits<RequestType>::Deserialize(&buf, request); buf.Release(); if (status->ok()) { return request; @@ -503,13 +501,13 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { } private: - std::function<ServerWriteReactor<ResponseType>*( - ::grpc::CallbackServerContext*, const RequestType*)> + std::function<ServerWriteReactor<ResponseType>*(grpc::CallbackServerContext*, + const RequestType*)> get_reactor_; class ServerCallbackWriterImpl : public ServerCallbackWriter<ResponseType> { public: - void Finish(::grpc::Status s) override { + void Finish(grpc::Status s) override { // A finish tag with only MaybeDone can have its callback inlined // regardless even if OnDone is not inlineable because this callback just // checks a ref and then decides whether or not to dispatch OnDone. @@ -561,8 +559,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { call_.PerformOps(&meta_ops_); } - void Write(const ResponseType* resp, - ::grpc::WriteOptions options) override { + void Write(const ResponseType* resp, grpc::WriteOptions options) override { this->Ref(); if (options.is_last_message()) { options.set_buffer_hint(); @@ -580,8 +577,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { call_.PerformOps(&write_ops_); } - void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options, - ::grpc::Status s) override { + void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options, + grpc::Status s) override { // This combines the write into the finish callback // TODO(vjpai): don't assert GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok()); @@ -591,9 +588,8 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { private: friend class CallbackServerStreamingHandler<RequestType, ResponseType>; - ServerCallbackWriterImpl(::grpc::CallbackServerContext* ctx, - ::grpc::internal::Call* call, - const RequestType* req, + ServerCallbackWriterImpl(grpc::CallbackServerContext* ctx, + grpc::internal::Call* call, const RequestType* req, std::function<void()> call_requester) : ctx_(ctx), call_(*call), @@ -636,7 +632,7 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { ctx_->context_allocator()->Release(ctx_); } this->~ServerCallbackWriterImpl(); // explicitly call destructor - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); call_requester(); } @@ -644,21 +640,21 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { return reactor_.load(std::memory_order_relaxed); } - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallbackWithSuccessTag meta_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallbackWithSuccessTag meta_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_ops_; - ::grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage> + grpc::internal::CallbackWithSuccessTag finish_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage> write_ops_; - ::grpc::internal::CallbackWithSuccessTag write_tag_; + grpc::internal::CallbackWithSuccessTag write_tag_; - ::grpc::CallbackServerContext* const ctx_; - ::grpc::internal::Call call_; + grpc::CallbackServerContext* const ctx_; + grpc::internal::Call call_; const RequestType* req_; std::function<void()> call_requester_; // The memory ordering of reactor_ follows ServerCallbackUnaryImpl. @@ -670,20 +666,20 @@ class CallbackServerStreamingHandler : public ::grpc::internal::MethodHandler { }; template <class RequestType, class ResponseType> -class CallbackBidiHandler : public ::grpc::internal::MethodHandler { +class CallbackBidiHandler : public grpc::internal::MethodHandler { public: explicit CallbackBidiHandler( std::function<ServerBidiReactor<RequestType, ResponseType>*( - ::grpc::CallbackServerContext*)> + grpc::CallbackServerContext*)> get_reactor) : get_reactor_(std::move(get_reactor)) {} void RunHandler(const HandlerParameter& param) final { - ::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); + grpc::g_core_codegen_interface->grpc_call_ref(param.call->call()); - auto* stream = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + auto* stream = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(ServerCallbackReaderWriterImpl))) ServerCallbackReaderWriterImpl( - static_cast<::grpc::CallbackServerContext*>(param.server_context), + static_cast<grpc::CallbackServerContext*>(param.server_context), param.call, param.call_requester); // Inlineable OnDone can be false in the CompletionOp callback because there // is no bidi reactor that has an inlineable OnDone; this only applies to @@ -695,19 +691,19 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { ServerBidiReactor<RequestType, ResponseType>* reactor = nullptr; if (param.status.ok()) { - reactor = ::grpc::internal::CatchingReactorGetter< + reactor = grpc::internal::CatchingReactorGetter< ServerBidiReactor<RequestType, ResponseType>>( get_reactor_, - static_cast<::grpc::CallbackServerContext*>(param.server_context)); + static_cast<grpc::CallbackServerContext*>(param.server_context)); } if (reactor == nullptr) { // if deserialization or reactor creator failed, we need to fail the call - reactor = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc( + reactor = new (grpc::g_core_codegen_interface->grpc_call_arena_alloc( param.call->call(), sizeof(UnimplementedBidiReactor<RequestType, ResponseType>))) UnimplementedBidiReactor<RequestType, ResponseType>( - ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "")); + grpc::Status(grpc::StatusCode::UNIMPLEMENTED, "")); } stream->SetupReactor(reactor); @@ -715,13 +711,13 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { private: std::function<ServerBidiReactor<RequestType, ResponseType>*( - ::grpc::CallbackServerContext*)> + grpc::CallbackServerContext*)> get_reactor_; class ServerCallbackReaderWriterImpl : public ServerCallbackReaderWriter<RequestType, ResponseType> { public: - void Finish(::grpc::Status s) override { + void Finish(grpc::Status s) override { // A finish tag with only MaybeDone can have its callback inlined // regardless even if OnDone is not inlineable because this callback just // checks a ref and then decides whether or not to dispatch OnDone. @@ -773,8 +769,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { call_.PerformOps(&meta_ops_); } - void Write(const ResponseType* resp, - ::grpc::WriteOptions options) override { + void Write(const ResponseType* resp, grpc::WriteOptions options) override { this->Ref(); if (options.is_last_message()) { options.set_buffer_hint(); @@ -792,8 +787,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { call_.PerformOps(&write_ops_); } - void WriteAndFinish(const ResponseType* resp, ::grpc::WriteOptions options, - ::grpc::Status s) override { + void WriteAndFinish(const ResponseType* resp, grpc::WriteOptions options, + grpc::Status s) override { // TODO(vjpai): don't assert GPR_CODEGEN_ASSERT(finish_ops_.SendMessagePtr(resp, options).ok()); Finish(std::move(s)); @@ -808,8 +803,8 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { private: friend class CallbackBidiHandler<RequestType, ResponseType>; - ServerCallbackReaderWriterImpl(::grpc::CallbackServerContext* ctx, - ::grpc::internal::Call* call, + ServerCallbackReaderWriterImpl(grpc::CallbackServerContext* ctx, + grpc::internal::Call* call, std::function<void()> call_requester) : ctx_(ctx), call_(*call), call_requester_(std::move(call_requester)) {} @@ -853,7 +848,7 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { ctx_->context_allocator()->Release(ctx_); } this->~ServerCallbackReaderWriterImpl(); // explicitly call destructor - ::grpc::g_core_codegen_interface->grpc_call_unref(call); + grpc::g_core_codegen_interface->grpc_call_unref(call); call_requester(); } @@ -861,25 +856,24 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler { return reactor_.load(std::memory_order_relaxed); } - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> meta_ops_; - ::grpc::internal::CallbackWithSuccessTag meta_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpServerSendStatus> + grpc::internal::CallbackWithSuccessTag meta_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpServerSendStatus> finish_ops_; - ::grpc::internal::CallbackWithSuccessTag finish_tag_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage> + grpc::internal::CallbackWithSuccessTag finish_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage> write_ops_; - ::grpc::internal::CallbackWithSuccessTag write_tag_; - ::grpc::internal::CallOpSet< - ::grpc::internal::CallOpRecvMessage<RequestType>> + grpc::internal::CallbackWithSuccessTag write_tag_; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<RequestType>> read_ops_; - ::grpc::internal::CallbackWithSuccessTag read_tag_; + grpc::internal::CallbackWithSuccessTag read_tag_; - ::grpc::CallbackServerContext* const ctx_; - ::grpc::internal::Call call_; + grpc::CallbackServerContext* const ctx_; + grpc::internal::Call call_; std::function<void()> call_requester_; // The memory ordering of reactor_ follows ServerCallbackUnaryImpl. std::atomic<ServerBidiReactor<RequestType, ResponseType>*> reactor_; diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h index b92bf17864..7a67ecd052 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h @@ -95,7 +95,7 @@ class ServerStreamingHandler; class ServerReactor; template <class Streamer, bool WriteNeeded> class TemplatedBidiStreamingHandler; -template <::grpc::StatusCode code> +template <grpc::StatusCode code> class ErrorMethodHandler; } // namespace internal @@ -124,7 +124,7 @@ class ServerContextBase { /// Return the deadline for the server call. std::chrono::system_clock::time_point deadline() const { - return ::grpc::Timespec2Timepoint(deadline_); + return grpc::Timespec2Timepoint(deadline_); } /// Return a \a gpr_timespec representation of the server call's deadline. @@ -263,9 +263,9 @@ class ServerContextBase { /// Return the authentication context for this server call. /// /// \see grpc::AuthContext. - std::shared_ptr<const ::grpc::AuthContext> auth_context() const { + std::shared_ptr<const grpc::AuthContext> auth_context() const { if (auth_context_ == nullptr) { - auth_context_ = ::grpc::CreateAuthContext(call_.call); + auth_context_ = grpc::CreateAuthContext(call_.call); } return auth_context_; } @@ -313,7 +313,7 @@ class ServerContextBase { /// /// This method should not be called more than once or called after return /// from the method handler. - ::grpc::ServerUnaryReactor* DefaultReactor() { + grpc::ServerUnaryReactor* DefaultReactor() { // Short-circuit the case where a default reactor was already set up by // the TestPeer. if (test_unary_ != nullptr) { @@ -341,53 +341,53 @@ class ServerContextBase { ContextAllocator* context_allocator() const { return context_allocator_; } private: - friend class ::grpc::testing::InteropServerContextInspector; - friend class ::grpc::testing::ServerContextTestSpouse; - friend class ::grpc::testing::DefaultReactorTestPeer; - friend class ::grpc::ServerInterface; - friend class ::grpc::Server; + friend class grpc::testing::InteropServerContextInspector; + friend class grpc::testing::ServerContextTestSpouse; + friend class grpc::testing::DefaultReactorTestPeer; + friend class grpc::ServerInterface; + friend class grpc::Server; template <class W, class R> - friend class ::grpc::ServerAsyncReader; + friend class grpc::ServerAsyncReader; template <class W> - friend class ::grpc::ServerAsyncWriter; + friend class grpc::ServerAsyncWriter; template <class W> - friend class ::grpc::ServerAsyncResponseWriter; + friend class grpc::ServerAsyncResponseWriter; template <class W, class R> - friend class ::grpc::ServerAsyncReaderWriter; + friend class grpc::ServerAsyncReaderWriter; template <class R> - friend class ::grpc::ServerReader; + friend class grpc::ServerReader; template <class W> - friend class ::grpc::ServerWriter; + friend class grpc::ServerWriter; template <class W, class R> - friend class ::grpc::internal::ServerReaderWriterBody; + friend class grpc::internal::ServerReaderWriterBody; template <class ResponseType> - friend void ::grpc::internal::UnaryRunHandlerHelper( + friend void grpc::internal::UnaryRunHandlerHelper( const internal::MethodHandler::HandlerParameter& param, ResponseType* rsp, Status& status); template <class ServiceType, class RequestType, class ResponseType, class BaseRequestType, class BaseResponseType> - friend class ::grpc::internal::RpcMethodHandler; + friend class grpc::internal::RpcMethodHandler; template <class ServiceType, class RequestType, class ResponseType> - friend class ::grpc::internal::ClientStreamingHandler; + friend class grpc::internal::ClientStreamingHandler; template <class ServiceType, class RequestType, class ResponseType> - friend class ::grpc::internal::ServerStreamingHandler; + friend class grpc::internal::ServerStreamingHandler; template <class Streamer, bool WriteNeeded> - friend class ::grpc::internal::TemplatedBidiStreamingHandler; + friend class grpc::internal::TemplatedBidiStreamingHandler; template <class RequestType, class ResponseType> - friend class ::grpc::internal::CallbackUnaryHandler; + friend class grpc::internal::CallbackUnaryHandler; template <class RequestType, class ResponseType> - friend class ::grpc::internal::CallbackClientStreamingHandler; + friend class grpc::internal::CallbackClientStreamingHandler; template <class RequestType, class ResponseType> - friend class ::grpc::internal::CallbackServerStreamingHandler; + friend class grpc::internal::CallbackServerStreamingHandler; template <class RequestType, class ResponseType> - friend class ::grpc::internal::CallbackBidiHandler; - template <::grpc::StatusCode code> - friend class ::grpc::internal::ErrorMethodHandler; + friend class grpc::internal::CallbackBidiHandler; + template <grpc::StatusCode code> + friend class grpc::internal::ErrorMethodHandler; template <class Base> - friend class ::grpc::internal::FinishOnlyReactor; - friend class ::grpc::ClientContext; - friend class ::grpc::GenericServerContext; - friend class ::grpc::GenericCallbackServerContext; + friend class grpc::internal::FinishOnlyReactor; + friend class grpc::ClientContext; + friend class grpc::GenericServerContext; + friend class grpc::GenericCallbackServerContext; /// Prevent copying. ServerContextBase(const ServerContextBase&); @@ -396,10 +396,10 @@ class ServerContextBase { class CompletionOp; void BeginCompletionOp( - ::grpc::internal::Call* call, std::function<void(bool)> callback, - ::grpc::internal::ServerCallbackCall* callback_controller); + grpc::internal::Call* call, std::function<void(bool)> callback, + grpc::internal::ServerCallbackCall* callback_controller); /// Return the tag queued by BeginCompletionOp() - ::grpc::internal::CompletionQueueTag* GetCompletionOpTag(); + grpc::internal::CompletionQueueTag* GetCompletionOpTag(); void set_call(grpc_call* call) { call_.call = call; } @@ -407,12 +407,12 @@ class ServerContextBase { uint32_t initial_metadata_flags() const { return 0; } - ::grpc::experimental::ServerRpcInfo* set_server_rpc_info( - const char* method, ::grpc::internal::RpcMethod::RpcType type, + grpc::experimental::ServerRpcInfo* set_server_rpc_info( + const char* method, grpc::internal::RpcMethod::RpcType type, const std::vector<std::unique_ptr< - ::grpc::experimental::ServerInterceptorFactoryInterface>>& creators) { + grpc::experimental::ServerInterceptorFactoryInterface>>& creators) { if (!creators.empty()) { - rpc_info_ = new ::grpc::experimental::ServerRpcInfo(this, method, type); + rpc_info_ = new grpc::experimental::ServerRpcInfo(this, method, type); rpc_info_->RegisterInterceptors(creators); } return rpc_info_; @@ -444,13 +444,13 @@ class ServerContextBase { CompletionOp* completion_op_ = nullptr; bool has_notify_when_done_tag_ = false; void* async_notify_when_done_tag_ = nullptr; - ::grpc::internal::CallbackWithSuccessTag completion_tag_; + grpc::internal::CallbackWithSuccessTag completion_tag_; gpr_timespec deadline_; - ::grpc::CompletionQueue* cq_ = nullptr; + grpc::CompletionQueue* cq_ = nullptr; bool sent_initial_metadata_ = false; - mutable std::shared_ptr<const ::grpc::AuthContext> auth_context_; - mutable ::grpc::internal::MetadataMap client_metadata_; + mutable std::shared_ptr<const grpc::AuthContext> auth_context_; + mutable grpc::internal::MetadataMap client_metadata_; std::multimap<TString, TString> initial_metadata_; std::multimap<TString, TString> trailing_metadata_; @@ -458,16 +458,16 @@ class ServerContextBase { grpc_compression_level compression_level_; grpc_compression_algorithm compression_algorithm_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage> pending_ops_; bool has_pending_ops_ = false; - ::grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr; + grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr; RpcAllocatorState* message_allocator_state_ = nullptr; ContextAllocator* context_allocator_ = nullptr; - class Reactor : public ::grpc::ServerUnaryReactor { + class Reactor : public grpc::ServerUnaryReactor { public: void OnCancel() override {} void OnDone() override {} @@ -478,23 +478,23 @@ class ServerContextBase { bool InternalInlineable() override { return true; } }; - void SetupTestDefaultReactor(std::function<void(::grpc::Status)> func) { + void SetupTestDefaultReactor(std::function<void(grpc::Status)> func) { // NOLINTNEXTLINE(modernize-make-unique) test_unary_.reset(new TestServerCallbackUnary(this, std::move(func))); } bool test_status_set() const { return (test_unary_ != nullptr) && test_unary_->status_set(); } - ::grpc::Status test_status() const { return test_unary_->status(); } + grpc::Status test_status() const { return test_unary_->status(); } - class TestServerCallbackUnary : public ::grpc::ServerCallbackUnary { + class TestServerCallbackUnary : public grpc::ServerCallbackUnary { public: TestServerCallbackUnary(ServerContextBase* ctx, - std::function<void(::grpc::Status)> func) + std::function<void(grpc::Status)> func) : reactor_(ctx->DefaultReactor()), func_(std::move(func)) { this->BindReactor(reactor_); } - void Finish(::grpc::Status s) override { + void Finish(grpc::Status s) override { status_ = s; func_(std::move(s)); status_set_.store(true, std::memory_order_release); @@ -504,16 +504,16 @@ class ServerContextBase { bool status_set() const { return status_set_.load(std::memory_order_acquire); } - ::grpc::Status status() const { return status_; } + grpc::Status status() const { return status_; } private: void CallOnDone() override {} - ::grpc::internal::ServerReactor* reactor() override { return reactor_; } + grpc::internal::ServerReactor* reactor() override { return reactor_; } - ::grpc::ServerUnaryReactor* const reactor_; + grpc::ServerUnaryReactor* const reactor_; std::atomic_bool status_set_{false}; - ::grpc::Status status_; - const std::function<void(::grpc::Status s)> func_; + grpc::Status status_; + const std::function<void(grpc::Status s)> func_; }; typename std::aligned_storage<sizeof(Reactor), alignof(Reactor)>::type @@ -568,7 +568,7 @@ class ServerContext : public ServerContextBase { private: // Constructor for internal use by server only - friend class ::grpc::Server; + friend class grpc::Server; ServerContext(gpr_timespec deadline, grpc_metadata_array* arr) : ServerContextBase(deadline, arr) {} @@ -643,16 +643,15 @@ class ContextAllocator { } // namespace grpc static_assert( - std::is_base_of<::grpc::ServerContextBase, ::grpc::ServerContext>::value, + std::is_base_of<grpc::ServerContextBase, grpc::ServerContext>::value, "improper base class"); -static_assert(std::is_base_of<::grpc::ServerContextBase, - ::grpc::CallbackServerContext>::value, +static_assert(std::is_base_of<grpc::ServerContextBase, + grpc::CallbackServerContext>::value, "improper base class"); -static_assert(sizeof(::grpc::ServerContextBase) == - sizeof(::grpc::ServerContext), +static_assert(sizeof(grpc::ServerContextBase) == sizeof(grpc::ServerContext), "wrong size"); -static_assert(sizeof(::grpc::ServerContextBase) == - sizeof(::grpc::CallbackServerContext), +static_assert(sizeof(grpc::ServerContextBase) == + sizeof(grpc::CallbackServerContext), "wrong size"); #endif // GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h index 2002d78262..031b377e4b 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h @@ -116,7 +116,7 @@ class ServerInterface : public internal::CallHook { virtual void Wait() = 0; protected: - friend class ::grpc::Service; + friend class grpc::Service; /// Register a service. This call does not take ownership of the service. /// The service must exist for the lifetime of the Server instance. @@ -153,7 +153,7 @@ class ServerInterface : public internal::CallHook { /// caller is required to keep all completion queues live until the server is /// destroyed. /// \param num_cqs How many completion queues does \a cqs hold. - virtual void Start(::grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0; + virtual void Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) = 0; virtual void ShutdownInternal(gpr_timespec deadline) = 0; @@ -166,10 +166,10 @@ class ServerInterface : public internal::CallHook { class BaseAsyncRequest : public internal::CompletionQueueTag { public: - BaseAsyncRequest(ServerInterface* server, ::grpc::ServerContext* context, + BaseAsyncRequest(ServerInterface* server, grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, void* tag, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag, bool delete_on_finalize); ~BaseAsyncRequest() override; @@ -180,10 +180,10 @@ class ServerInterface : public internal::CallHook { protected: ServerInterface* const server_; - ::grpc::ServerContext* const context_; + grpc::ServerContext* const context_; internal::ServerAsyncStreamingInterface* const stream_; - ::grpc::CompletionQueue* const call_cq_; - ::grpc::ServerCompletionQueue* const notification_cq_; + grpc::CompletionQueue* const call_cq_; + grpc::ServerCompletionQueue* const notification_cq_; void* const tag_; const bool delete_on_finalize_; grpc_call* call_; @@ -196,10 +196,10 @@ class ServerInterface : public internal::CallHook { class RegisteredAsyncRequest : public BaseAsyncRequest { public: RegisteredAsyncRequest(ServerInterface* server, - ::grpc::ServerContext* context, + grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag, const char* name, internal::RpcMethod::RpcType type); @@ -208,7 +208,7 @@ class ServerInterface : public internal::CallHook { if (done_intercepting_) { return BaseAsyncRequest::FinalizeResult(tag, status); } - call_wrapper_ = ::grpc::internal::Call( + call_wrapper_ = grpc::internal::Call( call_, server_, call_cq_, server_->max_receive_message_size(), context_->set_server_rpc_info(name_, type_, *server_->interceptor_creators())); @@ -217,7 +217,7 @@ class ServerInterface : public internal::CallHook { protected: void IssueRequest(void* registered_method, grpc_byte_buffer** payload, - ::grpc::ServerCompletionQueue* notification_cq); + grpc::ServerCompletionQueue* notification_cq); const char* name_; const internal::RpcMethod::RpcType type_; }; @@ -225,11 +225,10 @@ class ServerInterface : public internal::CallHook { class NoPayloadAsyncRequest final : public RegisteredAsyncRequest { public: NoPayloadAsyncRequest(internal::RpcServiceMethod* registered_method, - ServerInterface* server, - ::grpc::ServerContext* context, + ServerInterface* server, grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) : RegisteredAsyncRequest( server, context, stream, call_cq, notification_cq, tag, @@ -244,11 +243,11 @@ class ServerInterface : public internal::CallHook { class PayloadAsyncRequest final : public RegisteredAsyncRequest { public: PayloadAsyncRequest(internal::RpcServiceMethod* registered_method, - ServerInterface* server, ::grpc::ServerContext* context, + ServerInterface* server, grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, - void* tag, Message* request) + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag, + Message* request) : RegisteredAsyncRequest( server, context, stream, call_cq, notification_cq, tag, registered_method->name(), registered_method->method_type()), @@ -302,15 +301,14 @@ class ServerInterface : public internal::CallHook { public: GenericAsyncRequest(ServerInterface* server, GenericServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, - void* tag, bool delete_on_finalize, - bool delay_start = false); + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag, + bool delete_on_finalize, bool issue_request = true); bool FinalizeResult(void** tag, bool* status) override; protected: - void Start(); + void IssueRequest(); private: grpc_call_details call_details_; @@ -318,21 +316,21 @@ class ServerInterface : public internal::CallHook { template <class Message> void RequestAsyncCall(internal::RpcServiceMethod* method, - ::grpc::ServerContext* context, + grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, - void* tag, Message* message) { + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag, + Message* message) { GPR_CODEGEN_ASSERT(method); new PayloadAsyncRequest<Message>(method, this, context, stream, call_cq, notification_cq, tag, message); } void RequestAsyncCall(internal::RpcServiceMethod* method, - ::grpc::ServerContext* context, + grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { GPR_CODEGEN_ASSERT(method); new NoPayloadAsyncRequest(method, this, context, stream, call_cq, @@ -341,8 +339,8 @@ class ServerInterface : public internal::CallHook { void RequestAsyncGenericCall(GenericServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { new GenericAsyncRequest(this, context, stream, call_cq, notification_cq, tag, true); @@ -367,7 +365,7 @@ class ServerInterface : public internal::CallHook { // Returns nullptr (rather than being pure) since this is a post-1.0 method // and adding a new pure method to an interface would be a breaking change // (even though this is private and non-API) - virtual ::grpc::CompletionQueue* CallbackCQ() { return nullptr; } + virtual grpc::CompletionQueue* CallbackCQ() { return nullptr; } }; } // namespace grpc diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h index 182570ef2f..88bcb4a9e4 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h @@ -49,7 +49,7 @@ class ServerAsyncStreamingInterface { virtual void SendInitialMetadata(void* tag) = 0; private: - friend class ::grpc::ServerInterface; + friend class grpc::ServerInterface; virtual void BindCall(Call* call) = 0; }; } // namespace internal @@ -102,11 +102,11 @@ class Service { protected: template <class Message> - void RequestAsyncUnary(int index, ::grpc::ServerContext* context, + void RequestAsyncUnary(int index, grpc::ServerContext* context, Message* request, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { // Typecast the index to size_t for indexing into a vector // while preserving the API that existed before a compiler @@ -116,29 +116,29 @@ class Service { notification_cq, tag, request); } void RequestAsyncClientStreaming( - int index, ::grpc::ServerContext* context, + int index, grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, void* tag) { + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { size_t idx = static_cast<size_t>(index); server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq, notification_cq, tag); } template <class Message> void RequestAsyncServerStreaming( - int index, ::grpc::ServerContext* context, Message* request, + int index, grpc::ServerContext* context, Message* request, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, void* tag) { + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { size_t idx = static_cast<size_t>(index); server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq, notification_cq, tag, request); } void RequestAsyncBidiStreaming( - int index, ::grpc::ServerContext* context, + int index, grpc::ServerContext* context, internal::ServerAsyncStreamingInterface* stream, - ::grpc::CompletionQueue* call_cq, - ::grpc::ServerCompletionQueue* notification_cq, void* tag) { + grpc::CompletionQueue* call_cq, + grpc::ServerCompletionQueue* notification_cq, void* tag) { size_t idx = static_cast<size_t>(index); server_->RequestAsyncCall(methods_[idx].get(), context, stream, call_cq, notification_cq, tag); diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h index 1ce3acdaf7..3ed2fddcb8 100644 --- a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h +++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h @@ -61,7 +61,7 @@ class ClientStreamingInterface { /// - \a Status contains the status code, message and details for the call /// - the \a ClientContext associated with this call is updated with /// possible trailing metadata sent from the server. - virtual ::grpc::Status Finish() = 0; + virtual grpc::Status Finish() = 0; }; /// Common interface for all synchronous server side streaming. @@ -114,7 +114,7 @@ class WriterInterface { /// \param options The WriteOptions affecting the write operation. /// /// \return \a true on success, \a false when the stream has been closed. - virtual bool Write(const W& msg, ::grpc::WriteOptions options) = 0; + virtual bool Write(const W& msg, grpc::WriteOptions options) = 0; /// Block to write \a msg to the stream with default write options. /// This is thread-safe with respect to \a ReaderInterface::Read @@ -122,7 +122,7 @@ class WriterInterface { /// \param msg The message to be written to the stream. /// /// \return \a true on success, \a false when the stream has been closed. - inline bool Write(const W& msg) { return Write(msg, ::grpc::WriteOptions()); } + inline bool Write(const W& msg) { return Write(msg, grpc::WriteOptions()); } /// Write \a msg and coalesce it with the writing of trailing metadata, using /// WriteOptions \a options. @@ -138,7 +138,7 @@ class WriterInterface { /// /// \param[in] msg The message to be written to the stream. /// \param[in] options The WriteOptions to be used to write this message. - void WriteLast(const W& msg, ::grpc::WriteOptions options) { + void WriteLast(const W& msg, grpc::WriteOptions options) { Write(msg, options.set_last_message()); } }; @@ -162,9 +162,9 @@ template <class R> class ClientReaderFactory { public: template <class W> - static ClientReader<R>* Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, + static ClientReader<R>* Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const W& request) { return new ClientReader<R>(channel, method, context, request); } @@ -187,8 +187,7 @@ class ClientReader final : public ClientReaderInterface<R> { void WaitForInitialMetadata() override { GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops; ops.RecvInitialMetadata(context_); call_.PerformOps(&ops); cq_.Pluck(&ops); /// status ignored @@ -206,8 +205,8 @@ class ClientReader final : public ClientReaderInterface<R> { /// already received (if initial metadata is received, it can be then /// accessed through the \a ClientContext associated with this call). bool Read(R* msg) override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpRecvMessage<R>> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpRecvMessage<R>> ops; if (!context_->initial_metadata_received_) { ops.RecvInitialMetadata(context_); @@ -222,9 +221,9 @@ class ClientReader final : public ClientReaderInterface<R> { /// Side effect: /// The \a ClientContext associated with this call is updated with /// possible metadata received from the server. - ::grpc::Status Finish() override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientRecvStatus> ops; - ::grpc::Status status; + grpc::Status Finish() override { + grpc::internal::CallOpSet<grpc::internal::CallOpClientRecvStatus> ops; + grpc::Status status; ops.ClientRecvStatus(context_, &status); call_.PerformOps(&ops); GPR_CODEGEN_ASSERT(cq_.Pluck(&ops)); @@ -233,25 +232,25 @@ class ClientReader final : public ClientReaderInterface<R> { private: friend class internal::ClientReaderFactory<R>; - ::grpc::ClientContext* context_; - ::grpc::CompletionQueue cq_; - ::grpc::internal::Call call_; + grpc::ClientContext* context_; + grpc::CompletionQueue cq_; + grpc::internal::Call call_; /// Block to create a stream and write the initial metadata and \a request /// out. Note that \a context will be used to fill in custom initial /// metadata used to send to the server when starting the call. template <class W> - ClientReader(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, const W& request) + ClientReader(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, const W& request) : context_(context), cq_(grpc_completion_queue_attributes{ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, nullptr}), // Pluckable cq call_(channel->CreateCall(method, context, &cq_)) { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> ops; ops.SendInitialMetadata(&context->send_initial_metadata_, context->initial_metadata_flags()); @@ -282,9 +281,9 @@ template <class W> class ClientWriterFactory { public: template <class R> - static ClientWriter<W>* Create(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, R* response) { + static ClientWriter<W>* Create(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response) { return new ClientWriter<W>(channel, method, context, response); } }; @@ -305,8 +304,7 @@ class ClientWriter : public ClientWriterInterface<W> { void WaitForInitialMetadata() { GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops; ops.RecvInitialMetadata(context_); call_.PerformOps(&ops); cq_.Pluck(&ops); // status ignored @@ -319,10 +317,10 @@ class ClientWriter : public ClientWriterInterface<W> { /// Also sends initial metadata if not already sent (using the /// \a ClientContext associated with this call). using internal::WriterInterface<W>::Write; - bool Write(const W& msg, ::grpc::WriteOptions options) override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + bool Write(const W& msg, grpc::WriteOptions options) override { + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> ops; if (options.is_last_message()) { @@ -343,7 +341,7 @@ class ClientWriter : public ClientWriterInterface<W> { } bool WritesDone() override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops; + grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops; ops.ClientSendClose(); call_.PerformOps(&ops); return cq_.Pluck(&ops); @@ -355,8 +353,8 @@ class ClientWriter : public ClientWriterInterface<W> { /// - Attempts to fill in the \a response parameter passed /// to the constructor of this instance with the response /// message from the server. - ::grpc::Status Finish() override { - ::grpc::Status status; + grpc::Status Finish() override { + grpc::Status status; if (!context_->initial_metadata_received_) { finish_ops_.RecvInitialMetadata(context_); } @@ -375,9 +373,9 @@ class ClientWriter : public ClientWriterInterface<W> { /// single expected response message from the server upon a successful /// call to the \a Finish method of this instance. template <class R> - ClientWriter(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context, R* response) + ClientWriter(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context, R* response) : context_(context), cq_(grpc_completion_queue_attributes{ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, @@ -387,8 +385,7 @@ class ClientWriter : public ClientWriterInterface<W> { finish_ops_.AllowNoMessage(); if (!context_->initial_metadata_corked_) { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops; ops.SendInitialMetadata(&context->send_initial_metadata_, context->initial_metadata_flags()); call_.PerformOps(&ops); @@ -396,13 +393,13 @@ class ClientWriter : public ClientWriterInterface<W> { } } - ::grpc::ClientContext* context_; - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpGenericRecvMessage, - ::grpc::internal::CallOpClientRecvStatus> + grpc::ClientContext* context_; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpGenericRecvMessage, + grpc::internal::CallOpClientRecvStatus> finish_ops_; - ::grpc::CompletionQueue cq_; - ::grpc::internal::Call call_; + grpc::CompletionQueue cq_; + grpc::internal::Call call_; }; /// Client-side interface for bi-directional streaming with @@ -433,9 +430,8 @@ template <class W, class R> class ClientReaderWriterFactory { public: static ClientReaderWriter<W, R>* Create( - ::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context) { + grpc::ChannelInterface* channel, const grpc::internal::RpcMethod& method, + grpc::ClientContext* context) { return new ClientReaderWriter<W, R>(channel, method, context); } }; @@ -457,8 +453,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { void WaitForInitialMetadata() override { GPR_CODEGEN_ASSERT(!context_->initial_metadata_received_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata> ops; ops.RecvInitialMetadata(context_); call_.PerformOps(&ops); cq_.Pluck(&ops); // status ignored @@ -475,8 +470,8 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { /// Also receives initial metadata if not already received (updates the \a /// ClientContext associated with this call in that case). bool Read(R* msg) override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpRecvMessage<R>> + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpRecvMessage<R>> ops; if (!context_->initial_metadata_received_) { ops.RecvInitialMetadata(context_); @@ -492,10 +487,10 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { /// Also sends initial metadata if not already sent (using the /// \a ClientContext associated with this call to fill in values). using internal::WriterInterface<W>::Write; - bool Write(const W& msg, ::grpc::WriteOptions options) override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata, - ::grpc::internal::CallOpSendMessage, - ::grpc::internal::CallOpClientSendClose> + bool Write(const W& msg, grpc::WriteOptions options) override { + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata, + grpc::internal::CallOpSendMessage, + grpc::internal::CallOpClientSendClose> ops; if (options.is_last_message()) { @@ -516,7 +511,7 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { } bool WritesDone() override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpClientSendClose> ops; + grpc::internal::CallOpSet<grpc::internal::CallOpClientSendClose> ops; ops.ClientSendClose(); call_.PerformOps(&ops); return cq_.Pluck(&ops); @@ -527,14 +522,14 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { /// Side effect: /// - the \a ClientContext associated with this call is updated with /// possible trailing metadata sent from the server. - ::grpc::Status Finish() override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvInitialMetadata, - ::grpc::internal::CallOpClientRecvStatus> + grpc::Status Finish() override { + grpc::internal::CallOpSet<grpc::internal::CallOpRecvInitialMetadata, + grpc::internal::CallOpClientRecvStatus> ops; if (!context_->initial_metadata_received_) { ops.RecvInitialMetadata(context_); } - ::grpc::Status status; + grpc::Status status; ops.ClientRecvStatus(context_, &status); call_.PerformOps(&ops); GPR_CODEGEN_ASSERT(cq_.Pluck(&ops)); @@ -544,24 +539,23 @@ class ClientReaderWriter final : public ClientReaderWriterInterface<W, R> { private: friend class internal::ClientReaderWriterFactory<W, R>; - ::grpc::ClientContext* context_; - ::grpc::CompletionQueue cq_; - ::grpc::internal::Call call_; + grpc::ClientContext* context_; + grpc::CompletionQueue cq_; + grpc::internal::Call call_; /// Block to create a stream and write the initial metadata and \a request /// out. Note that \a context will be used to fill in custom initial metadata /// used to send to the server when starting the call. - ClientReaderWriter(::grpc::ChannelInterface* channel, - const ::grpc::internal::RpcMethod& method, - ::grpc::ClientContext* context) + ClientReaderWriter(grpc::ChannelInterface* channel, + const grpc::internal::RpcMethod& method, + grpc::ClientContext* context) : context_(context), cq_(grpc_completion_queue_attributes{ GRPC_CQ_CURRENT_VERSION, GRPC_CQ_PLUCK, GRPC_CQ_DEFAULT_POLLING, nullptr}), // Pluckable cq call_(channel->CreateCall(method, context, &cq_)) { if (!context_->initial_metadata_corked_) { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops; ops.SendInitialMetadata(&context->send_initial_metadata_, context->initial_metadata_flags()); call_.PerformOps(&ops); @@ -587,8 +581,7 @@ class ServerReader final : public ServerReaderInterface<R> { void SendInitialMetadata() override { GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops; ops.SendInitialMetadata(&ctx_->initial_metadata_, ctx_->initial_metadata_flags()); if (ctx_->compression_level_set()) { @@ -606,7 +599,7 @@ class ServerReader final : public ServerReaderInterface<R> { } bool Read(R* msg) override { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops; ops.RecvMessage(msg); call_->PerformOps(&ops); bool ok = call_->cq()->Pluck(&ops) && ops.got_message; @@ -617,13 +610,13 @@ class ServerReader final : public ServerReaderInterface<R> { } private: - ::grpc::internal::Call* const call_; + grpc::internal::Call* const call_; ServerContext* const ctx_; template <class ServiceType, class RequestType, class ResponseType> friend class internal::ClientStreamingHandler; - ServerReader(::grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerReader(grpc::internal::Call* call, grpc::ServerContext* ctx) : call_(call), ctx_(ctx) {} }; @@ -645,8 +638,7 @@ class ServerWriter final : public ServerWriterInterface<W> { void SendInitialMetadata() override { GPR_CODEGEN_ASSERT(!ctx_->sent_initial_metadata_); - ::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata> - ops; + grpc::internal::CallOpSet<grpc::internal::CallOpSendInitialMetadata> ops; ops.SendInitialMetadata(&ctx_->initial_metadata_, ctx_->initial_metadata_flags()); if (ctx_->compression_level_set()) { @@ -663,7 +655,7 @@ class ServerWriter final : public ServerWriterInterface<W> { /// Also sends initial metadata if not already sent (using the /// \a ClientContext associated with this call to fill in values). using internal::WriterInterface<W>::Write; - bool Write(const W& msg, ::grpc::WriteOptions options) override { + bool Write(const W& msg, grpc::WriteOptions options) override { if (options.is_last_message()) { options.set_buffer_hint(); } @@ -692,13 +684,13 @@ class ServerWriter final : public ServerWriterInterface<W> { } private: - ::grpc::internal::Call* const call_; - ::grpc::ServerContext* const ctx_; + grpc::internal::Call* const call_; + grpc::ServerContext* const ctx_; template <class ServiceType, class RequestType, class ResponseType> friend class internal::ServerStreamingHandler; - ServerWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerWriter(grpc::internal::Call* call, grpc::ServerContext* ctx) : call_(call), ctx_(ctx) {} }; @@ -713,7 +705,7 @@ namespace internal { template <class W, class R> class ServerReaderWriterBody final { public: - ServerReaderWriterBody(grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerReaderWriterBody(grpc::internal::Call* call, grpc::ServerContext* ctx) : call_(call), ctx_(ctx) {} void SendInitialMetadata() { @@ -737,7 +729,7 @@ class ServerReaderWriterBody final { } bool Read(R* msg) { - ::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops; + grpc::internal::CallOpSet<grpc::internal::CallOpRecvMessage<R>> ops; ops.RecvMessage(msg); call_->PerformOps(&ops); bool ok = call_->cq()->Pluck(&ops) && ops.got_message; @@ -747,7 +739,7 @@ class ServerReaderWriterBody final { return ok; } - bool Write(const W& msg, ::grpc::WriteOptions options) { + bool Write(const W& msg, grpc::WriteOptions options) { if (options.is_last_message()) { options.set_buffer_hint(); } @@ -776,7 +768,7 @@ class ServerReaderWriterBody final { private: grpc::internal::Call* const call_; - ::grpc::ServerContext* const ctx_; + grpc::ServerContext* const ctx_; }; } // namespace internal @@ -805,7 +797,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> { /// Also sends initial metadata if not already sent (using the \a /// ServerContext associated with this call). using internal::WriterInterface<W>::Write; - bool Write(const W& msg, ::grpc::WriteOptions options) override { + bool Write(const W& msg, grpc::WriteOptions options) override { return body_.Write(msg, options); } @@ -814,7 +806,7 @@ class ServerReaderWriter final : public ServerReaderWriterInterface<W, R> { friend class internal::TemplatedBidiStreamingHandler<ServerReaderWriter<W, R>, false>; - ServerReaderWriter(::grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerReaderWriter(grpc::internal::Call* call, grpc::ServerContext* ctx) : body_(call, ctx) {} }; @@ -868,7 +860,7 @@ class ServerUnaryStreamer final /// \return \a true on success, \a false when the stream has been closed. using internal::WriterInterface<ResponseType>::Write; bool Write(const ResponseType& response, - ::grpc::WriteOptions options) override { + grpc::WriteOptions options) override { if (write_done_ || !read_done_) { return false; } @@ -883,7 +875,7 @@ class ServerUnaryStreamer final friend class internal::TemplatedBidiStreamingHandler< ServerUnaryStreamer<RequestType, ResponseType>, true>; - ServerUnaryStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerUnaryStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx) : body_(call, ctx), read_done_(false), write_done_(false) {} }; @@ -934,7 +926,7 @@ class ServerSplitStreamer final /// \return \a true on success, \a false when the stream has been closed. using internal::WriterInterface<ResponseType>::Write; bool Write(const ResponseType& response, - ::grpc::WriteOptions options) override { + grpc::WriteOptions options) override { return read_done_ && body_.Write(response, options); } @@ -944,7 +936,7 @@ class ServerSplitStreamer final friend class internal::TemplatedBidiStreamingHandler< ServerSplitStreamer<RequestType, ResponseType>, false>; - ServerSplitStreamer(::grpc::internal::Call* call, ::grpc::ServerContext* ctx) + ServerSplitStreamer(grpc::internal::Call* call, grpc::ServerContext* ctx) : body_(call, ctx), read_done_(false) {} }; |