diff options
author | vjpai <vpai@google.com> | 2015-07-31 08:39:54 -0700 |
---|---|---|
committer | vjpai <vpai@google.com> | 2015-07-31 08:39:54 -0700 |
commit | 09d0b0cf47dd2bbddd731c37503d2e8506a50179 (patch) | |
tree | 3149e8da1e194d7bb40ba8d0b0a586313e83b123 /test/cpp/qps | |
parent | e88bb0789594e8bdcebbde73eff40a661bf5ad96 (diff) |
Remove lambdas from state machine functions
Diffstat (limited to 'test/cpp/qps')
-rw-r--r-- | test/cpp/qps/client_async.cc | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index e1e44f9ac0..f517f1ae23 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -348,15 +348,19 @@ class AsyncUnaryClient GRPC_FINAL : public AsyncClient { ~AsyncUnaryClient() GRPC_OVERRIDE { EndThreads(); } 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) { + return stub->AsyncUnaryCall(ctx, request, cq); + }; static ClientRpcContext* SetupCtx(int channel_id, TestService::Stub* stub, const SimpleRequest& req) { - auto check_done = [](grpc::Status s, SimpleResponse* response) {}; - auto start_req = [](TestService::Stub* stub, grpc::ClientContext* ctx, - const SimpleRequest& request, CompletionQueue* cq) { - return stub->AsyncUnaryCall(ctx, request, cq); - }; - return new ClientRpcContextUnaryImpl<SimpleRequest, SimpleResponse>( - channel_id, stub, req, start_req, check_done); + return new + ClientRpcContextUnaryImpl<SimpleRequest, + SimpleResponse>(channel_id, stub, req, + AsyncUnaryClient::StartReq, + AsyncUnaryClient::CheckDone); } }; @@ -442,16 +446,20 @@ class AsyncStreamingClient GRPC_FINAL : public AsyncClient { ~AsyncStreamingClient() GRPC_OVERRIDE { EndThreads(); } 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) { + auto stream = stub->AsyncStreamingCall(ctx, cq, tag); + return stream; + }; static ClientRpcContext* SetupCtx(int channel_id, TestService::Stub* stub, const SimpleRequest& req) { - auto check_done = [](grpc::Status s, SimpleResponse* response) {}; - auto start_req = [](TestService::Stub* stub, grpc::ClientContext* ctx, - CompletionQueue* cq, void* tag) { - auto stream = stub->AsyncStreamingCall(ctx, cq, tag); - return stream; - }; return new ClientRpcContextStreamingImpl<SimpleRequest, SimpleResponse>( - channel_id, stub, req, start_req, check_done); + channel_id, stub, req, + AsyncStreamingClient::StartReq, + AsyncStreamingClient::CheckDone); } }; |