Merge pull request #860 from nicolasnoble/travis-c++

Travis c++
pull/863/head
Craig Tiller 10 years ago
commit 47d03aae63
  1. 8
      .travis.yml
  2. 201
      Makefile
  3. 18
      examples/pubsub/publisher_test.cc
  4. 21
      examples/pubsub/subscriber_test.cc
  5. 9
      include/grpc++/async_unary_call.h
  6. 2
      include/grpc++/client_context.h
  7. 8
      include/grpc++/config.h
  8. 2
      include/grpc++/credentials.h
  9. 51
      include/grpc++/impl/call.h
  10. 8
      include/grpc++/impl/rpc_service_method.h
  11. 10
      include/grpc++/impl/service_type.h
  12. 6
      include/grpc++/server.h
  13. 2
      include/grpc++/server_builder.h
  14. 10
      include/grpc++/server_context.h
  15. 2
      include/grpc++/server_credentials.h
  16. 118
      include/grpc++/stream.h
  17. 8
      src/compiler/cpp_generator.cc
  18. 3
      src/compiler/python_generator.cc
  19. 8
      src/compiler/python_plugin.cc
  20. 4
      src/compiler/ruby_plugin.cc
  21. 8
      src/cpp/client/channel.h
  22. 5
      src/cpp/client/client_context.cc
  23. 24
      src/cpp/common/call.cc
  24. 21
      src/cpp/server/server.cc
  25. 2
      src/cpp/server/server_builder.cc
  26. 29
      src/cpp/server/server_context.cc
  27. 2
      src/cpp/server/thread_pool.cc
  28. 7
      src/cpp/server/thread_pool.h
  29. 2
      src/node/binding.gyp
  30. 19
      templates/Makefile.template
  31. 52
      test/build/c++11.cc
  32. 15
      test/core/util/port_posix.c
  33. 4
      test/cpp/end2end/async_end2end_test.cc
  34. 18
      test/cpp/end2end/end2end_test.cc
  35. 5
      test/cpp/interop/client.cc
  36. 3
      test/cpp/interop/server.cc
  37. 6
      test/cpp/qps/server.cc
  38. 1
      tools/run_tests/build_python.sh

@ -1,6 +1,14 @@
language: cpp language: cpp
before_install:
- sudo add-apt-repository ppa:yjwong/gflags -y
- sudo apt-get update -qq
- sudo apt-get install -qq libgtest-dev libgflags-dev python-virtualenv
script: script:
- ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg - ./tools/run_tests/run_tests.py -l c -t -j 16 -c dbg
- ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c dbg
- make clean
- ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt - ./tools/run_tests/run_tests.py -l c -t -j 16 -c opt
- ./tools/run_tests/run_tests.py -l c++ -t -j 16 -c opt
- ./tools/run_tests/run_tests.py -l node -t -j 16 -c opt
notifications: notifications:
email: false email: false

@ -152,6 +152,10 @@ $(error Invalid CONFIG value '$(CONFIG)')
endif endif
# Detect if we can use C++11
CXX11_CHECK_CMD = $(CXX) -std=c++11 -o /dev/null -c test/build/c++11.cc
HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false)
# The HOST compiler settings are used to compile the protoc plugins. # The HOST compiler settings are used to compile the protoc plugins.
# In most cases, you won't have to change anything, but if you are # In most cases, you won't have to change anything, but if you are
# cross-compiling, you can override these variables from GNU make's # cross-compiling, you can override these variables from GNU make's
@ -167,7 +171,12 @@ DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
LDFLAGS += $(LDFLAGS_$(CONFIG)) LDFLAGS += $(LDFLAGS_$(CONFIG))
CFLAGS += -std=c89 -pedantic CFLAGS += -std=c89 -pedantic
ifeq ($(HAS_CXX11),true)
CXXFLAGS += -std=c++11 CXXFLAGS += -std=c++11
else
CXXFLAGS += -std=c++0x
DEFINES += GRPC_OLD_CXX
endif
CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
LDFLAGS += -g -fPIC LDFLAGS += -g -fPIC
@ -897,7 +906,11 @@ third_party/protobuf/configure:
$(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
$(E) "[MAKE] Building protobuf" $(E) "[MAKE] Building protobuf"
ifeq ($(HAVE_CXX11),true)
$(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
else
$(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
endif
$(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf clean
$(Q)$(MAKE) -C third_party/protobuf $(Q)$(MAKE) -C third_party/protobuf
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf
@ -7476,13 +7489,24 @@ $(BINDIR)/$(CONFIG)/async_end2end_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/async_end2end_test: $(ASYNC_END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/async_end2end_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/async_end2end_test: $(PROTOBUF_DEP) $(ASYNC_END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(ASYNC_END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/async_end2end_test $(Q) $(LDXX) $(LDFLAGS) $(ASYNC_END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/async_end2end_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/end2end/async_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/end2end/async_end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_async_end2end_test: $(ASYNC_END2END_TEST_OBJS:.o=.dep) deps_async_end2end_test: $(ASYNC_END2END_TEST_OBJS:.o=.dep)
@ -7507,13 +7531,24 @@ $(BINDIR)/$(CONFIG)/channel_arguments_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/channel_arguments_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/channel_arguments_test: $(PROTOBUF_DEP) $(CHANNEL_ARGUMENTS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(CHANNEL_ARGUMENTS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/channel_arguments_test $(Q) $(LDXX) $(LDFLAGS) $(CHANNEL_ARGUMENTS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/channel_arguments_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/client/channel_arguments_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/client/channel_arguments_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_OBJS:.o=.dep) deps_channel_arguments_test: $(CHANNEL_ARGUMENTS_TEST_OBJS:.o=.dep)
@ -7538,13 +7573,24 @@ $(BINDIR)/$(CONFIG)/credentials_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/credentials_test: $(CREDENTIALS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/credentials_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/credentials_test: $(PROTOBUF_DEP) $(CREDENTIALS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(CREDENTIALS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/credentials_test $(Q) $(LDXX) $(LDFLAGS) $(CREDENTIALS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/credentials_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/client/credentials_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/client/credentials_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_credentials_test: $(CREDENTIALS_TEST_OBJS:.o=.dep) deps_credentials_test: $(CREDENTIALS_TEST_OBJS:.o=.dep)
@ -7569,13 +7615,24 @@ $(BINDIR)/$(CONFIG)/end2end_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/end2end_test: $(END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/end2end_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/end2end_test: $(PROTOBUF_DEP) $(END2END_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/end2end_test $(Q) $(LDXX) $(LDFLAGS) $(END2END_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/end2end_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/end2end/end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/end2end/end2end_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_end2end_test: $(END2END_TEST_OBJS:.o=.dep) deps_end2end_test: $(END2END_TEST_OBJS:.o=.dep)
@ -7596,7 +7653,7 @@ GRPC_CPP_PLUGIN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basen
ifeq ($(NO_PROTOBUF),true) ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins if you don't have protobuf 3.0.0+. # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/grpc_cpp_plugin: protobuf_dep_error $(BINDIR)/$(CONFIG)/grpc_cpp_plugin: protobuf_dep_error
@ -7628,7 +7685,7 @@ GRPC_PYTHON_PLUGIN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(ba
ifeq ($(NO_PROTOBUF),true) ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins if you don't have protobuf 3.0.0+. # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/grpc_python_plugin: protobuf_dep_error $(BINDIR)/$(CONFIG)/grpc_python_plugin: protobuf_dep_error
@ -7660,7 +7717,7 @@ GRPC_RUBY_PLUGIN_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(base
ifeq ($(NO_PROTOBUF),true) ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins if you don't have protobuf 3.0.0+. # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/grpc_ruby_plugin: protobuf_dep_error $(BINDIR)/$(CONFIG)/grpc_ruby_plugin: protobuf_dep_error
@ -7699,13 +7756,24 @@ $(BINDIR)/$(CONFIG)/interop_client: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/interop_client: $(INTEROP_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/interop_client: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/interop_client: $(PROTOBUF_DEP) $(INTEROP_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(INTEROP_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_client $(Q) $(LDXX) $(LDFLAGS) $(INTEROP_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_client
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/empty.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/empty.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
@ -7736,13 +7804,24 @@ $(BINDIR)/$(CONFIG)/interop_server: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/interop_server: $(INTEROP_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/interop_server: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/interop_server: $(PROTOBUF_DEP) $(INTEROP_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(INTEROP_SERVER_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_server $(Q) $(LDXX) $(LDFLAGS) $(INTEROP_SERVER_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_server
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/empty.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/empty.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/messages.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/interop/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/test.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
@ -7770,13 +7849,24 @@ $(BINDIR)/$(CONFIG)/interop_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/interop_test: $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/interop_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/interop_test: $(PROTOBUF_DEP) $(INTEROP_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(INTEROP_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_test $(Q) $(LDXX) $(LDFLAGS) $(INTEROP_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/interop_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/interop/interop_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_interop_test: $(INTEROP_TEST_OBJS:.o=.dep) deps_interop_test: $(INTEROP_TEST_OBJS:.o=.dep)
@ -7801,13 +7891,24 @@ $(BINDIR)/$(CONFIG)/pubsub_client: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/pubsub_client: $(PUBSUB_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/pubsub_client: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_client: $(PROTOBUF_DEP) $(PUBSUB_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_client $(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_client
endif endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/main.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/examples/pubsub/main.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_pubsub_client: $(PUBSUB_CLIENT_OBJS:.o=.dep) deps_pubsub_client: $(PUBSUB_CLIENT_OBJS:.o=.dep)
@ -7832,13 +7933,24 @@ $(BINDIR)/$(CONFIG)/pubsub_publisher_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/pubsub_publisher_test: $(PUBSUB_PUBLISHER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/pubsub_publisher_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_publisher_test: $(PROTOBUF_DEP) $(PUBSUB_PUBLISHER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_PUBLISHER_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_publisher_test $(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_PUBLISHER_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_publisher_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/publisher_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/examples/pubsub/publisher_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_pubsub_publisher_test: $(PUBSUB_PUBLISHER_TEST_OBJS:.o=.dep) deps_pubsub_publisher_test: $(PUBSUB_PUBLISHER_TEST_OBJS:.o=.dep)
@ -7863,13 +7975,24 @@ $(BINDIR)/$(CONFIG)/pubsub_subscriber_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/pubsub_subscriber_test: $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/pubsub_subscriber_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/pubsub_subscriber_test: $(PROTOBUF_DEP) $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_subscriber_test $(Q) $(LDXX) $(LDFLAGS) $(PUBSUB_SUBSCRIBER_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/pubsub_subscriber_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/examples/pubsub/subscriber_test.o: $(LIBDIR)/$(CONFIG)/libpubsub_client_lib.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_pubsub_subscriber_test: $(PUBSUB_SUBSCRIBER_TEST_OBJS:.o=.dep) deps_pubsub_subscriber_test: $(PUBSUB_SUBSCRIBER_TEST_OBJS:.o=.dep)
@ -7895,13 +8018,24 @@ $(BINDIR)/$(CONFIG)/qps_client: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/qps_client: $(QPS_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/qps_client: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/qps_client: $(PROTOBUF_DEP) $(QPS_CLIENT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(QPS_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_client $(Q) $(LDXX) $(LDFLAGS) $(QPS_CLIENT_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_client
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/qps/client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/client.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
@ -7928,13 +8062,24 @@ $(BINDIR)/$(CONFIG)/qps_server: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/qps_server: $(QPS_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/qps_server: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/qps_server: $(PROTOBUF_DEP) $(QPS_SERVER_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(QPS_SERVER_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_server $(Q) $(LDXX) $(LDFLAGS) $(QPS_SERVER_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/qps_server
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/qpstest.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/qps/server.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/qps/server.o: $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
@ -7960,13 +8105,24 @@ $(BINDIR)/$(CONFIG)/status_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/status_test: $(STATUS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/status_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/status_test: $(PROTOBUF_DEP) $(STATUS_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(STATUS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/status_test $(Q) $(LDXX) $(LDFLAGS) $(STATUS_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/status_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/util/status_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/util/status_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_status_test: $(STATUS_TEST_OBJS:.o=.dep) deps_status_test: $(STATUS_TEST_OBJS:.o=.dep)
@ -7991,13 +8147,24 @@ $(BINDIR)/$(CONFIG)/thread_pool_test: openssl_dep_error
else else
$(BINDIR)/$(CONFIG)/thread_pool_test: $(THREAD_POOL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/thread_pool_test: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/thread_pool_test: $(PROTOBUF_DEP) $(THREAD_POOL_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(THREAD_POOL_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/thread_pool_test $(Q) $(LDXX) $(LDFLAGS) $(THREAD_POOL_TEST_OBJS) $(GTEST_LIB) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/thread_pool_test
endif endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/server/thread_pool_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OBJDIR)/$(CONFIG)/test/cpp/server/thread_pool_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
deps_thread_pool_test: $(THREAD_POOL_TEST_OBJS:.o=.dep) deps_thread_pool_test: $(THREAD_POOL_TEST_OBJS:.o=.dep)

@ -61,28 +61,28 @@ class PublisherServiceImpl : public tech::pubsub::PublisherService::Service {
public: public:
Status CreateTopic(::grpc::ServerContext* context, Status CreateTopic(::grpc::ServerContext* context,
const ::tech::pubsub::Topic* request, const ::tech::pubsub::Topic* request,
::tech::pubsub::Topic* response) override { ::tech::pubsub::Topic* response) GRPC_OVERRIDE {
EXPECT_EQ(request->name(), kTopic); EXPECT_EQ(request->name(), kTopic);
return Status::OK; return Status::OK;
} }
Status Publish(ServerContext* context, Status Publish(ServerContext* context,
const ::tech::pubsub::PublishRequest* request, const ::tech::pubsub::PublishRequest* request,
::proto2::Empty* response) override { ::proto2::Empty* response) GRPC_OVERRIDE {
EXPECT_EQ(request->message().data(), kMessageData); EXPECT_EQ(request->message().data(), kMessageData);
return Status::OK; return Status::OK;
} }
Status GetTopic(ServerContext* context, Status GetTopic(ServerContext* context,
const ::tech::pubsub::GetTopicRequest* request, const ::tech::pubsub::GetTopicRequest* request,
::tech::pubsub::Topic* response) override { ::tech::pubsub::Topic* response) GRPC_OVERRIDE {
EXPECT_EQ(request->topic(), kTopic); EXPECT_EQ(request->topic(), kTopic);
return Status::OK; return Status::OK;
} }
Status ListTopics(ServerContext* context, Status ListTopics(
const ::tech::pubsub::ListTopicsRequest* request, ServerContext* context, const ::tech::pubsub::ListTopicsRequest* request,
::tech::pubsub::ListTopicsResponse* response) override { ::tech::pubsub::ListTopicsResponse* response) GRPC_OVERRIDE {
std::ostringstream ss; std::ostringstream ss;
ss << "cloud.googleapis.com/project in (/projects/" << kProjectId << ")"; ss << "cloud.googleapis.com/project in (/projects/" << kProjectId << ")";
EXPECT_EQ(request->query(), ss.str()); EXPECT_EQ(request->query(), ss.str());
@ -92,7 +92,7 @@ class PublisherServiceImpl : public tech::pubsub::PublisherService::Service {
Status DeleteTopic(ServerContext* context, Status DeleteTopic(ServerContext* context,
const ::tech::pubsub::DeleteTopicRequest* request, const ::tech::pubsub::DeleteTopicRequest* request,
::proto2::Empty* response) override { ::proto2::Empty* response) GRPC_OVERRIDE {
EXPECT_EQ(request->topic(), kTopic); EXPECT_EQ(request->topic(), kTopic);
return Status::OK; return Status::OK;
} }
@ -102,7 +102,7 @@ class PublisherServiceImpl : public tech::pubsub::PublisherService::Service {
class PublisherTest : public ::testing::Test { class PublisherTest : public ::testing::Test {
protected: protected:
// Setup a server and a client for PublisherService. // Setup a server and a client for PublisherService.
void SetUp() override { void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port; server_address_ << "localhost:" << port;
ServerBuilder builder; ServerBuilder builder;
@ -116,7 +116,7 @@ class PublisherTest : public ::testing::Test {
publisher_.reset(new grpc::examples::pubsub::Publisher(channel_)); publisher_.reset(new grpc::examples::pubsub::Publisher(channel_));
} }
void TearDown() override { void TearDown() GRPC_OVERRIDE {
server_->Shutdown(); server_->Shutdown();
publisher_->Shutdown(); publisher_->Shutdown();
} }

@ -57,9 +57,9 @@ const char kData[] = "Message data";
class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service { class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
public: public:
Status CreateSubscription(ServerContext* context, Status CreateSubscription(
const tech::pubsub::Subscription* request, ServerContext* context, const tech::pubsub::Subscription* request,
tech::pubsub::Subscription* response) override { tech::pubsub::Subscription* response) GRPC_OVERRIDE {
EXPECT_EQ(request->topic(), kTopic); EXPECT_EQ(request->topic(), kTopic);
EXPECT_EQ(request->name(), kSubscriptionName); EXPECT_EQ(request->name(), kSubscriptionName);
return Status::OK; return Status::OK;
@ -67,7 +67,7 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
Status GetSubscription(ServerContext* context, Status GetSubscription(ServerContext* context,
const tech::pubsub::GetSubscriptionRequest* request, const tech::pubsub::GetSubscriptionRequest* request,
tech::pubsub::Subscription* response) override { tech::pubsub::Subscription* response) GRPC_OVERRIDE {
EXPECT_EQ(request->subscription(), kSubscriptionName); EXPECT_EQ(request->subscription(), kSubscriptionName);
response->set_topic(kTopic); response->set_topic(kTopic);
return Status::OK; return Status::OK;
@ -76,14 +76,13 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
Status DeleteSubscription( Status DeleteSubscription(
ServerContext* context, ServerContext* context,
const tech::pubsub::DeleteSubscriptionRequest* request, const tech::pubsub::DeleteSubscriptionRequest* request,
proto2::Empty* response) override { proto2::Empty* response) GRPC_OVERRIDE {
EXPECT_EQ(request->subscription(), kSubscriptionName); EXPECT_EQ(request->subscription(), kSubscriptionName);
return Status::OK; return Status::OK;
} }
Status Pull(ServerContext* context, Status Pull(ServerContext* context, const tech::pubsub::PullRequest* request,
const tech::pubsub::PullRequest* request, tech::pubsub::PullResponse* response) GRPC_OVERRIDE {
tech::pubsub::PullResponse* response) override {
EXPECT_EQ(request->subscription(), kSubscriptionName); EXPECT_EQ(request->subscription(), kSubscriptionName);
response->set_ack_id("1"); response->set_ack_id("1");
response->mutable_pubsub_event()->mutable_message()->set_data(kData); response->mutable_pubsub_event()->mutable_message()->set_data(kData);
@ -92,7 +91,7 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
Status Acknowledge(ServerContext* context, Status Acknowledge(ServerContext* context,
const tech::pubsub::AcknowledgeRequest* request, const tech::pubsub::AcknowledgeRequest* request,
proto2::Empty* response) override { proto2::Empty* response) GRPC_OVERRIDE {
return Status::OK; return Status::OK;
} }
@ -101,7 +100,7 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
class SubscriberTest : public ::testing::Test { class SubscriberTest : public ::testing::Test {
protected: protected:
// Setup a server and a client for SubscriberService. // Setup a server and a client for SubscriberService.
void SetUp() override { void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port; server_address_ << "localhost:" << port;
ServerBuilder builder; ServerBuilder builder;
@ -115,7 +114,7 @@ class SubscriberTest : public ::testing::Test {
subscriber_.reset(new grpc::examples::pubsub::Subscriber(channel_)); subscriber_.reset(new grpc::examples::pubsub::Subscriber(channel_));
} }
void TearDown() override { void TearDown() GRPC_OVERRIDE {
server_->Shutdown(); server_->Shutdown();
subscriber_->Shutdown(); subscriber_->Shutdown();
} }

@ -45,7 +45,7 @@
namespace grpc { namespace grpc {
template <class R> template <class R>
class ClientAsyncResponseReader final { class ClientAsyncResponseReader GRPC_FINAL {
public: public:
ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context, const RpcMethod& method, ClientContext* context,
@ -79,7 +79,7 @@ class ClientAsyncResponseReader final {
private: private:
ClientContext* context_ = nullptr; ClientContext* context_;
Call call_; Call call_;
CallOpBuffer init_buf_; CallOpBuffer init_buf_;
CallOpBuffer meta_buf_; CallOpBuffer meta_buf_;
@ -87,7 +87,8 @@ class ClientAsyncResponseReader final {
}; };
template <class W> template <class W>
class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface { class ServerAsyncResponseWriter GRPC_FINAL
: public ServerAsyncStreamingInterface {
public: public:
explicit ServerAsyncResponseWriter(ServerContext* ctx) explicit ServerAsyncResponseWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
@ -127,7 +128,7 @@ class ServerAsyncResponseWriter final : public ServerAsyncStreamingInterface {
} }
private: private:
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; }
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;

@ -139,7 +139,7 @@ class ClientContext {
return authority_; return authority_;
} }
bool initial_metadata_received_ = false; bool initial_metadata_received_;
grpc_call *call_; grpc_call *call_;
grpc_completion_queue *cq_; grpc_completion_queue *cq_;
gpr_timespec absolute_deadline_; gpr_timespec absolute_deadline_;

@ -36,6 +36,14 @@
#include <string> #include <string>
#ifdef GRPC_OLD_CXX
#define GRPC_FINAL
#define GRPC_OVERRIDE
#else
#define GRPC_FINAL final
#define GRPC_OVERRIDE override
#endif
namespace grpc { namespace grpc {
typedef std::string string; typedef std::string string;

@ -47,7 +47,7 @@ namespace grpc {
// to creating an instance using CredentialsFactory, and passing it down // to creating an instance using CredentialsFactory, and passing it down
// during channel construction. // during channel construction.
class Credentials final { class Credentials GRPC_FINAL {
public: public:
~Credentials(); ~Credentials();

@ -35,6 +35,7 @@
#define __GRPCPP_CALL_H__ #define __GRPCPP_CALL_H__
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc++/config.h>
#include <grpc++/status.h> #include <grpc++/status.h>
#include <grpc++/completion_queue.h> #include <grpc++/completion_queue.h>
@ -56,7 +57,7 @@ class Call;
class CallOpBuffer : public CompletionQueueTag { class CallOpBuffer : public CompletionQueueTag {
public: public:
CallOpBuffer() : return_tag_(this) {} CallOpBuffer();
~CallOpBuffer(); ~CallOpBuffer();
void Reset(void *next_return_tag); void Reset(void *next_return_tag);
@ -80,40 +81,40 @@ class CallOpBuffer : public CompletionQueueTag {
void FillOps(grpc_op *ops, size_t *nops); void FillOps(grpc_op *ops, size_t *nops);
// Called by completion queue just prior to returning from Next() or Pluck() // Called by completion queue just prior to returning from Next() or Pluck()
bool FinalizeResult(void **tag, bool *status) override; bool FinalizeResult(void **tag, bool *status) GRPC_OVERRIDE;
bool got_message = false; bool got_message;
private: private:
void *return_tag_ = nullptr; void *return_tag_;
// Send initial metadata // Send initial metadata
bool send_initial_metadata_ = false; bool send_initial_metadata_;
size_t initial_metadata_count_ = 0; size_t initial_metadata_count_;
grpc_metadata *initial_metadata_ = nullptr; grpc_metadata *initial_metadata_;
// Recv initial metadta // Recv initial metadta
std::multimap<grpc::string, grpc::string> *recv_initial_metadata_ = nullptr; std::multimap<grpc::string, grpc::string> *recv_initial_metadata_;
grpc_metadata_array recv_initial_metadata_arr_ = {0, 0, nullptr}; grpc_metadata_array recv_initial_metadata_arr_;
// Send message // Send message
const google::protobuf::Message *send_message_ = nullptr; const google::protobuf::Message *send_message_;
grpc_byte_buffer *send_message_buf_ = nullptr; grpc_byte_buffer *send_message_buf_;
// Recv message // Recv message
google::protobuf::Message *recv_message_ = nullptr; google::protobuf::Message *recv_message_;
grpc_byte_buffer *recv_message_buf_ = nullptr; grpc_byte_buffer *recv_message_buf_;
// Client send close // Client send close
bool client_send_close_ = false; bool client_send_close_;
// Client recv status // Client recv status
std::multimap<grpc::string, grpc::string> *recv_trailing_metadata_ = nullptr; std::multimap<grpc::string, grpc::string> *recv_trailing_metadata_;
Status *recv_status_ = nullptr; Status *recv_status_;
grpc_metadata_array recv_trailing_metadata_arr_ = {0, 0, nullptr}; grpc_metadata_array recv_trailing_metadata_arr_;
grpc_status_code status_code_ = GRPC_STATUS_OK; grpc_status_code status_code_;
char *status_details_ = nullptr; char *status_details_;
size_t status_details_capacity_ = 0; size_t status_details_capacity_;
// Server send status // Server send status
const Status *send_status_ = nullptr; const Status *send_status_;
size_t trailing_metadata_count_ = 0; size_t trailing_metadata_count_;
grpc_metadata *trailing_metadata_ = nullptr; grpc_metadata *trailing_metadata_;
int cancelled_buf_; int cancelled_buf_;
bool *recv_closed_ = nullptr; bool *recv_closed_;
}; };
// Channel and Server implement this to allow them to hook performing ops // Channel and Server implement this to allow them to hook performing ops
@ -124,7 +125,7 @@ class CallHook {
}; };
// Straightforward wrapping of the C call object // Straightforward wrapping of the C call object
class Call final { class Call GRPC_FINAL {
public: public:
/* call is owned by the caller */ /* call is owned by the caller */
Call(grpc_call *call, CallHook *call_hook_, CompletionQueue *cq); Call(grpc_call *call, CallHook *call_hook_, CompletionQueue *cq);

@ -77,7 +77,7 @@ class RpcMethodHandler : public MethodHandler {
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
Status RunHandler(const HandlerParameter& param) final { Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
// Invoke application function, cast proto messages to their actual types. // Invoke application function, cast proto messages to their actual types.
return func_(service_, param.server_context, return func_(service_, param.server_context,
dynamic_cast<const RequestType*>(param.request), dynamic_cast<const RequestType*>(param.request),
@ -102,7 +102,7 @@ class ClientStreamingHandler : public MethodHandler {
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
Status RunHandler(const HandlerParameter& param) final { Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
ServerReader<RequestType> reader(param.call, param.server_context); ServerReader<RequestType> reader(param.call, param.server_context);
return func_(service_, param.server_context, &reader, return func_(service_, param.server_context, &reader,
dynamic_cast<ResponseType*>(param.response)); dynamic_cast<ResponseType*>(param.response));
@ -124,7 +124,7 @@ class ServerStreamingHandler : public MethodHandler {
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
Status RunHandler(const HandlerParameter& param) final { Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
ServerWriter<ResponseType> writer(param.call, param.server_context); ServerWriter<ResponseType> writer(param.call, param.server_context);
return func_(service_, param.server_context, return func_(service_, param.server_context,
dynamic_cast<const RequestType*>(param.request), &writer); dynamic_cast<const RequestType*>(param.request), &writer);
@ -147,7 +147,7 @@ class BidiStreamingHandler : public MethodHandler {
ServiceType* service) ServiceType* service)
: func_(func), service_(service) {} : func_(func), service_(service) {}
Status RunHandler(const HandlerParameter& param) final { Status RunHandler(const HandlerParameter& param) GRPC_FINAL {
ServerReaderWriter<ResponseType, RequestType> stream(param.call, ServerReaderWriter<ResponseType, RequestType> stream(param.call,
param.server_context); param.server_context);
return func_(service_, param.server_context, &stream); return func_(service_, param.server_context, &stream);

@ -79,7 +79,11 @@ class AsynchronousService {
AsynchronousService(CompletionQueue* cq, const char** method_names, AsynchronousService(CompletionQueue* cq, const char** method_names,
size_t method_count) size_t method_count)
: cq_(cq), method_names_(method_names), method_count_(method_count) {} : cq_(cq),
dispatch_impl_(nullptr),
method_names_(method_names),
method_count_(method_count),
request_args_(nullptr) {}
~AsynchronousService() { delete[] request_args_; } ~AsynchronousService() { delete[] request_args_; }
@ -116,10 +120,10 @@ class AsynchronousService {
private: private:
friend class Server; friend class Server;
CompletionQueue* const cq_; CompletionQueue* const cq_;
DispatchImpl* dispatch_impl_ = nullptr; DispatchImpl* dispatch_impl_;
const char** const method_names_; const char** const method_names_;
size_t method_count_; size_t method_count_;
void** request_args_ = nullptr; void** request_args_;
}; };
} // namespace grpc } // namespace grpc

@ -61,8 +61,8 @@ class ServerCredentials;
class ThreadPoolInterface; class ThreadPoolInterface;
// Currently it only supports handling rpcs in a single thread. // Currently it only supports handling rpcs in a single thread.
class Server final : private CallHook, class Server GRPC_FINAL : private CallHook,
private AsynchronousService::DispatchImpl { private AsynchronousService::DispatchImpl {
public: public:
~Server(); ~Server();
@ -97,7 +97,7 @@ class Server final : private CallHook,
void RunRpc(); void RunRpc();
void ScheduleCallback(); void ScheduleCallback();
void PerformOpsOnCall(CallOpBuffer* ops, Call* call) override; void PerformOpsOnCall(CallOpBuffer* ops, Call* call) GRPC_OVERRIDE;
// DispatchImpl // DispatchImpl
void RequestAsyncCall(void* registered_method, ServerContext* context, void RequestAsyncCall(void* registered_method, ServerContext* context,

@ -83,7 +83,7 @@ class ServerBuilder {
std::vector<AsynchronousService*> async_services_; std::vector<AsynchronousService*> async_services_;
std::vector<grpc::string> ports_; std::vector<grpc::string> ports_;
std::shared_ptr<ServerCredentials> creds_; std::shared_ptr<ServerCredentials> creds_;
ThreadPoolInterface* thread_pool_ = nullptr; ThreadPoolInterface* thread_pool_;
}; };
} // namespace grpc } // namespace grpc

@ -66,7 +66,7 @@ class CompletionQueue;
class Server; class Server;
// Interface of server side rpc context. // Interface of server side rpc context.
class ServerContext final { class ServerContext GRPC_FINAL {
public: public:
ServerContext(); // for async calls ServerContext(); // for async calls
~ServerContext(); ~ServerContext();
@ -108,12 +108,12 @@ class ServerContext final {
ServerContext(gpr_timespec deadline, grpc_metadata* metadata, ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
size_t metadata_count); size_t metadata_count);
CompletionOp* completion_op_ = nullptr; CompletionOp* completion_op_;
std::chrono::system_clock::time_point deadline_; std::chrono::system_clock::time_point deadline_;
grpc_call* call_ = nullptr; grpc_call* call_;
CompletionQueue* cq_ = nullptr; CompletionQueue* cq_;
bool sent_initial_metadata_ = false; bool sent_initial_metadata_;
std::multimap<grpc::string, grpc::string> client_metadata_; std::multimap<grpc::string, grpc::string> client_metadata_;
std::multimap<grpc::string, grpc::string> initial_metadata_; std::multimap<grpc::string, grpc::string> initial_metadata_;
std::multimap<grpc::string, grpc::string> trailing_metadata_; std::multimap<grpc::string, grpc::string> trailing_metadata_;

@ -44,7 +44,7 @@ struct grpc_server_credentials;
namespace grpc { namespace grpc {
// grpc_server_credentials wrapper class. // grpc_server_credentials wrapper class.
class ServerCredentials final { class ServerCredentials GRPC_FINAL {
public: public:
~ServerCredentials(); ~ServerCredentials();

@ -83,8 +83,8 @@ class WriterInterface {
}; };
template <class R> template <class R>
class ClientReader final : public ClientStreamingInterface, class ClientReader GRPC_FINAL : public ClientStreamingInterface,
public ReaderInterface<R> { public ReaderInterface<R> {
public: public:
// Blocking create a stream and write the first request out. // Blocking create a stream and write the first request out.
ClientReader(ChannelInterface* channel, const RpcMethod& method, ClientReader(ChannelInterface* channel, const RpcMethod& method,
@ -111,7 +111,7 @@ class ClientReader final : public ClientStreamingInterface,
GPR_ASSERT(cq_.Pluck(&buf)); GPR_ASSERT(cq_.Pluck(&buf));
} }
virtual bool Read(R* msg) override { virtual bool Read(R* msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
buf.AddRecvInitialMetadata(context_); buf.AddRecvInitialMetadata(context_);
@ -121,7 +121,7 @@ class ClientReader final : public ClientStreamingInterface,
return cq_.Pluck(&buf) && buf.got_message; return cq_.Pluck(&buf) && buf.got_message;
} }
virtual Status Finish() override { virtual Status Finish() GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
Status status; Status status;
buf.AddClientRecvStatus(context_, &status); buf.AddClientRecvStatus(context_, &status);
@ -137,8 +137,8 @@ class ClientReader final : public ClientStreamingInterface,
}; };
template <class W> template <class W>
class ClientWriter final : public ClientStreamingInterface, class ClientWriter GRPC_FINAL : public ClientStreamingInterface,
public WriterInterface<W> { public WriterInterface<W> {
public: public:
// Blocking create a stream. // Blocking create a stream.
ClientWriter(ChannelInterface* channel, const RpcMethod& method, ClientWriter(ChannelInterface* channel, const RpcMethod& method,
@ -152,7 +152,7 @@ class ClientWriter final : public ClientStreamingInterface,
cq_.Pluck(&buf); cq_.Pluck(&buf);
} }
virtual bool Write(const W& msg) override { virtual bool Write(const W& msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
buf.AddSendMessage(msg); buf.AddSendMessage(msg);
call_.PerformOps(&buf); call_.PerformOps(&buf);
@ -167,7 +167,7 @@ class ClientWriter final : public ClientStreamingInterface,
} }
// Read the final response and wait for the final status. // Read the final response and wait for the final status.
virtual Status Finish() override { virtual Status Finish() GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
Status status; Status status;
buf.AddRecvMessage(response_); buf.AddRecvMessage(response_);
@ -186,9 +186,9 @@ class ClientWriter final : public ClientStreamingInterface,
// Client-side interface for bi-directional streaming. // Client-side interface for bi-directional streaming.
template <class W, class R> template <class W, class R>
class ClientReaderWriter final : public ClientStreamingInterface, class ClientReaderWriter GRPC_FINAL : public ClientStreamingInterface,
public WriterInterface<W>, public WriterInterface<W>,
public ReaderInterface<R> { public ReaderInterface<R> {
public: public:
// Blocking create a stream. // Blocking create a stream.
ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method, ClientReaderWriter(ChannelInterface* channel, const RpcMethod& method,
@ -213,7 +213,7 @@ class ClientReaderWriter final : public ClientStreamingInterface,
GPR_ASSERT(cq_.Pluck(&buf)); GPR_ASSERT(cq_.Pluck(&buf));
} }
virtual bool Read(R* msg) override { virtual bool Read(R* msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
buf.AddRecvInitialMetadata(context_); buf.AddRecvInitialMetadata(context_);
@ -223,7 +223,7 @@ class ClientReaderWriter final : public ClientStreamingInterface,
return cq_.Pluck(&buf) && buf.got_message; return cq_.Pluck(&buf) && buf.got_message;
} }
virtual bool Write(const W& msg) override { virtual bool Write(const W& msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
buf.AddSendMessage(msg); buf.AddSendMessage(msg);
call_.PerformOps(&buf); call_.PerformOps(&buf);
@ -237,7 +237,7 @@ class ClientReaderWriter final : public ClientStreamingInterface,
return cq_.Pluck(&buf); return cq_.Pluck(&buf);
} }
virtual Status Finish() override { virtual Status Finish() GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
Status status; Status status;
buf.AddClientRecvStatus(context_, &status); buf.AddClientRecvStatus(context_, &status);
@ -253,7 +253,7 @@ class ClientReaderWriter final : public ClientStreamingInterface,
}; };
template <class R> template <class R>
class ServerReader final : public ReaderInterface<R> { class ServerReader GRPC_FINAL : public ReaderInterface<R> {
public: public:
ServerReader(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} ServerReader(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
@ -267,7 +267,7 @@ class ServerReader final : public ReaderInterface<R> {
call_->cq()->Pluck(&buf); call_->cq()->Pluck(&buf);
} }
virtual bool Read(R* msg) override { virtual bool Read(R* msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
buf.AddRecvMessage(msg); buf.AddRecvMessage(msg);
call_->PerformOps(&buf); call_->PerformOps(&buf);
@ -280,7 +280,7 @@ class ServerReader final : public ReaderInterface<R> {
}; };
template <class W> template <class W>
class ServerWriter final : public WriterInterface<W> { class ServerWriter GRPC_FINAL : public WriterInterface<W> {
public: public:
ServerWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} ServerWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
@ -294,7 +294,7 @@ class ServerWriter final : public WriterInterface<W> {
call_->cq()->Pluck(&buf); call_->cq()->Pluck(&buf);
} }
virtual bool Write(const W& msg) override { virtual bool Write(const W& msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
if (!ctx_->sent_initial_metadata_) { if (!ctx_->sent_initial_metadata_) {
buf.AddSendInitialMetadata(&ctx_->initial_metadata_); buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
@ -312,8 +312,8 @@ class ServerWriter final : public WriterInterface<W> {
// Server-side interface for bi-directional streaming. // Server-side interface for bi-directional streaming.
template <class W, class R> template <class W, class R>
class ServerReaderWriter final : public WriterInterface<W>, class ServerReaderWriter GRPC_FINAL : public WriterInterface<W>,
public ReaderInterface<R> { public ReaderInterface<R> {
public: public:
ServerReaderWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {} ServerReaderWriter(Call* call, ServerContext* ctx) : call_(call), ctx_(ctx) {}
@ -327,14 +327,14 @@ class ServerReaderWriter final : public WriterInterface<W>,
call_->cq()->Pluck(&buf); call_->cq()->Pluck(&buf);
} }
virtual bool Read(R* msg) override { virtual bool Read(R* msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
buf.AddRecvMessage(msg); buf.AddRecvMessage(msg);
call_->PerformOps(&buf); call_->PerformOps(&buf);
return call_->cq()->Pluck(&buf) && buf.got_message; return call_->cq()->Pluck(&buf) && buf.got_message;
} }
virtual bool Write(const W& msg) override { virtual bool Write(const W& msg) GRPC_OVERRIDE {
CallOpBuffer buf; CallOpBuffer buf;
if (!ctx_->sent_initial_metadata_) { if (!ctx_->sent_initial_metadata_) {
buf.AddSendInitialMetadata(&ctx_->initial_metadata_); buf.AddSendInitialMetadata(&ctx_->initial_metadata_);
@ -380,8 +380,8 @@ class AsyncWriterInterface {
}; };
template <class R> template <class R>
class ClientAsyncReader final : public ClientAsyncStreamingInterface, class ClientAsyncReader GRPC_FINAL : public ClientAsyncStreamingInterface,
public AsyncReaderInterface<R> { public AsyncReaderInterface<R> {
public: public:
// Create a stream and write the first request out. // Create a stream and write the first request out.
ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq, ClientAsyncReader(ChannelInterface* channel, CompletionQueue* cq,
@ -395,7 +395,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface,
call_.PerformOps(&init_buf_); call_.PerformOps(&init_buf_);
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_); GPR_ASSERT(!context_->initial_metadata_received_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -403,7 +403,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
void Read(R* msg, void* tag) override { void Read(R* msg, void* tag) GRPC_OVERRIDE {
read_buf_.Reset(tag); read_buf_.Reset(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
read_buf_.AddRecvInitialMetadata(context_); read_buf_.AddRecvInitialMetadata(context_);
@ -412,7 +412,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface,
call_.PerformOps(&read_buf_); call_.PerformOps(&read_buf_);
} }
void Finish(Status* status, void* tag) override { void Finish(Status* status, void* tag) GRPC_OVERRIDE {
finish_buf_.Reset(tag); finish_buf_.Reset(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
finish_buf_.AddRecvInitialMetadata(context_); finish_buf_.AddRecvInitialMetadata(context_);
@ -422,7 +422,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface,
} }
private: private:
ClientContext* context_ = nullptr; ClientContext* context_;
Call call_; Call call_;
CallOpBuffer init_buf_; CallOpBuffer init_buf_;
CallOpBuffer meta_buf_; CallOpBuffer meta_buf_;
@ -431,8 +431,8 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface,
}; };
template <class W> template <class W>
class ClientAsyncWriter final : public ClientAsyncStreamingInterface, class ClientAsyncWriter GRPC_FINAL : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W> { public AsyncWriterInterface<W> {
public: public:
ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq, ClientAsyncWriter(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context, const RpcMethod& method, ClientContext* context,
@ -445,7 +445,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&init_buf_); call_.PerformOps(&init_buf_);
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_); GPR_ASSERT(!context_->initial_metadata_received_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -453,7 +453,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
void Write(const W& msg, void* tag) override { void Write(const W& msg, void* tag) GRPC_OVERRIDE {
write_buf_.Reset(tag); write_buf_.Reset(tag);
write_buf_.AddSendMessage(msg); write_buf_.AddSendMessage(msg);
call_.PerformOps(&write_buf_); call_.PerformOps(&write_buf_);
@ -465,7 +465,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&writes_done_buf_); call_.PerformOps(&writes_done_buf_);
} }
void Finish(Status* status, void* tag) override { void Finish(Status* status, void* tag) GRPC_OVERRIDE {
finish_buf_.Reset(tag); finish_buf_.Reset(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
finish_buf_.AddRecvInitialMetadata(context_); finish_buf_.AddRecvInitialMetadata(context_);
@ -476,7 +476,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface,
} }
private: private:
ClientContext* context_ = nullptr; ClientContext* context_;
google::protobuf::Message* const response_; google::protobuf::Message* const response_;
Call call_; Call call_;
CallOpBuffer init_buf_; CallOpBuffer init_buf_;
@ -488,9 +488,9 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface,
// Client-side interface for bi-directional streaming. // Client-side interface for bi-directional streaming.
template <class W, class R> template <class W, class R>
class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface, class ClientAsyncReaderWriter GRPC_FINAL : public ClientAsyncStreamingInterface,
public AsyncWriterInterface<W>, public AsyncWriterInterface<W>,
public AsyncReaderInterface<R> { public AsyncReaderInterface<R> {
public: public:
ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq, ClientAsyncReaderWriter(ChannelInterface* channel, CompletionQueue* cq,
const RpcMethod& method, ClientContext* context, const RpcMethod& method, ClientContext* context,
@ -501,7 +501,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&init_buf_); call_.PerformOps(&init_buf_);
} }
void ReadInitialMetadata(void* tag) override { void ReadInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!context_->initial_metadata_received_); GPR_ASSERT(!context_->initial_metadata_received_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -509,7 +509,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
void Read(R* msg, void* tag) override { void Read(R* msg, void* tag) GRPC_OVERRIDE {
read_buf_.Reset(tag); read_buf_.Reset(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
read_buf_.AddRecvInitialMetadata(context_); read_buf_.AddRecvInitialMetadata(context_);
@ -518,7 +518,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&read_buf_); call_.PerformOps(&read_buf_);
} }
void Write(const W& msg, void* tag) override { void Write(const W& msg, void* tag) GRPC_OVERRIDE {
write_buf_.Reset(tag); write_buf_.Reset(tag);
write_buf_.AddSendMessage(msg); write_buf_.AddSendMessage(msg);
call_.PerformOps(&write_buf_); call_.PerformOps(&write_buf_);
@ -530,7 +530,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
call_.PerformOps(&writes_done_buf_); call_.PerformOps(&writes_done_buf_);
} }
void Finish(Status* status, void* tag) override { void Finish(Status* status, void* tag) GRPC_OVERRIDE {
finish_buf_.Reset(tag); finish_buf_.Reset(tag);
if (!context_->initial_metadata_received_) { if (!context_->initial_metadata_received_) {
finish_buf_.AddRecvInitialMetadata(context_); finish_buf_.AddRecvInitialMetadata(context_);
@ -540,7 +540,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
} }
private: private:
ClientContext* context_ = nullptr; ClientContext* context_;
Call call_; Call call_;
CallOpBuffer init_buf_; CallOpBuffer init_buf_;
CallOpBuffer meta_buf_; CallOpBuffer meta_buf_;
@ -551,13 +551,13 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface,
}; };
template <class W, class R> template <class W, class R>
class ServerAsyncReader : public ServerAsyncStreamingInterface, class ServerAsyncReader GRPC_FINAL : public ServerAsyncStreamingInterface,
public AsyncReaderInterface<R> { public AsyncReaderInterface<R> {
public: public:
explicit ServerAsyncReader(ServerContext* ctx) explicit ServerAsyncReader(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
void SendInitialMetadata(void* tag) override { void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_); GPR_ASSERT(!ctx_->sent_initial_metadata_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -566,7 +566,7 @@ class ServerAsyncReader : public ServerAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
void Read(R* msg, void* tag) override { void Read(R* msg, void* tag) GRPC_OVERRIDE {
read_buf_.Reset(tag); read_buf_.Reset(tag);
read_buf_.AddRecvMessage(msg); read_buf_.AddRecvMessage(msg);
call_.PerformOps(&read_buf_); call_.PerformOps(&read_buf_);
@ -598,7 +598,7 @@ class ServerAsyncReader : public ServerAsyncStreamingInterface,
} }
private: private:
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; }
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;
@ -608,13 +608,13 @@ class ServerAsyncReader : public ServerAsyncStreamingInterface,
}; };
template <class W> template <class W>
class ServerAsyncWriter : public ServerAsyncStreamingInterface, class ServerAsyncWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
public AsyncWriterInterface<W> { public AsyncWriterInterface<W> {
public: public:
explicit ServerAsyncWriter(ServerContext* ctx) explicit ServerAsyncWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
void SendInitialMetadata(void* tag) override { void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_); GPR_ASSERT(!ctx_->sent_initial_metadata_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -623,7 +623,7 @@ class ServerAsyncWriter : public ServerAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
void Write(const W& msg, void* tag) override { void Write(const W& msg, void* tag) GRPC_OVERRIDE {
write_buf_.Reset(tag); write_buf_.Reset(tag);
if (!ctx_->sent_initial_metadata_) { if (!ctx_->sent_initial_metadata_) {
write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_); write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
@ -644,7 +644,7 @@ class ServerAsyncWriter : public ServerAsyncStreamingInterface,
} }
private: private:
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; }
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;
@ -655,14 +655,14 @@ class ServerAsyncWriter : public ServerAsyncStreamingInterface,
// Server-side interface for bi-directional streaming. // Server-side interface for bi-directional streaming.
template <class W, class R> template <class W, class R>
class ServerAsyncReaderWriter : public ServerAsyncStreamingInterface, class ServerAsyncReaderWriter GRPC_FINAL : public ServerAsyncStreamingInterface,
public AsyncWriterInterface<W>, public AsyncWriterInterface<W>,
public AsyncReaderInterface<R> { public AsyncReaderInterface<R> {
public: public:
explicit ServerAsyncReaderWriter(ServerContext* ctx) explicit ServerAsyncReaderWriter(ServerContext* ctx)
: call_(nullptr, nullptr, nullptr), ctx_(ctx) {} : call_(nullptr, nullptr, nullptr), ctx_(ctx) {}
void SendInitialMetadata(void* tag) override { void SendInitialMetadata(void* tag) GRPC_OVERRIDE {
GPR_ASSERT(!ctx_->sent_initial_metadata_); GPR_ASSERT(!ctx_->sent_initial_metadata_);
meta_buf_.Reset(tag); meta_buf_.Reset(tag);
@ -671,13 +671,13 @@ class ServerAsyncReaderWriter : public ServerAsyncStreamingInterface,
call_.PerformOps(&meta_buf_); call_.PerformOps(&meta_buf_);
} }
virtual void Read(R* msg, void* tag) override { virtual void Read(R* msg, void* tag) GRPC_OVERRIDE {
read_buf_.Reset(tag); read_buf_.Reset(tag);
read_buf_.AddRecvMessage(msg); read_buf_.AddRecvMessage(msg);
call_.PerformOps(&read_buf_); call_.PerformOps(&read_buf_);
} }
virtual void Write(const W& msg, void* tag) override { virtual void Write(const W& msg, void* tag) GRPC_OVERRIDE {
write_buf_.Reset(tag); write_buf_.Reset(tag);
if (!ctx_->sent_initial_metadata_) { if (!ctx_->sent_initial_metadata_) {
write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_); write_buf_.AddSendInitialMetadata(&ctx_->initial_metadata_);
@ -698,7 +698,7 @@ class ServerAsyncReaderWriter : public ServerAsyncStreamingInterface,
} }
private: private:
void BindCall(Call* call) override { call_ = *call; } void BindCall(Call* call) GRPC_OVERRIDE { call_ = *call; }
Call call_; Call call_;
ServerContext* ctx_; ServerContext* ctx_;

@ -300,13 +300,13 @@ void PrintHeaderService(google::protobuf::io::Printer *printer,
(*vars)["Service"] = service->name(); (*vars)["Service"] = service->name();
printer->Print(*vars, printer->Print(*vars,
"class $Service$ final {\n" "class $Service$ GRPC_FINAL {\n"
" public:\n"); " public:\n");
printer->Indent(); printer->Indent();
// Client side // Client side
printer->Print( printer->Print(
"class Stub final : public ::grpc::InternalStub {\n" "class Stub GRPC_FINAL : public ::grpc::InternalStub {\n"
" public:\n"); " public:\n");
printer->Indent(); printer->Indent();
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
@ -331,7 +331,7 @@ void PrintHeaderService(google::protobuf::io::Printer *printer,
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderServerMethodSync(printer, service->method(i), vars); PrintHeaderServerMethodSync(printer, service->method(i), vars);
} }
printer->Print("::grpc::RpcService* service() override final;\n"); printer->Print("::grpc::RpcService* service() GRPC_OVERRIDE GRPC_FINAL;\n");
printer->Outdent(); printer->Outdent();
printer->Print( printer->Print(
" private:\n" " private:\n"
@ -340,7 +340,7 @@ void PrintHeaderService(google::protobuf::io::Printer *printer,
// Server side - Asynchronous // Server side - Asynchronous
printer->Print( printer->Print(
"class AsyncService final : public ::grpc::AsynchronousService {\n" "class AsyncService GRPC_FINAL : public ::grpc::AsynchronousService {\n"
" public:\n"); " public:\n");
printer->Indent(); printer->Indent();
(*vars)["MethodCount"] = as_string(service->method_count()); (*vars)["MethodCount"] = as_string(service->method_count());

@ -232,7 +232,8 @@ bool GetModuleAndMessagePath(const Descriptor* type,
path_iter != message_path.rend(); ++path_iter) { path_iter != message_path.rend(); ++path_iter) {
message_type += (*path_iter)->name() + "."; message_type += (*path_iter)->name() + ".";
} }
message_type.pop_back(); // no pop_back prior to C++11
message_type.resize(message_type.size() - 1);
*out = make_pair(module, message_type); *out = make_pair(module, message_type);
return true; return true;
} }

@ -56,12 +56,10 @@ using std::strlen;
class PythonGrpcGenerator : public CodeGenerator { class PythonGrpcGenerator : public CodeGenerator {
public: public:
PythonGrpcGenerator() {} PythonGrpcGenerator() {}
~PythonGrpcGenerator() override {} ~PythonGrpcGenerator() {}
bool Generate(const FileDescriptor* file, bool Generate(const FileDescriptor* file, const string& parameter,
const string& parameter, GeneratorContext* context, string* error) const {
GeneratorContext* context,
string* error) const override {
// Get output file name. // Get output file name.
string file_name; string file_name;
static const int proto_suffix_length = strlen(".proto"); static const int proto_suffix_length = strlen(".proto");

@ -50,12 +50,12 @@
class RubyGrpcGenerator : public google::protobuf::compiler::CodeGenerator { class RubyGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
public: public:
RubyGrpcGenerator() {} RubyGrpcGenerator() {}
~RubyGrpcGenerator() override {} ~RubyGrpcGenerator() {}
bool Generate(const google::protobuf::FileDescriptor *file, bool Generate(const google::protobuf::FileDescriptor *file,
const std::string &parameter, const std::string &parameter,
google::protobuf::compiler::GeneratorContext *context, google::protobuf::compiler::GeneratorContext *context,
std::string *error) const override { std::string *error) const {
std::string code = grpc_ruby_generator::GetServices(file); std::string code = grpc_ruby_generator::GetServices(file);
if (code.size() == 0) { if (code.size() == 0) {
return true; // don't generate a file if there are no services return true; // don't generate a file if there are no services

@ -49,17 +49,17 @@ class CompletionQueue;
class Credentials; class Credentials;
class StreamContextInterface; class StreamContextInterface;
class Channel final : public ChannelInterface { class Channel GRPC_FINAL : public ChannelInterface {
public: public:
Channel(const grpc::string &target, const ChannelArguments &args); Channel(const grpc::string &target, const ChannelArguments &args);
Channel(const grpc::string &target, const std::unique_ptr<Credentials> &creds, Channel(const grpc::string &target, const std::unique_ptr<Credentials> &creds,
const ChannelArguments &args); const ChannelArguments &args);
~Channel() override; ~Channel() GRPC_OVERRIDE;
virtual Call CreateCall(const RpcMethod &method, ClientContext *context, virtual Call CreateCall(const RpcMethod &method, ClientContext *context,
CompletionQueue *cq) override; CompletionQueue *cq) GRPC_OVERRIDE;
virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) override; virtual void PerformOpsOnCall(CallOpBuffer *ops, Call *call) GRPC_OVERRIDE;
private: private:
const grpc::string target_; const grpc::string target_;

@ -41,7 +41,10 @@ using std::chrono::system_clock;
namespace grpc { namespace grpc {
ClientContext::ClientContext() ClientContext::ClientContext()
: call_(nullptr), cq_(nullptr), absolute_deadline_(gpr_inf_future) {} : initial_metadata_received_(false),
call_(nullptr),
cq_(nullptr),
absolute_deadline_(gpr_inf_future) {}
ClientContext::~ClientContext() { ClientContext::~ClientContext() {
if (call_) { if (call_) {

@ -41,6 +41,30 @@
namespace grpc { namespace grpc {
CallOpBuffer::CallOpBuffer()
: return_tag_(this),
send_initial_metadata_(false),
initial_metadata_count_(0),
initial_metadata_(nullptr),
recv_initial_metadata_(nullptr),
recv_initial_metadata_arr_{0, 0, nullptr},
send_message_(nullptr),
send_message_buf_(nullptr),
recv_message_(nullptr),
recv_message_buf_(nullptr),
client_send_close_(false),
recv_trailing_metadata_(nullptr),
recv_status_(nullptr),
recv_trailing_metadata_arr_{0, 0, nullptr},
status_code_(GRPC_STATUS_OK),
status_details_(nullptr),
status_details_capacity_(0),
send_status_(nullptr),
trailing_metadata_count_(0),
trailing_metadata_(nullptr),
cancelled_buf_(0),
recv_closed_(nullptr) {}
void CallOpBuffer::Reset(void* next_return_tag) { void CallOpBuffer::Reset(void* next_return_tag) {
return_tag_ = next_return_tag; return_tag_ = next_return_tag;

@ -49,11 +49,12 @@
namespace grpc { namespace grpc {
class Server::SyncRequest final : public CompletionQueueTag { class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag {
public: public:
SyncRequest(RpcServiceMethod* method, void* tag) SyncRequest(RpcServiceMethod* method, void* tag)
: method_(method), : method_(method),
tag_(tag), tag_(tag),
in_flight_(false),
has_request_payload_(method->method_type() == RpcMethod::NORMAL_RPC || has_request_payload_(method->method_type() == RpcMethod::NORMAL_RPC ||
method->method_type() == method->method_type() ==
RpcMethod::SERVER_STREAMING), RpcMethod::SERVER_STREAMING),
@ -85,14 +86,14 @@ class Server::SyncRequest final : public CompletionQueueTag {
this)); this));
} }
bool FinalizeResult(void** tag, bool* status) override { bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
if (!*status) { if (!*status) {
grpc_completion_queue_destroy(cq_); grpc_completion_queue_destroy(cq_);
} }
return true; return true;
} }
class CallData final { class CallData GRPC_FINAL {
public: public:
explicit CallData(Server* server, SyncRequest* mrd) explicit CallData(Server* server, SyncRequest* mrd)
: cq_(mrd->cq_), : cq_(mrd->cq_),
@ -159,7 +160,7 @@ class Server::SyncRequest final : public CompletionQueueTag {
private: private:
RpcServiceMethod* const method_; RpcServiceMethod* const method_;
void* const tag_; void* const tag_;
bool in_flight_ = false; bool in_flight_;
const bool has_request_payload_; const bool has_request_payload_;
const bool has_response_payload_; const bool has_response_payload_;
grpc_call* call_; grpc_call* call_;
@ -294,7 +295,7 @@ void Server::PerformOpsOnCall(CallOpBuffer* buf, Call* call) {
grpc_call_start_batch(call->call(), ops, nops, buf)); grpc_call_start_batch(call->call(), ops, nops, buf));
} }
class Server::AsyncRequest final : public CompletionQueueTag { class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
public: public:
AsyncRequest(Server* server, void* registered_method, ServerContext* ctx, AsyncRequest(Server* server, void* registered_method, ServerContext* ctx,
::google::protobuf::Message* request, ::google::protobuf::Message* request,
@ -305,7 +306,9 @@ class Server::AsyncRequest final : public CompletionQueueTag {
stream_(stream), stream_(stream),
cq_(cq), cq_(cq),
ctx_(ctx), ctx_(ctx),
server_(server) { server_(server),
call_(nullptr),
payload_(nullptr) {
memset(&array_, 0, sizeof(array_)); memset(&array_, 0, sizeof(array_));
grpc_server_request_registered_call( grpc_server_request_registered_call(
server->server_, registered_method, &call_, &deadline_, &array_, server->server_, registered_method, &call_, &deadline_, &array_,
@ -319,7 +322,7 @@ class Server::AsyncRequest final : public CompletionQueueTag {
grpc_metadata_array_destroy(&array_); grpc_metadata_array_destroy(&array_);
} }
bool FinalizeResult(void** tag, bool* status) override { bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
*tag = tag_; *tag = tag_;
if (*status && request_) { if (*status && request_) {
if (payload_) { if (payload_) {
@ -354,10 +357,10 @@ class Server::AsyncRequest final : public CompletionQueueTag {
CompletionQueue* const cq_; CompletionQueue* const cq_;
ServerContext* const ctx_; ServerContext* const ctx_;
Server* const server_; Server* const server_;
grpc_call* call_ = nullptr; grpc_call* call_;
gpr_timespec deadline_; gpr_timespec deadline_;
grpc_metadata_array array_; grpc_metadata_array array_;
grpc_byte_buffer* payload_ = nullptr; grpc_byte_buffer* payload_;
}; };
void Server::RequestAsyncCall(void* registered_method, ServerContext* context, void Server::RequestAsyncCall(void* registered_method, ServerContext* context,

@ -41,7 +41,7 @@
namespace grpc { namespace grpc {
ServerBuilder::ServerBuilder() {} ServerBuilder::ServerBuilder() : thread_pool_(nullptr) {}
void ServerBuilder::RegisterService(SynchronousService* service) { void ServerBuilder::RegisterService(SynchronousService* service) {
services_.push_back(service->service()); services_.push_back(service->service());

@ -44,10 +44,13 @@ namespace grpc {
// CompletionOp // CompletionOp
class ServerContext::CompletionOp final : public CallOpBuffer { class ServerContext::CompletionOp GRPC_FINAL : public CallOpBuffer {
public: public:
CompletionOp(); // initial refs: one in the server context, one in the cq
bool FinalizeResult(void** tag, bool* status) override; CompletionOp() : refs_(2), finalized_(false), cancelled_(false) {
AddServerRecvClose(&cancelled_);
}
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE;
bool CheckCancelled(CompletionQueue* cq); bool CheckCancelled(CompletionQueue* cq);
@ -55,13 +58,11 @@ class ServerContext::CompletionOp final : public CallOpBuffer {
private: private:
std::mutex mu_; std::mutex mu_;
int refs_ = 2; // initial refs: one in the server context, one in the cq int refs_;
bool finalized_ = false; bool finalized_;
bool cancelled_ = false; bool cancelled_;
}; };
ServerContext::CompletionOp::CompletionOp() { AddServerRecvClose(&cancelled_); }
void ServerContext::CompletionOp::Unref() { void ServerContext::CompletionOp::Unref() {
std::unique_lock<std::mutex> lock(mu_); std::unique_lock<std::mutex> lock(mu_);
if (--refs_ == 0) { if (--refs_ == 0) {
@ -90,11 +91,19 @@ bool ServerContext::CompletionOp::FinalizeResult(void** tag, bool* status) {
// ServerContext body // ServerContext body
ServerContext::ServerContext() {} ServerContext::ServerContext()
: completion_op_(nullptr),
call_(nullptr),
cq_(nullptr),
sent_initial_metadata_(false) {}
ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata, ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata* metadata,
size_t metadata_count) size_t metadata_count)
: deadline_(Timespec2Timepoint(deadline)) { : completion_op_(nullptr),
deadline_(Timespec2Timepoint(deadline)),
call_(nullptr),
cq_(nullptr),
sent_initial_metadata_(false) {
for (size_t i = 0; i < metadata_count; i++) { for (size_t i = 0; i < metadata_count; i++) {
client_metadata_.insert(std::make_pair( client_metadata_.insert(std::make_pair(
grpc::string(metadata[i].key), grpc::string(metadata[i].key),

@ -35,7 +35,7 @@
namespace grpc { namespace grpc {
ThreadPool::ThreadPool(int num_threads) { ThreadPool::ThreadPool(int num_threads) : shutdown_(false) {
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
threads_.push_back(std::thread([this]() { threads_.push_back(std::thread([this]() {
for (;;) { for (;;) {

@ -34,6 +34,7 @@
#ifndef __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__ #ifndef __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__
#define __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__ #define __GRPCPP_INTERNAL_SERVER_THREAD_POOL_H__
#include <grpc++/config.h>
#include <grpc++/thread_pool_interface.h> #include <grpc++/thread_pool_interface.h>
#include <condition_variable> #include <condition_variable>
@ -44,17 +45,17 @@
namespace grpc { namespace grpc {
class ThreadPool final : public ThreadPoolInterface { class ThreadPool GRPC_FINAL : public ThreadPoolInterface {
public: public:
explicit ThreadPool(int num_threads); explicit ThreadPool(int num_threads);
~ThreadPool(); ~ThreadPool();
void ScheduleCallback(const std::function<void()> &callback) override; void ScheduleCallback(const std::function<void()> &callback) GRPC_OVERRIDE;
private: private:
std::mutex mu_; std::mutex mu_;
std::condition_variable cv_; std::condition_variable cv_;
bool shutdown_ = false; bool shutdown_;
std::queue<std::function<void()>> callbacks_; std::queue<std::function<void()>> callbacks_;
std::vector<std::thread> threads_; std::vector<std::thread> threads_;
}; };

@ -10,7 +10,7 @@
"<!(node -e \"require('nan')\")" "<!(node -e \"require('nan')\")"
], ],
'cflags': [ 'cflags': [
'-std=c++11', '-std=c++0x',
'-Wall', '-Wall',
'-pthread', '-pthread',
'-pedantic', '-pedantic',

@ -169,6 +169,10 @@ $(error Invalid CONFIG value '$(CONFIG)')
endif endif
# Detect if we can use C++11
CXX11_CHECK_CMD = $(CXX) -std=c++11 -o /dev/null -c test/build/c++11.cc
HAS_CXX11 = $(shell $(CXX11_CHECK_CMD) 2> /dev/null && echo true || echo false)
# The HOST compiler settings are used to compile the protoc plugins. # The HOST compiler settings are used to compile the protoc plugins.
# In most cases, you won't have to change anything, but if you are # In most cases, you won't have to change anything, but if you are
# cross-compiling, you can override these variables from GNU make's # cross-compiling, you can override these variables from GNU make's
@ -184,7 +188,12 @@ DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
LDFLAGS += $(LDFLAGS_$(CONFIG)) LDFLAGS += $(LDFLAGS_$(CONFIG))
CFLAGS += -std=c89 -pedantic CFLAGS += -std=c89 -pedantic
ifeq ($(HAS_CXX11),true)
CXXFLAGS += -std=c++11 CXXFLAGS += -std=c++11
else
CXXFLAGS += -std=c++0x
DEFINES += GRPC_OLD_CXX
endif
CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter CPPFLAGS += -g -fPIC -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter
LDFLAGS += -g -fPIC LDFLAGS += -g -fPIC
@ -495,7 +504,11 @@ third_party/protobuf/configure:
$(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure $(LIBDIR)/$(CONFIG)/protobuf/libprotobuf.a: third_party/protobuf/configure
$(E) "[MAKE] Building protobuf" $(E) "[MAKE] Building protobuf"
ifeq ($(HAVE_CXX11),true)
$(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static) $(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-DLANG_CXX11 -std=c++11" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
else
$(Q)(cd third_party/protobuf ; CC="$(CC)" CXX="$(CXX)" LDFLAGS="$(LDFLAGS_$(CONFIG)) -g" CXXFLAGS="-std=c++0x" CPPFLAGS="-fPIC $(CPPFLAGS_$(CONFIG)) -g" ./configure --disable-shared --enable-static)
endif
$(Q)$(MAKE) -C third_party/protobuf clean $(Q)$(MAKE) -C third_party/protobuf clean
$(Q)$(MAKE) -C third_party/protobuf $(Q)$(MAKE) -C third_party/protobuf
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/protobuf
@ -1095,11 +1108,11 @@ else
## That simplifies the codegen a bit, but prevents a fully defined Makefile. ## That simplifies the codegen a bit, but prevents a fully defined Makefile.
## I can live with that. ## I can live with that.
## ##
% if tgt.build == 'protoc': % if tgt.build == 'protoc' or tgt.language == 'c++':
ifeq ($(NO_PROTOBUF),true) ifeq ($(NO_PROTOBUF),true)
# You can't build the protoc plugins if you don't have protobuf 3.0.0+. # You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.
$(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error
@ -1154,7 +1167,7 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
$(LDLIBS_SECURE)\ $(LDLIBS_SECURE)\
% endif % endif
-o $(BINDIR)/$(CONFIG)/${tgt.name} -o $(BINDIR)/$(CONFIG)/${tgt.name}
% if tgt.build == 'protoc': % if tgt.build == 'protoc' or tgt.language == 'c++':
endif endif
% endif % endif

@ -0,0 +1,52 @@
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* This is just a compilation test, to see if we have zlib installed. */
#include <stdlib.h>
#include <zlib.h>
class Base {
public:
virtual void foo() = 0;
};
class Foo final : public Base {
public:
void foo() override {}
};
int main() {
Foo().foo();
return 0;
}

@ -113,15 +113,22 @@ int grpc_pick_unused_port(void) {
/* Type of port to first pick in next iteration */ /* Type of port to first pick in next iteration */
int is_tcp = 1; int is_tcp = 1;
int try int try = 0;
= 0;
for (;;) { for (;;) {
int port = try int port;
< NUM_RANDOM_PORTS_TO_PICK ? rand() % (65536 - 30000) + 30000 : 0; if (try == 0) {
port = getpid() % (65536 - 30000) + 30000;
} else if (try < NUM_RANDOM_PORTS_TO_PICK) {
port = rand() % (65536 - 30000) + 30000;
} else {
port = 0;
}
if (!is_port_available(&port, is_tcp)) { if (!is_port_available(&port, is_tcp)) {
continue; continue;
} }
GPR_ASSERT(port > 0); GPR_ASSERT(port > 0);
/* Check that the port # is free for the other type of socket also */ /* Check that the port # is free for the other type of socket also */
if (!is_port_available(&port, !is_tcp)) { if (!is_port_available(&port, !is_tcp)) {

@ -81,7 +81,7 @@ class AsyncEnd2endTest : public ::testing::Test {
protected: protected:
AsyncEnd2endTest() : service_(&srv_cq_) {} AsyncEnd2endTest() : service_(&srv_cq_) {}
void SetUp() override { void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port; server_address_ << "localhost:" << port;
// Setup server // Setup server
@ -91,7 +91,7 @@ class AsyncEnd2endTest : public ::testing::Test {
server_ = builder.BuildAndStart(); server_ = builder.BuildAndStart();
} }
void TearDown() override { void TearDown() GRPC_OVERRIDE {
server_->Shutdown(); server_->Shutdown();
void* ignored_tag; void* ignored_tag;
bool ignored_ok; bool ignored_ok;

@ -83,7 +83,7 @@ void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request,
class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
public: public:
Status Echo(ServerContext* context, const EchoRequest* request, Status Echo(ServerContext* context, const EchoRequest* request,
EchoResponse* response) override { EchoResponse* response) GRPC_OVERRIDE {
response->set_message(request->message()); response->set_message(request->message());
MaybeEchoDeadline(context, request, response); MaybeEchoDeadline(context, request, response);
return Status::OK; return Status::OK;
@ -93,7 +93,7 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
Status RequestStream(ServerContext* context, Status RequestStream(ServerContext* context,
ServerReader<EchoRequest>* reader, ServerReader<EchoRequest>* reader,
EchoResponse* response) override { EchoResponse* response) GRPC_OVERRIDE {
EchoRequest request; EchoRequest request;
response->set_message(""); response->set_message("");
while (reader->Read(&request)) { while (reader->Read(&request)) {
@ -105,7 +105,7 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
// Return 3 messages. // Return 3 messages.
// TODO(yangg) make it generic by adding a parameter into EchoRequest // TODO(yangg) make it generic by adding a parameter into EchoRequest
Status ResponseStream(ServerContext* context, const EchoRequest* request, Status ResponseStream(ServerContext* context, const EchoRequest* request,
ServerWriter<EchoResponse>* writer) override { ServerWriter<EchoResponse>* writer) GRPC_OVERRIDE {
EchoResponse response; EchoResponse response;
response.set_message(request->message() + "0"); response.set_message(request->message() + "0");
writer->Write(response); writer->Write(response);
@ -117,9 +117,9 @@ class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service {
return Status::OK; return Status::OK;
} }
Status BidiStream( Status BidiStream(ServerContext* context,
ServerContext* context, ServerReaderWriter<EchoResponse, EchoRequest>* stream)
ServerReaderWriter<EchoResponse, EchoRequest>* stream) override { GRPC_OVERRIDE {
EchoRequest request; EchoRequest request;
EchoResponse response; EchoResponse response;
while (stream->Read(&request)) { while (stream->Read(&request)) {
@ -135,7 +135,7 @@ class TestServiceImplDupPkg
: public ::grpc::cpp::test::util::duplicate::TestService::Service { : public ::grpc::cpp::test::util::duplicate::TestService::Service {
public: public:
Status Echo(ServerContext* context, const EchoRequest* request, Status Echo(ServerContext* context, const EchoRequest* request,
EchoResponse* response) override { EchoResponse* response) GRPC_OVERRIDE {
response->set_message("no package"); response->set_message("no package");
return Status::OK; return Status::OK;
} }
@ -145,7 +145,7 @@ class End2endTest : public ::testing::Test {
protected: protected:
End2endTest() : thread_pool_(2) {} End2endTest() : thread_pool_(2) {}
void SetUp() override { void SetUp() GRPC_OVERRIDE {
int port = grpc_pick_unused_port_or_die(); int port = grpc_pick_unused_port_or_die();
server_address_ << "localhost:" << port; server_address_ << "localhost:" << port;
// Setup server // Setup server
@ -157,7 +157,7 @@ class End2endTest : public ::testing::Test {
server_ = builder.BuildAndStart(); server_ = builder.BuildAndStart();
} }
void TearDown() override { server_->Shutdown(); } void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() { void ResetStub() {
std::shared_ptr<ChannelInterface> channel = std::shared_ptr<ChannelInterface> channel =

@ -38,6 +38,8 @@
#include <string> #include <string>
#include <thread> #include <thread>
#include <unistd.h>
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include <gflags/gflags.h> #include <gflags/gflags.h>
@ -313,8 +315,7 @@ void DoResponseStreamingWithSlowConsumer() {
GPR_ASSERT(response.payload().body() == GPR_ASSERT(response.payload().body() ==
grpc::string(kResponseMessageSize, '\0')); grpc::string(kResponseMessageSize, '\0'));
gpr_log(GPR_INFO, "received message %d", i); gpr_log(GPR_INFO, "received message %d", i);
std::this_thread::sleep_for( usleep(kReceiveDelayMilliSeconds * 1000);
std::chrono::milliseconds(kReceiveDelayMilliSeconds));
++i; ++i;
} }
GPR_ASSERT(kNumResponseMessages == i); GPR_ASSERT(kNumResponseMessages == i);

@ -36,6 +36,7 @@
#include <thread> #include <thread>
#include <signal.h> #include <signal.h>
#include <unistd.h>
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <grpc/grpc.h> #include <grpc/grpc.h>
@ -222,7 +223,7 @@ void RunServer() {
std::unique_ptr<Server> server(builder.BuildAndStart()); std::unique_ptr<Server> server(builder.BuildAndStart());
gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str()); gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str());
while (!got_sigint) { while (!got_sigint) {
std::this_thread::sleep_for(std::chrono::seconds(5)); sleep(5);
} }
} }

@ -36,6 +36,8 @@
#include <sys/signal.h> #include <sys/signal.h>
#include <thread> #include <thread>
#include <unistd.h>
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/host_port.h> #include <grpc/support/host_port.h>
@ -97,7 +99,7 @@ static bool SetPayload(PayloadType type, int size, Payload* payload) {
namespace { namespace {
class TestServiceImpl final : public TestService::Service { class TestServiceImpl GRPC_FINAL : public TestService::Service {
public: public:
Status CollectServerStats(ServerContext* context, const StatsRequest*, Status CollectServerStats(ServerContext* context, const StatsRequest*,
ServerStats* response) { ServerStats* response) {
@ -146,7 +148,7 @@ static void RunServer() {
grpc_profiler_start("qps_server.prof"); grpc_profiler_start("qps_server.prof");
while (!got_sigint) { while (!got_sigint) {
std::this_thread::sleep_for(std::chrono::seconds(5)); sleep(5);
} }
grpc_profiler_stop(); grpc_profiler_stop();

@ -37,7 +37,6 @@ make -j6
root=`pwd` root=`pwd`
virtualenv python2.7_virtual_environment virtualenv python2.7_virtual_environment
ln -sf $root/include/grpc python2.7_virtual_environment/include/grpc
source python2.7_virtual_environment/bin/activate source python2.7_virtual_environment/bin/activate
pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1 pip install enum34==1.0.4 futures==2.2.0 protobuf==3.0.0-alpha-1
CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src CFLAGS=-I$root/include LDFLAGS=-L$root/libs/opt pip install src/python/src

Loading…
Cancel
Save