diff options
| author | heretic <[email protected]> | 2022-02-10 16:45:43 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:43 +0300 |
| commit | 397cbe258b9e064f49c4ca575279f02f39fef76e (patch) | |
| tree | a0b0eb3cca6a14e4e8ea715393637672fa651284 /contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h | |
| parent | 43f5a35593ebc9f6bcea619bb170394ea7ae468e (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h')
| -rw-r--r-- | contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h | 138 |
1 files changed, 69 insertions, 69 deletions
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 379333164a6..f47b69c61b3 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 @@ -33,8 +33,8 @@ #include <grpcpp/impl/codegen/call.h> #include <grpcpp/impl/codegen/call_hook.h> #include <grpcpp/impl/codegen/call_op_set_interface.h> -#include <grpcpp/impl/codegen/client_context.h> -#include <grpcpp/impl/codegen/completion_queue.h> +#include <grpcpp/impl/codegen/client_context.h> +#include <grpcpp/impl/codegen/completion_queue.h> #include <grpcpp/impl/codegen/completion_queue_tag.h> #include <grpcpp/impl/codegen/config.h> #include <grpcpp/impl/codegen/core_codegen_interface.h> @@ -55,8 +55,8 @@ class CallHook; // TODO(yangg) if the map is changed before we send, the pointers will be a // mess. Make sure it does not happen. inline grpc_metadata* FillMetadataArray( - const std::multimap<TString, TString>& metadata, - size_t* metadata_count, const TString& optional_error_details) { + const std::multimap<TString, TString>& metadata, + size_t* metadata_count, const TString& optional_error_details) { *metadata_count = metadata.size() + (optional_error_details.empty() ? 0 : 1); if (*metadata_count == 0) { return nullptr; @@ -202,10 +202,10 @@ class WriteOptions { namespace internal { -/// Default argument for CallOpSet. The Unused parameter is unused by -/// the class, but can be used for generating multiple names for the -/// same thing. -template <int Unused> +/// Default argument for CallOpSet. The Unused parameter is unused by +/// the class, but can be used for generating multiple names for the +/// same thing. +template <int Unused> class CallNoOp { protected: void AddOp(grpc_op* /*ops*/, size_t* /*nops*/) {} @@ -224,7 +224,7 @@ class CallOpSendInitialMetadata { maybe_compression_level_.is_set = false; } - void SendInitialMetadata(std::multimap<TString, TString>* metadata, + void SendInitialMetadata(std::multimap<TString, TString>* metadata, uint32_t flags) { maybe_compression_level_.is_set = false; send_ = true; @@ -280,7 +280,7 @@ class CallOpSendInitialMetadata { bool send_; uint32_t flags_; size_t initial_metadata_count_; - std::multimap<TString, TString>* metadata_map_; + std::multimap<TString, TString>* metadata_map_; grpc_metadata* initial_metadata_; struct { bool is_set; @@ -431,7 +431,7 @@ class CallOpRecvMessage { // Do not change status if no message is received. void AllowNoMessage() { allow_not_getting_message_ = true; } - bool got_message = false; + bool got_message = false; protected: void AddOp(grpc_op* ops, size_t* nops) { @@ -444,7 +444,7 @@ class CallOpRecvMessage { } void FinishOp(bool* status) { - if (message_ == nullptr) return; + if (message_ == nullptr) return; if (recv_buf_.Valid()) { if (*status) { got_message = *status = @@ -455,24 +455,24 @@ class CallOpRecvMessage { got_message = false; recv_buf_.Clear(); } - } else if (hijacked_) { - if (hijacked_recv_message_failed_) { - FinishOpRecvMessageFailureHandler(status); - } else { - // The op was hijacked and it was successful. There is no further action - // to be performed since the message is already in its non-serialized - // form. - } + } else if (hijacked_) { + if (hijacked_recv_message_failed_) { + FinishOpRecvMessageFailureHandler(status); + } else { + // The op was hijacked and it was successful. There is no further action + // to be performed since the message is already in its non-serialized + // form. + } } else { - FinishOpRecvMessageFailureHandler(status); + FinishOpRecvMessageFailureHandler(status); } } void SetInterceptionHookPoint( InterceptorBatchMethodsImpl* interceptor_methods) { if (message_ == nullptr) return; - interceptor_methods->SetRecvMessage(message_, - &hijacked_recv_message_failed_); + interceptor_methods->SetRecvMessage(message_, + &hijacked_recv_message_failed_); } void SetFinishInterceptionHookPoint( @@ -491,19 +491,19 @@ class CallOpRecvMessage { } private: - // Sets got_message and \a status for a failed recv message op - void FinishOpRecvMessageFailureHandler(bool* status) { - got_message = false; - if (!allow_not_getting_message_) { - *status = false; - } - } - - R* message_ = nullptr; + // Sets got_message and \a status for a failed recv message op + void FinishOpRecvMessageFailureHandler(bool* status) { + got_message = false; + if (!allow_not_getting_message_) { + *status = false; + } + } + + R* message_ = nullptr; ByteBuffer recv_buf_; - bool allow_not_getting_message_ = false; + bool allow_not_getting_message_ = false; bool hijacked_ = false; - bool hijacked_recv_message_failed_ = false; + bool hijacked_recv_message_failed_ = false; }; class DeserializeFunc { @@ -540,7 +540,7 @@ class CallOpGenericRecvMessage { // Do not change status if no message is received. void AllowNoMessage() { allow_not_getting_message_ = true; } - bool got_message = false; + bool got_message = false; protected: void AddOp(grpc_op* ops, size_t* nops) { @@ -553,7 +553,7 @@ class CallOpGenericRecvMessage { } void FinishOp(bool* status) { - if (!deserialize_) return; + if (!deserialize_) return; if (recv_buf_.Valid()) { if (*status) { got_message = true; @@ -563,14 +563,14 @@ class CallOpGenericRecvMessage { got_message = false; recv_buf_.Clear(); } - } else if (hijacked_) { - if (hijacked_recv_message_failed_) { - FinishOpRecvMessageFailureHandler(status); - } else { - // The op was hijacked and it was successful. There is no further action - // to be performed since the message is already in its non-serialized - // form. - } + } else if (hijacked_) { + if (hijacked_recv_message_failed_) { + FinishOpRecvMessageFailureHandler(status); + } else { + // The op was hijacked and it was successful. There is no further action + // to be performed since the message is already in its non-serialized + // form. + } } else { got_message = false; if (!allow_not_getting_message_) { @@ -582,8 +582,8 @@ class CallOpGenericRecvMessage { void SetInterceptionHookPoint( InterceptorBatchMethodsImpl* interceptor_methods) { if (!deserialize_) return; - interceptor_methods->SetRecvMessage(message_, - &hijacked_recv_message_failed_); + interceptor_methods->SetRecvMessage(message_, + &hijacked_recv_message_failed_); } void SetFinishInterceptionHookPoint( @@ -603,20 +603,20 @@ class CallOpGenericRecvMessage { } private: - // Sets got_message and \a status for a failed recv message op - void FinishOpRecvMessageFailureHandler(bool* status) { - got_message = false; - if (!allow_not_getting_message_) { - *status = false; - } - } - - void* message_ = nullptr; + // Sets got_message and \a status for a failed recv message op + void FinishOpRecvMessageFailureHandler(bool* status) { + got_message = false; + if (!allow_not_getting_message_) { + *status = false; + } + } + + void* message_ = nullptr; std::unique_ptr<DeserializeFunc> deserialize_; ByteBuffer recv_buf_; - bool allow_not_getting_message_ = false; - bool hijacked_ = false; - bool hijacked_recv_message_failed_ = false; + bool allow_not_getting_message_ = false; + bool hijacked_ = false; + bool hijacked_recv_message_failed_ = false; }; class CallOpClientSendClose { @@ -659,7 +659,7 @@ class CallOpServerSendStatus { CallOpServerSendStatus() : send_status_available_(false) {} void ServerSendStatus( - std::multimap<TString, TString>* trailing_metadata, + std::multimap<TString, TString>* trailing_metadata, const Status& status) { send_error_details_ = status.error_details(); metadata_map_ = trailing_metadata; @@ -713,10 +713,10 @@ class CallOpServerSendStatus { bool hijacked_ = false; bool send_status_available_; grpc_status_code send_status_code_; - TString send_error_details_; - TString send_error_message_; + TString send_error_details_; + TString send_error_message_; size_t trailing_metadata_count_; - std::multimap<TString, TString>* metadata_map_; + std::multimap<TString, TString>* metadata_map_; grpc_metadata* trailing_metadata_; grpc_slice error_message_slice_; }; @@ -725,7 +725,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_; } @@ -774,7 +774,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; @@ -803,9 +803,9 @@ class CallOpClientRecvStatus { *recv_status_ = Status(static_cast<StatusCode>(status_code_), GRPC_SLICE_IS_EMPTY(error_message_) - ? TString() - : TString(reinterpret_cast<const char*>GRPC_SLICE_START_PTR(error_message_), - reinterpret_cast<const char*>GRPC_SLICE_END_PTR(error_message_)), + ? TString() + : TString(reinterpret_cast<const char*>GRPC_SLICE_START_PTR(error_message_), + reinterpret_cast<const char*>GRPC_SLICE_END_PTR(error_message_)), metadata_map_->GetBinaryErrorDetails()); if (debug_error_string_ != nullptr) { client_context_->set_debug_error_string(debug_error_string_); @@ -840,7 +840,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_; @@ -858,7 +858,7 @@ class CallOpSet; /// the maximum count of ops we'll need in a set. We leverage the /// empty base class optimization to slim this class (especially /// when there are many unused slots used). To avoid duplicate base classes, -/// the template parameter for CallNoOp is varied by argument position. +/// the template parameter for CallNoOp is varied by argument position. template <class Op1, class Op2, class Op3, class Op4, class Op5, class Op6> class CallOpSet : public CallOpSetInterface, public Op1, |
