diff options
author | Vijay Pai <vpai@google.com> | 2015-07-31 09:09:09 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-07-31 09:09:09 -0700 |
commit | ab1dba72dc66ff63ca56286e3d154951fba6e41e (patch) | |
tree | e10a1c9c4686871ce9415ae232f437e21cdd828d /test/cpp/qps/client_async.cc | |
parent | 09d0b0cf47dd2bbddd731c37503d2e8506a50179 (diff) |
clang-format
Diffstat (limited to 'test/cpp/qps/client_async.cc')
-rw-r--r-- | test/cpp/qps/client_async.cc | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index f517f1ae23..55f07f78f3 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -316,21 +316,25 @@ class AsyncClient : public Client { } private: - class boolean { // exists only to avoid data-race on vector<bool> + class boolean { // exists only to avoid data-race on vector<bool> public: - boolean(): val_(false) {} - boolean(bool b): val_(b) {} - operator bool() const {return val_;} - boolean& operator=(bool b) {val_=b; return *this;} + boolean() : val_(false) {} + boolean(bool b) : val_(b) {} + operator bool() const { return val_; } + boolean& operator=(bool b) { + val_ = b; + return *this; + } + private: bool val_; }; std::vector<std::unique_ptr<CompletionQueue>> cli_cqs_; std::vector<deadline_list> rpc_deadlines_; // per thread deadlines - std::vector<int> next_channel_; // per thread round-robin channel ctr - std::vector<boolean> issue_allowed_; // may this thread attempt to issue - std::vector<grpc_time> next_issue_; // when should it issue? + std::vector<int> next_channel_; // per thread round-robin channel ctr + std::vector<boolean> issue_allowed_; // may this thread attempt to issue + std::vector<grpc_time> next_issue_; // when should it issue? std::vector<std::mutex> channel_lock_; std::vector<context_list> contexts_; // per-channel list of idle contexts @@ -350,17 +354,15 @@ class AsyncUnaryClient GRPC_FINAL : public AsyncClient { private: static void CheckDone(grpc::Status s, SimpleResponse* response) {} static std::unique_ptr<grpc::ClientAsyncResponseReader<SimpleResponse>> - StartReq(TestService::Stub* stub, grpc::ClientContext* ctx, - const SimpleRequest& request, CompletionQueue* cq) { + StartReq(TestService::Stub* stub, grpc::ClientContext* ctx, + const SimpleRequest& request, CompletionQueue* cq) { return stub->AsyncUnaryCall(ctx, request, cq); }; static ClientRpcContext* SetupCtx(int channel_id, TestService::Stub* stub, const SimpleRequest& req) { - return new - ClientRpcContextUnaryImpl<SimpleRequest, - SimpleResponse>(channel_id, stub, req, - AsyncUnaryClient::StartReq, - AsyncUnaryClient::CheckDone); + return new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>( + channel_id, stub, req, AsyncUnaryClient::StartReq, + AsyncUnaryClient::CheckDone); } }; @@ -447,19 +449,18 @@ class AsyncStreamingClient GRPC_FINAL : public AsyncClient { private: static void CheckDone(grpc::Status s, SimpleResponse* response) {} - static std::unique_ptr<grpc::ClientAsyncReaderWriter< - SimpleRequest,SimpleResponse>> - StartReq(TestService::Stub* stub, grpc::ClientContext* ctx, - CompletionQueue* cq, void* tag) { + static std::unique_ptr< + grpc::ClientAsyncReaderWriter<SimpleRequest, SimpleResponse>> + StartReq(TestService::Stub* stub, grpc::ClientContext* ctx, + CompletionQueue* cq, void* tag) { auto stream = stub->AsyncStreamingCall(ctx, cq, tag); return stream; }; static ClientRpcContext* SetupCtx(int channel_id, TestService::Stub* stub, const SimpleRequest& req) { return new ClientRpcContextStreamingImpl<SimpleRequest, SimpleResponse>( - channel_id, stub, req, - AsyncStreamingClient::StartReq, - AsyncStreamingClient::CheckDone); + channel_id, stub, req, AsyncStreamingClient::StartReq, + AsyncStreamingClient::CheckDone); } }; |