clang-format

pull/8365/head
Vijay Pai 8 years ago
parent 8d08b1d9ee
commit 96e03110db
  1. 3
      include/grpc++/impl/codegen/service_type.h
  2. 9
      src/compiler/cpp_generator.cc
  3. 25
      test/cpp/end2end/hybrid_end2end_test.cc

@ -147,8 +147,7 @@ class Service {
methods_[index].reset(); methods_[index].reset();
} }
void MarkMethodStreamed(int index, void MarkMethodStreamed(int index, MethodHandler* streamed_method) {
MethodHandler* streamed_method) {
GPR_CODEGEN_ASSERT(methods_[index] && methods_[index]->handler() && GPR_CODEGEN_ASSERT(methods_[index] && methods_[index]->handler() &&
"Cannot mark an async or generic method Streamed"); "Cannot mark an async or generic method Streamed");
methods_[index]->SetHandler(streamed_method); methods_[index]->SetHandler(streamed_method);

@ -605,7 +605,7 @@ void PrintHeaderServerMethodAsync(Printer *printer, const Method *method,
printer->Print(*vars, "};\n"); printer->Print(*vars, "};\n");
} }
void PrintHeaderServerMethodStreamedUnary( void PrintHeaderServerMethodStreamedUnary(
Printer *printer, const Method *method, Printer *printer, const Method *method,
std::map<grpc::string, grpc::string> *vars) { std::map<grpc::string, grpc::string> *vars) {
(*vars)["Method"] = method->name(); (*vars)["Method"] = method->name();
@ -691,7 +691,8 @@ void PrintHeaderServerMethodSplitStreaming(
"// disable regular version of this method\n" "// disable regular version of this method\n"
"::grpc::Status $Method$(" "::grpc::Status $Method$("
"::grpc::ServerContext* context, const $Request$* request, " "::grpc::ServerContext* context, const $Request$* request, "
"::grpc::ServerWriter< $Response$>* writer) GRPC_FINAL GRPC_OVERRIDE {\n" "::grpc::ServerWriter< $Response$>* writer) GRPC_FINAL GRPC_OVERRIDE "
"{\n"
" abort();\n" " abort();\n"
" return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n" " return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
"}\n"); "}\n");
@ -899,7 +900,7 @@ void PrintHeaderService(Printer *printer, const Service *service,
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
(*vars)["Idx"] = as_string(i); (*vars)["Idx"] = as_string(i);
PrintHeaderServerMethodSplitStreaming(printer, service->method(i).get(), PrintHeaderServerMethodSplitStreaming(printer, service->method(i).get(),
vars); vars);
} }
printer->Print("typedef "); printer->Print("typedef ");
@ -931,7 +932,7 @@ void PrintHeaderService(Printer *printer, const Service *service,
printer->Print("Service"); printer->Print("Service");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
if (service->method(i)->NoStreaming() || if (service->method(i)->NoStreaming() ||
service->method(i)->ServerOnlyStreaming()) { service->method(i)->ServerOnlyStreaming()) {
printer->Print(" >"); printer->Print(" >");
} }
} }

@ -523,12 +523,12 @@ TEST_F(HybridEnd2endTest,
// Add a second service with one sync split server streaming method. // Add a second service with one sync split server streaming method.
class SplitResponseStreamDupPkg class SplitResponseStreamDupPkg
: public duplicate::EchoTestService::WithSplitStreamingMethod_ResponseStream< : public duplicate::EchoTestService::
TestServiceImplDupPkg> { WithSplitStreamingMethod_ResponseStream<TestServiceImplDupPkg> {
public: public:
Status StreamedResponseStream(ServerContext* context, Status StreamedResponseStream(
ServerSplitStreamer<EchoRequest, EchoResponse>* stream) ServerContext* context,
GRPC_OVERRIDE { ServerSplitStreamer<EchoRequest, EchoResponse>* stream) GRPC_OVERRIDE {
EchoRequest req; EchoRequest req;
EchoResponse resp; EchoResponse resp;
uint32_t next_msg_sz; uint32_t next_msg_sz;
@ -566,9 +566,9 @@ TEST_F(HybridEnd2endTest,
class FullySplitStreamedDupPkg class FullySplitStreamedDupPkg
: public duplicate::EchoTestService::SplitStreamedService { : public duplicate::EchoTestService::SplitStreamedService {
public: public:
Status StreamedResponseStream(ServerContext* context, Status StreamedResponseStream(
ServerSplitStreamer<EchoRequest, EchoResponse>* stream) ServerContext* context,
GRPC_OVERRIDE { ServerSplitStreamer<EchoRequest, EchoResponse>* stream) GRPC_OVERRIDE {
EchoRequest req; EchoRequest req;
EchoResponse resp; EchoResponse resp;
uint32_t next_msg_sz; uint32_t next_msg_sz;
@ -603,8 +603,7 @@ TEST_F(HybridEnd2endTest,
} }
// Add a second service that is fully server streamed // Add a second service that is fully server streamed
class FullyStreamedDupPkg class FullyStreamedDupPkg : public duplicate::EchoTestService::StreamedService {
: public duplicate::EchoTestService::StreamedService {
public: public:
Status StreamedEcho(ServerContext* context, Status StreamedEcho(ServerContext* context,
ServerUnaryStreamer<EchoRequest, EchoResponse>* stream) ServerUnaryStreamer<EchoRequest, EchoResponse>* stream)
@ -619,9 +618,9 @@ class FullyStreamedDupPkg
GPR_ASSERT(stream->Write(resp)); GPR_ASSERT(stream->Write(resp));
return Status::OK; return Status::OK;
} }
Status StreamedResponseStream(ServerContext* context, Status StreamedResponseStream(
ServerSplitStreamer<EchoRequest, EchoResponse>* stream) ServerContext* context,
GRPC_OVERRIDE { ServerSplitStreamer<EchoRequest, EchoResponse>* stream) GRPC_OVERRIDE {
EchoRequest req; EchoRequest req;
EchoResponse resp; EchoResponse resp;
uint32_t next_msg_sz; uint32_t next_msg_sz;

Loading…
Cancel
Save