Add StubOptions

pull/2781/head
yang-g 10 years ago
parent 9dc45f9192
commit 297a25b0cf
  1. 2
      BUILD
  2. 2
      Makefile
  3. 1
      build.json
  4. 43
      include/grpc++/stub_options.h
  5. 8
      src/compiler/cpp_generator.cc
  6. 1
      tools/doxygen/Doxyfile.c++
  7. 1
      tools/doxygen/Doxyfile.c++.internal
  8. 4
      tools/run_tests/sources_and_headers.json
  9. 1
      vsprojects/grpc++/grpc++.vcxproj
  10. 3
      vsprojects/grpc++/grpc++.vcxproj.filters
  11. 1
      vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj
  12. 3
      vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters

@ -725,6 +725,7 @@ cc_library(
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
],
@ -812,6 +813,7 @@ cc_library(
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
],

@ -4223,6 +4223,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/status.h \
include/grpc++/status_code_enum.h \
include/grpc++/stream.h \
include/grpc++/stub_options.h \
include/grpc++/thread_pool_interface.h \
include/grpc++/time.h \
@ -4466,6 +4467,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc++/status.h \
include/grpc++/status_code_enum.h \
include/grpc++/stream.h \
include/grpc++/stub_options.h \
include/grpc++/thread_pool_interface.h \
include/grpc++/time.h \

@ -69,6 +69,7 @@
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h"
],

@ -0,0 +1,43 @@
/*
*
* 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.
*
*/
#ifndef GRPCXX_STUB_OPTIONS_H
#define GRPCXX_STUB_OPTIONS_H
namespace grpc {
class StubOptions {};
} // namespace grpc
#endif // GRPCXX_STUB_OPTIONS_H

@ -119,6 +119,7 @@ grpc::string GetHeaderIncludes(const grpc::protobuf::FileDescriptor *file,
"#include <grpc++/async_unary_call.h>\n"
"#include <grpc++/status.h>\n"
"#include <grpc++/stream.h>\n"
"#include <grpc++/stub_options.h>\n"
"\n"
"namespace grpc {\n"
"class CompletionQueue;\n"
@ -574,8 +575,8 @@ void PrintHeaderService(grpc::protobuf::io::Printer *printer,
printer->Print("};\n");
printer->Print(
"static std::unique_ptr<Stub> NewStub(const std::shared_ptr< "
"::grpc::ChannelInterface>& "
"channel);\n");
"::grpc::ChannelInterface>& channel, "
"const ::grpc::StubOptions& options = ::grpc::StubOptions());\n");
printer->Print("\n");
@ -966,7 +967,8 @@ void PrintSourceService(grpc::protobuf::io::Printer *printer,
printer->Print(
*vars,
"std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
"const std::shared_ptr< ::grpc::ChannelInterface>& channel) {\n"
"const std::shared_ptr< ::grpc::ChannelInterface>& channel, "
"const ::grpc::StubOptions& options) {\n"
" std::unique_ptr< $ns$$Service$::Stub> stub(new "
"$ns$$Service$::Stub(channel));\n"
" return stub;\n"

@ -799,6 +799,7 @@ include/grpc++/slice.h \
include/grpc++/status.h \
include/grpc++/status_code_enum.h \
include/grpc++/stream.h \
include/grpc++/stub_options.h \
include/grpc++/thread_pool_interface.h \
include/grpc++/time.h

@ -799,6 +799,7 @@ include/grpc++/slice.h \
include/grpc++/status.h \
include/grpc++/status_code_enum.h \
include/grpc++/stream.h \
include/grpc++/stub_options.h \
include/grpc++/thread_pool_interface.h \
include/grpc++/time.h \
src/cpp/client/secure_credentials.h \

@ -11766,6 +11766,7 @@
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
"src/cpp/client/channel.h",
@ -11816,6 +11817,7 @@
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
"src/cpp/client/channel.cc",
@ -11940,6 +11942,7 @@
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
"src/cpp/client/channel.h",
@ -11987,6 +11990,7 @@
"include/grpc++/status.h",
"include/grpc++/status_code_enum.h",
"include/grpc++/stream.h",
"include/grpc++/stub_options.h",
"include/grpc++/thread_pool_interface.h",
"include/grpc++/time.h",
"src/cpp/client/channel.cc",

@ -252,6 +252,7 @@
<ClInclude Include="..\..\include\grpc++\status.h" />
<ClInclude Include="..\..\include\grpc++\status_code_enum.h" />
<ClInclude Include="..\..\include\grpc++\stream.h" />
<ClInclude Include="..\..\include\grpc++\stub_options.h" />
<ClInclude Include="..\..\include\grpc++\thread_pool_interface.h" />
<ClInclude Include="..\..\include\grpc++\time.h" />
</ItemGroup>

@ -213,6 +213,9 @@
<ClInclude Include="..\..\include\grpc++\stream.h">
<Filter>include\grpc++</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\stub_options.h">
<Filter>include\grpc++</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\thread_pool_interface.h">
<Filter>include\grpc++</Filter>
</ClInclude>

@ -252,6 +252,7 @@
<ClInclude Include="..\..\include\grpc++\status.h" />
<ClInclude Include="..\..\include\grpc++\status_code_enum.h" />
<ClInclude Include="..\..\include\grpc++\stream.h" />
<ClInclude Include="..\..\include\grpc++\stub_options.h" />
<ClInclude Include="..\..\include\grpc++\thread_pool_interface.h" />
<ClInclude Include="..\..\include\grpc++\time.h" />
</ItemGroup>

@ -198,6 +198,9 @@
<ClInclude Include="..\..\include\grpc++\stream.h">
<Filter>include\grpc++</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\stub_options.h">
<Filter>include\grpc++</Filter>
</ClInclude>
<ClInclude Include="..\..\include\grpc++\thread_pool_interface.h">
<Filter>include\grpc++</Filter>
</ClInclude>

Loading…
Cancel
Save