From 573523f1278a8c797c10ebb2a8b571d6891a22cc Mon Sep 17 00:00:00 2001 From: Craig Tiller <craig.tiller@gmail.com> Date: Tue, 17 Feb 2015 07:38:26 -0800 Subject: [PATCH] clang-format --- include/grpc++/client_context.h | 45 ++++++++++------ include/grpc++/completion_queue.h | 31 ++++++----- include/grpc++/config.h | 2 +- include/grpc++/impl/call.h | 25 ++++----- include/grpc++/impl/client_unary_call.h | 3 +- include/grpc++/impl/rpc_service_method.h | 15 ++---- include/grpc++/server.h | 6 +-- include/grpc++/stream.h | 67 ++++++++++++------------ src/cpp/client/channel.cc | 3 +- src/cpp/client/channel.h | 3 +- src/cpp/client/client_unary_call.cc | 4 +- src/cpp/common/call.cc | 35 ++++++------- src/cpp/common/completion_queue.cc | 4 +- src/cpp/server/async_server_context.cc | 4 +- 14 files changed, 130 insertions(+), 117 deletions(-) diff --git a/include/grpc++/client_context.h b/include/grpc++/client_context.h index 3912e52ece..2813e13abe 100644 --- a/include/grpc++/client_context.h +++ b/include/grpc++/client_context.h @@ -60,12 +60,18 @@ class ChannelInterface; class CompletionQueue; class RpcMethod; class Status; -template <class R> class ClientReader; -template <class W> class ClientWriter; -template <class R, class W> class ClientReaderWriter; -template <class R> class ClientAsyncReader; -template <class W> class ClientAsyncWriter; -template <class R, class W> class ClientAsyncReaderWriter; +template <class R> +class ClientReader; +template <class W> +class ClientWriter; +template <class R, class W> +class ClientReaderWriter; +template <class R> +class ClientAsyncReader; +template <class W> +class ClientAsyncWriter; +template <class R, class W> +class ClientAsyncReaderWriter; class ClientContext { public: @@ -97,16 +103,23 @@ class ClientContext { friend class CallOpBuffer; friend class Channel; - template <class R> friend class ::grpc::ClientReader; - template <class W> friend class ::grpc::ClientWriter; - template <class R, class W> friend class ::grpc::ClientReaderWriter; - template <class R> friend class ::grpc::ClientAsyncReader; - template <class W> friend class ::grpc::ClientAsyncWriter; - template <class R, class W> friend class ::grpc::ClientAsyncReaderWriter; - friend Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const google::protobuf::Message &request, - google::protobuf::Message *result); + template <class R> + friend class ::grpc::ClientReader; + template <class W> + friend class ::grpc::ClientWriter; + template <class R, class W> + friend class ::grpc::ClientReaderWriter; + template <class R> + friend class ::grpc::ClientAsyncReader; + template <class W> + friend class ::grpc::ClientAsyncWriter; + template <class R, class W> + friend class ::grpc::ClientAsyncReaderWriter; + friend Status BlockingUnaryCall(ChannelInterface *channel, + const RpcMethod &method, + ClientContext *context, + const google::protobuf::Message &request, + google::protobuf::Message *result); friend void AsyncUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, const google::protobuf::Message &request, diff --git a/include/grpc++/completion_queue.h b/include/grpc++/completion_queue.h index 80874cd1e6..665f29318f 100644 --- a/include/grpc++/completion_queue.h +++ b/include/grpc++/completion_queue.h @@ -81,24 +81,31 @@ class CompletionQueue { // destructed when false is returned from Next(). void Shutdown(); - grpc_completion_queue* cq() { return cq_; } + grpc_completion_queue *cq() { return cq_; } private: - template <class R> friend class ::grpc::ClientReader; - template <class W> friend class ::grpc::ClientWriter; - template <class R, class W> friend class ::grpc::ClientReaderWriter; - template <class R> friend class ::grpc::ServerReader; - template <class W> friend class ::grpc::ServerWriter; - template <class R, class W> friend class ::grpc::ServerReaderWriter; + template <class R> + friend class ::grpc::ClientReader; + template <class W> + friend class ::grpc::ClientWriter; + template <class R, class W> + friend class ::grpc::ClientReaderWriter; + template <class R> + friend class ::grpc::ServerReader; + template <class W> + friend class ::grpc::ServerWriter; + template <class R, class W> + friend class ::grpc::ServerReaderWriter; friend class ::grpc::Server; - friend Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const google::protobuf::Message &request, - google::protobuf::Message *result); + friend Status BlockingUnaryCall(ChannelInterface *channel, + const RpcMethod &method, + ClientContext *context, + const google::protobuf::Message &request, + google::protobuf::Message *result); bool Pluck(CompletionQueueTag *tag); - grpc_completion_queue* cq_; // owned + grpc_completion_queue *cq_; // owned }; } // namespace grpc diff --git a/include/grpc++/config.h b/include/grpc++/config.h index 1b4b463d35..663e40247d 100644 --- a/include/grpc++/config.h +++ b/include/grpc++/config.h @@ -40,6 +40,6 @@ namespace grpc { typedef std::string string; -} // namespace grpc +} // namespace grpc #endif // __GRPCPP_CONFIG_H__ diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index af1c710098..64f0f890c5 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -73,8 +73,8 @@ class CallOpBuffer : public CompletionQueueTag { void AddClientRecvStatus(std::multimap<grpc::string, grpc::string> *metadata, Status *status); void AddServerSendStatus(std::multimap<grpc::string, grpc::string> *metadata, - const Status& status); - void AddServerRecvClose(bool* cancelled); + const Status &status); + void AddServerRecvClose(bool *cancelled); // INTERNAL API: @@ -85,32 +85,33 @@ class CallOpBuffer : public CompletionQueueTag { void FinalizeResult(void **tag, bool *status) override; bool got_message = false; + private: void *return_tag_ = nullptr; // Send initial metadata bool send_initial_metadata_ = false; size_t initial_metadata_count_ = 0; - grpc_metadata* initial_metadata_ = nullptr; + grpc_metadata *initial_metadata_ = nullptr; // Recv initial metadta - std::multimap<grpc::string, grpc::string>* recv_initial_metadata_ = nullptr; + std::multimap<grpc::string, grpc::string> *recv_initial_metadata_ = nullptr; grpc_metadata_array recv_initial_metadata_arr_ = {0, 0, nullptr}; // Send message - const google::protobuf::Message* send_message_ = nullptr; - grpc_byte_buffer* send_message_buf_ = nullptr; + const google::protobuf::Message *send_message_ = nullptr; + grpc_byte_buffer *send_message_buf_ = nullptr; // Recv message - google::protobuf::Message* recv_message_ = nullptr; - grpc_byte_buffer* recv_message_buf_ = nullptr; + google::protobuf::Message *recv_message_ = nullptr; + grpc_byte_buffer *recv_message_buf_ = nullptr; // Client send close bool client_send_close_ = false; // Client recv status - std::multimap<grpc::string, grpc::string>* recv_trailing_metadata_ = nullptr; - Status* recv_status_ = nullptr; + std::multimap<grpc::string, grpc::string> *recv_trailing_metadata_ = nullptr; + Status *recv_status_ = nullptr; grpc_metadata_array recv_trailing_metadata_arr_ = {0, 0, nullptr}; grpc_status_code status_code_ = GRPC_STATUS_OK; char *status_details_ = nullptr; size_t status_details_capacity_ = 0; // Server send status - const Status* send_status_ = nullptr; + const Status *send_status_ = nullptr; size_t trailing_metadata_count_ = 0; grpc_metadata *trailing_metadata_ = nullptr; int cancelled_buf_; @@ -138,7 +139,7 @@ class Call final { private: CallHook *call_hook_; CompletionQueue *cq_; - grpc_call* call_; + grpc_call *call_; }; } // namespace grpc diff --git a/include/grpc++/impl/client_unary_call.h b/include/grpc++/impl/client_unary_call.h index 091430b884..22a8a04c82 100644 --- a/include/grpc++/impl/client_unary_call.h +++ b/include/grpc++/impl/client_unary_call.h @@ -61,7 +61,6 @@ Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, const google::protobuf::Message &request, google::protobuf::Message *result); -} // namespace grpc +} // namespace grpc #endif - diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index c201676065..bf62871b7d 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -55,14 +55,10 @@ class MethodHandler { public: virtual ~MethodHandler() {} struct HandlerParameter { - HandlerParameter(Call *c, - ServerContext* context, + HandlerParameter(Call* c, ServerContext* context, const google::protobuf::Message* req, google::protobuf::Message* resp) - : call(c), - server_context(context), - request(req), - response(resp) {} + : call(c), server_context(context), request(req), response(resp) {} Call* call; ServerContext* server_context; const google::protobuf::Message* request; @@ -152,7 +148,8 @@ class BidiStreamingHandler : public MethodHandler { : func_(func), service_(service) {} Status RunHandler(const HandlerParameter& param) final { - ServerReaderWriter<ResponseType, RequestType> stream(param.call, param.server_context); + ServerReaderWriter<ResponseType, RequestType> stream(param.call, + param.server_context); return func_(service_, param.server_context, &stream); } @@ -195,9 +192,7 @@ class RpcServiceMethod : public RpcMethod { class RpcService { public: // Takes ownership. - void AddMethod(RpcServiceMethod* method) { - methods_.emplace_back(method); - } + void AddMethod(RpcServiceMethod* method) { methods_.emplace_back(method); } RpcServiceMethod* GetMethod(int i) { return methods_[i].get(); } int GetMethodCount() const { return methods_.size(); } diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 8050ef8c9d..410c762375 100644 --- a/include/grpc++/server.h +++ b/include/grpc++/server.h @@ -96,9 +96,9 @@ class Server final : private CallHook, // DispatchImpl void RequestAsyncCall(void* registered_method, ServerContext* context, - ::google::protobuf::Message* request, - ServerAsyncStreamingInterface* stream, - CompletionQueue* cq, void* tag); + ::google::protobuf::Message* request, + ServerAsyncStreamingInterface* stream, + CompletionQueue* cq, void* tag); // Completion queue. CompletionQueue cq_; diff --git a/include/grpc++/stream.h b/include/grpc++/stream.h index 6ee550bd64..be5b29589f 100644 --- a/include/grpc++/stream.h +++ b/include/grpc++/stream.h @@ -87,9 +87,8 @@ class ClientReader final : public ClientStreamingInterface, public ReaderInterface<R> { public: // Blocking create a stream and write the first request out. - ClientReader(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - const google::protobuf::Message &request) + ClientReader(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, const google::protobuf::Message& request) : context_(context), call_(channel->CreateCall(method, context, &cq_)) { CallOpBuffer buf; buf.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -113,7 +112,7 @@ class ClientReader final : public ClientStreamingInterface, context_->initial_metadata_received_ = true; } - virtual bool Read(R *msg) override { + virtual bool Read(R* msg) override { CallOpBuffer buf; if (!context_->initial_metadata_received_) { buf.AddRecvInitialMetadata(&context_->recv_initial_metadata_); @@ -144,10 +143,10 @@ class ClientWriter final : public ClientStreamingInterface, public WriterInterface<W> { public: // Blocking create a stream. - ClientWriter(ChannelInterface *channel, const RpcMethod &method, - ClientContext *context, - google::protobuf::Message *response) - : context_(context), response_(response), + ClientWriter(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context, google::protobuf::Message* response) + : context_(context), + response_(response), call_(channel->CreateCall(method, context, &cq_)) { CallOpBuffer buf; buf.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -182,7 +181,7 @@ class ClientWriter final : public ClientStreamingInterface, private: ClientContext* context_; - google::protobuf::Message *const response_; + google::protobuf::Message* const response_; CompletionQueue cq_; Call call_; }; @@ -194,8 +193,8 @@ class ClientReaderWriter final : public ClientStreamingInterface, public ReaderInterface<R> { public: // Blocking create a stream. - ClientReaderWriter(ChannelInterface *channel, - const RpcMethod &method, ClientContext *context) + ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, + ClientContext* context) : context_(context), call_(channel->CreateCall(method, context, &cq_)) { CallOpBuffer buf; buf.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -217,7 +216,7 @@ class ClientReaderWriter final : public ClientStreamingInterface, context_->initial_metadata_received_ = true; } - virtual bool Read(R *msg) override { + virtual bool Read(R* msg) override { CallOpBuffer buf; if (!context_->initial_metadata_received_) { buf.AddRecvInitialMetadata(&context_->recv_initial_metadata_); @@ -318,7 +317,7 @@ class ServerWriter final : public WriterInterface<W> { // Server-side interface for bi-directional streaming. template <class W, class R> class ServerReaderWriter final : public WriterInterface<W>, - public ReaderInterface<R> { + public ReaderInterface<R> { public: ServerReaderWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} @@ -386,12 +385,12 @@ class AsyncWriterInterface { template <class R> class ClientAsyncReader final : public ClientAsyncStreamingInterface, - public AsyncReaderInterface<R> { + public AsyncReaderInterface<R> { public: // Create a stream and write the first request out. - ClientAsyncReader(ChannelInterface *channel, CompletionQueue* cq, - const RpcMethod &method, ClientContext *context, - const google::protobuf::Message &request, void* tag) + ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message& request, void* tag) : context_(context), call_(channel->CreateCall(method, context, cq)) { init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -409,7 +408,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface, context_->initial_metadata_received_ = true; } - void Read(R *msg, void* tag) override { + void Read(R* msg, void* tag) override { read_buf_.Reset(tag); if (!context_->initial_metadata_received_) { read_buf_.AddRecvInitialMetadata(&context_->recv_initial_metadata_); @@ -440,12 +439,13 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface, template <class W> class ClientAsyncWriter final : public ClientAsyncStreamingInterface, - public AsyncWriterInterface<W> { + public AsyncWriterInterface<W> { public: - ClientAsyncWriter(ChannelInterface *channel, CompletionQueue* cq, - const RpcMethod &method, ClientContext *context, - google::protobuf::Message *response, void* tag) - : context_(context), response_(response), + ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + google::protobuf::Message* response, void* tag) + : context_(context), + response_(response), call_(channel->CreateCall(method, context, cq)) { init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -486,7 +486,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface, private: ClientContext* context_ = nullptr; - google::protobuf::Message *const response_; + google::protobuf::Message* const response_; Call call_; CallOpBuffer init_buf_; CallOpBuffer meta_buf_; @@ -498,11 +498,12 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface, // Client-side interface for bi-directional streaming. template <class W, class R> class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface, - public AsyncWriterInterface<W>, - public AsyncReaderInterface<R> { + public AsyncWriterInterface<W>, + public AsyncReaderInterface<R> { public: - ClientAsyncReaderWriter(ChannelInterface *channel, CompletionQueue* cq, - const RpcMethod &method, ClientContext *context, void* tag) + ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, + const RpcMethod& method, ClientContext* context, + void* tag) : context_(context), call_(channel->CreateCall(method, context, cq)) { init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); @@ -518,7 +519,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface, context_->initial_metadata_received_ = true; } - void Read(R *msg, void* tag) override { + void Read(R* msg, void* tag) override { read_buf_.Reset(tag); if (!context_->initial_metadata_received_) { read_buf_.AddRecvInitialMetadata(&context_->recv_initial_metadata_); @@ -607,7 +608,7 @@ class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface { } private: - void BindCall(Call *call) override { call_ = *call; } + void BindCall(Call* call) override { call_ = *call; } Call call_; ServerContext* ctx_; @@ -667,7 +668,7 @@ class ServerAsyncReader : public ServerAsyncStreamingInterface, } private: - void BindCall(Call *call) override { call_ = *call; } + void BindCall(Call* call) override { call_ = *call; } Call call_; ServerContext* ctx_; @@ -715,7 +716,7 @@ class ServerAsyncWriter : public ServerAsyncStreamingInterface, } private: - void BindCall(Call *call) override { call_ = *call; } + void BindCall(Call* call) override { call_ = *call; } Call call_; ServerContext* ctx_; @@ -771,7 +772,7 @@ class ServerAsyncReaderWriter : public ServerAsyncStreamingInterface, } private: - void BindCall(Call *call) override { call_ = *call; } + void BindCall(Call* call) override { call_ = *call; } Call call_; ServerContext* ctx_; diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc index da94739ea0..440423dba9 100644 --- a/src/cpp/client/channel.cc +++ b/src/cpp/client/channel.cc @@ -93,8 +93,7 @@ void Channel::PerformOpsOnCall(CallOpBuffer *buf, Call *call) { grpc_op ops[MAX_OPS]; buf->FillOps(ops, &nops); GPR_ASSERT(GRPC_CALL_OK == - grpc_call_start_batch(call->call(), ops, nops, - buf)); + grpc_call_start_batch(call->call(), ops, nops, buf)); } } // namespace grpc diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index 894f87698c..c31adab723 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -59,8 +59,7 @@ class Channel final : public ChannelInterface { virtual Call CreateCall(const RpcMethod &method, ClientContext *context, CompletionQueue *cq) override; - virtual void PerformOpsOnCall(CallOpBuffer *ops, - Call *call) override; + virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) override; private: const grpc::string target_; diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index d68d7a9242..51bcfdada6 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -63,7 +63,7 @@ Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, class ClientAsyncRequest final : public CallOpBuffer { public: - void FinalizeResult(void** tag, bool* status) override { + void FinalizeResult(void **tag, bool *status) override { CallOpBuffer::FinalizeResult(tag, status); delete this; } @@ -74,7 +74,7 @@ void AsyncUnaryCall(ChannelInterface *channel, const RpcMethod &method, const google::protobuf::Message &request, google::protobuf::Message *result, Status *status, CompletionQueue *cq, void *tag) { - ClientAsyncRequest* buf = new ClientAsyncRequest; + ClientAsyncRequest *buf = new ClientAsyncRequest; buf->Reset(tag); Call call(channel->CreateCall(method, context, cq)); buf->AddSendInitialMetadata(context); diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index fe8859de94..df800d940d 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -95,13 +95,13 @@ namespace { // mess. Make sure it does not happen. grpc_metadata* FillMetadataArray( std::multimap<grpc::string, grpc::string>* metadata) { - if (metadata->empty()) { return nullptr; } - grpc_metadata* metadata_array = (grpc_metadata*)gpr_malloc( - metadata->size()* sizeof(grpc_metadata)); + if (metadata->empty()) { + return nullptr; + } + grpc_metadata* metadata_array = + (grpc_metadata*)gpr_malloc(metadata->size() * sizeof(grpc_metadata)); size_t i = 0; - for (auto iter = metadata->cbegin(); - iter != metadata->cend(); - ++iter, ++i) { + for (auto iter = metadata->cbegin(); iter != metadata->cend(); ++iter, ++i) { metadata_array[i].key = iter->first.c_str(); metadata_array[i].value = iter->second.c_str(); metadata_array[i].value_length = iter->second.size(); @@ -114,7 +114,8 @@ void FillMetadataMap(grpc_metadata_array* arr, for (size_t i = 0; i < arr->count; i++) { // TODO(yangg) handle duplicates? metadata->insert(std::pair<grpc::string, grpc::string>( - arr->metadata[i].key, {arr->metadata[i].value, arr->metadata[i].value_length})); + arr->metadata[i].key, + {arr->metadata[i].value, arr->metadata[i].value_length})); } grpc_metadata_array_destroy(arr); grpc_metadata_array_init(arr); @@ -133,8 +134,7 @@ void CallOpBuffer::AddRecvInitialMetadata( recv_initial_metadata_ = metadata; } - -void CallOpBuffer::AddSendInitialMetadata(ClientContext *ctx) { +void CallOpBuffer::AddSendInitialMetadata(ClientContext* ctx) { AddSendInitialMetadata(&ctx->send_initial_metadata_); } @@ -142,20 +142,18 @@ void CallOpBuffer::AddSendMessage(const google::protobuf::Message& message) { send_message_ = &message; } -void CallOpBuffer::AddRecvMessage(google::protobuf::Message *message) { +void CallOpBuffer::AddRecvMessage(google::protobuf::Message* message) { recv_message_ = message; } -void CallOpBuffer::AddClientSendClose() { - client_send_close_ = true; -} +void CallOpBuffer::AddClientSendClose() { client_send_close_ = true; } void CallOpBuffer::AddServerRecvClose(bool* cancelled) { recv_closed_ = cancelled; } void CallOpBuffer::AddClientRecvStatus( - std::multimap<grpc::string, grpc::string>* metadata, Status *status) { + std::multimap<grpc::string, grpc::string>* metadata, Status* status) { recv_trailing_metadata_ = metadata; recv_status_ = status; } @@ -171,7 +169,7 @@ void CallOpBuffer::AddServerSendStatus( send_status_ = &status; } -void CallOpBuffer::FillOps(grpc_op *ops, size_t *nops) { +void CallOpBuffer::FillOps(grpc_op* ops, size_t* nops) { *nops = 0; if (send_initial_metadata_) { ops[*nops].op = GRPC_OP_SEND_INITIAL_METADATA; @@ -232,7 +230,7 @@ void CallOpBuffer::FillOps(grpc_op *ops, size_t *nops) { } } -void CallOpBuffer::FinalizeResult(void **tag, bool *status) { +void CallOpBuffer::FinalizeResult(void** tag, bool* status) { // Release send buffers. if (send_message_buf_) { grpc_byte_buffer_destroy(send_message_buf_); @@ -270,15 +268,14 @@ void CallOpBuffer::FinalizeResult(void **tag, bool *status) { FillMetadataMap(&recv_trailing_metadata_arr_, recv_trailing_metadata_); *recv_status_ = Status( static_cast<StatusCode>(status_code_), - status_details_ ? grpc::string(status_details_) - : grpc::string()); + status_details_ ? grpc::string(status_details_) : grpc::string()); } if (recv_closed_) { *recv_closed_ = cancelled_buf_ != 0; } } -Call::Call(grpc_call* call, CallHook *call_hook, CompletionQueue* cq) +Call::Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq) : call_hook_(call_hook), cq_(cq), call_(call) {} void Call::PerformOps(CallOpBuffer* buffer) { diff --git a/src/cpp/common/completion_queue.cc b/src/cpp/common/completion_queue.cc index f69ddc3b7e..4419b4b2f1 100644 --- a/src/cpp/common/completion_queue.cc +++ b/src/cpp/common/completion_queue.cc @@ -52,7 +52,9 @@ void CompletionQueue::Shutdown() { grpc_completion_queue_shutdown(cq_); } // Helper class so we can declare a unique_ptr with grpc_event class EventDeleter { public: - void operator()(grpc_event *ev) { if (ev) grpc_event_finish(ev); } + void operator()(grpc_event *ev) { + if (ev) grpc_event_finish(ev); + } }; bool CompletionQueue::Next(void **tag, bool *ok) { diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index 886e794137..096eb7aa0e 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -54,8 +54,8 @@ AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } void AsyncServerContext::Accept(grpc_completion_queue *cq) { GPR_ASSERT(grpc_call_server_accept_old(call_, cq, this) == GRPC_CALL_OK); - GPR_ASSERT(grpc_call_server_end_initial_metadata_old(call_, GRPC_WRITE_BUFFER_HINT) == - GRPC_CALL_OK); + GPR_ASSERT(grpc_call_server_end_initial_metadata_old( + call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } bool AsyncServerContext::StartRead(google::protobuf::Message *request) { -- GitLab