Change cpp and go codegen to use new method properties instead of method options

Change on 2014/12/11 by rocking <rocking@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81906922
pull/1/merge
rocking 10 years ago committed by Jan Tattermusch
parent 57c6f0cade
commit 718c3f7587
  1. 16
      src/compiler/cpp_generator.cc

@ -43,23 +43,23 @@ namespace grpc_cpp_generator {
namespace { namespace {
bool NoStreaming(const google::protobuf::MethodDescriptor* method) { bool NoStreaming(const google::protobuf::MethodDescriptor* method) {
return !method->options().has_client_streaming() && return !method->client_streaming() &&
!method->options().has_server_streaming(); !method->server_streaming();
} }
bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) { bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
return method->options().has_client_streaming() && return method->client_streaming() &&
!method->options().has_server_streaming(); !method->server_streaming();
} }
bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) { bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
return !method->options().has_client_streaming() && return !method->client_streaming() &&
method->options().has_server_streaming(); method->server_streaming();
} }
bool BidiStreaming(const google::protobuf::MethodDescriptor* method) { bool BidiStreaming(const google::protobuf::MethodDescriptor* method) {
return method->options().has_client_streaming() && return method->client_streaming() &&
method->options().has_server_streaming(); method->server_streaming();
} }
bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) { bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) {

Loading…
Cancel
Save