diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 0bd0f176a86..9ea9cfe8b9b 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -105,24 +105,17 @@ class ClientRpcContext { } virtual void report_stats(gpr_histogram *hist) = 0; }; - -template -using StartMethod = std::function< - std::unique_ptr>(TestService::Stub *, grpc::ClientContext *, - const RequestType &, void *)> ; - -template using DoneMethod = - std::function; - template class ClientRpcContextUnaryImpl : public ClientRpcContext { public: ClientRpcContextUnaryImpl( TestService::Stub *stub, const RequestType &req, - StartMethod start_req, - DoneMethod on_done) + std::function< + std::unique_ptr>( + TestService::Stub *, grpc::ClientContext *, const RequestType &, + void *)> start_req, + std::function on_done) : context_(), stub_(stub), req_(req), @@ -157,7 +150,7 @@ class ClientRpcContextUnaryImpl : public ClientRpcContext { RequestType req_; ResponseType response_; bool (ClientRpcContextUnaryImpl::*next_state_)(); - DoneMethod callback_; + std::function callback_; grpc::Status status_; double start_; std::unique_ptr> diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc index 3d6379b73f5..c797d8af963 100644 --- a/test/cpp/qps/server_async.cc +++ b/test/cpp/qps/server_async.cc @@ -183,19 +183,15 @@ class AsyncQpsServerTest { return reinterpret_cast(tag); } - template - using RequestMethod = std::function *, - void *)>; - template using InvokeMethod = - std::function; - template class ServerRpcContextUnaryImpl : public ServerRpcContext { public: ServerRpcContextUnaryImpl( - RequestMethod request_method, - InvokeMethod invoke_method) + std::function *, + void *)> request_method, + std::function + invoke_method) : next_state_(&ServerRpcContextUnaryImpl::invoker), request_method_(request_method), invoke_method_(invoke_method), @@ -233,8 +229,11 @@ class AsyncQpsServerTest { ServerContext srv_ctx_; RequestType req_; bool (ServerRpcContextUnaryImpl::*next_state_)(); - RequestMethod request_method_; - InvokeMethod invoke_method_; + std::function *, void *)> + request_method_; + std::function + invoke_method_; grpc::ServerAsyncResponseWriter response_writer_; }; @@ -262,8 +261,12 @@ class AsyncQpsServerTest { CompletionQueue srv_cq_; TestService::AsyncService async_service_; std::unique_ptr server_; - RequestMethod request_unary_; - RequestMethod request_stats_; + std::function *, void *)> + request_unary_; + std::function *, void *)> + request_stats_; std::forward_list contexts_; };