diff options
Diffstat (limited to 'include/grpc++/impl/codegen/method_handler_impl.h')
-rw-r--r-- | include/grpc++/impl/codegen/method_handler_impl.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h index ad65ce9484..1bf9bf0549 100644 --- a/include/grpc++/impl/codegen/method_handler_impl.h +++ b/include/grpc++/impl/codegen/method_handler_impl.h @@ -43,10 +43,10 @@ namespace grpc { template <class ServiceType, class RequestType, class ResponseType> class RpcMethodHandler : public MethodHandler { public: - RpcMethodHandler(std::function<Status(ServiceType*, ServerContext*, - const RequestType*, ResponseType*)> - func, - ServiceType* service) + RpcMethodHandler( + std::function<Status(ServiceType*, ServerContext*, const RequestType*, + ResponseType*)> func, + ServiceType* service) : func_(func), service_(service) {} void RunHandler(const HandlerParameter& param) GRPC_FINAL { @@ -60,8 +60,7 @@ class RpcMethodHandler : public MethodHandler { GPR_ASSERT(!param.server_context->sent_initial_metadata_); CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, - CallOpServerSendStatus> - ops; + CallOpServerSendStatus> ops; ops.SendInitialMetadata(param.server_context->initial_metadata_); if (status.ok()) { status = ops.SendMessage(rsp); @@ -74,8 +73,7 @@ class RpcMethodHandler : public MethodHandler { private: // Application provided rpc handler function. std::function<Status(ServiceType*, ServerContext*, const RequestType*, - ResponseType*)> - func_; + ResponseType*)> func_; // The class the above handler function lives in. ServiceType* service_; }; @@ -86,8 +84,7 @@ class ClientStreamingHandler : public MethodHandler { public: ClientStreamingHandler( std::function<Status(ServiceType*, ServerContext*, - ServerReader<RequestType>*, ResponseType*)> - func, + ServerReader<RequestType>*, ResponseType*)> func, ServiceType* service) : func_(func), service_(service) {} @@ -98,8 +95,7 @@ class ClientStreamingHandler : public MethodHandler { GPR_ASSERT(!param.server_context->sent_initial_metadata_); CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage, - CallOpServerSendStatus> - ops; + CallOpServerSendStatus> ops; ops.SendInitialMetadata(param.server_context->initial_metadata_); if (status.ok()) { status = ops.SendMessage(rsp); @@ -111,8 +107,7 @@ class ClientStreamingHandler : public MethodHandler { private: std::function<Status(ServiceType*, ServerContext*, ServerReader<RequestType>*, - ResponseType*)> - func_; + ResponseType*)> func_; ServiceType* service_; }; @@ -122,8 +117,7 @@ class ServerStreamingHandler : public MethodHandler { public: ServerStreamingHandler( std::function<Status(ServiceType*, ServerContext*, const RequestType*, - ServerWriter<ResponseType>*)> - func, + ServerWriter<ResponseType>*)> func, ServiceType* service) : func_(func), service_(service) {} @@ -148,8 +142,7 @@ class ServerStreamingHandler : public MethodHandler { private: std::function<Status(ServiceType*, ServerContext*, const RequestType*, - ServerWriter<ResponseType>*)> - func_; + ServerWriter<ResponseType>*)> func_; ServiceType* service_; }; @@ -180,8 +173,7 @@ class BidiStreamingHandler : public MethodHandler { private: std::function<Status(ServiceType*, ServerContext*, - ServerReaderWriter<ResponseType, RequestType>*)> - func_; + ServerReaderWriter<ResponseType, RequestType>*)> func_; ServiceType* service_; }; |