Remove `include/grpcpp/impl/codegen/stub_options.h` (#31287)

pull/31133/head^2
Cheng-Yu Chung 2 years ago committed by GitHub
parent 5ec616e6a8
commit f4b25ab837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      include/grpcpp/generic/generic_stub.h
  2. 23
      include/grpcpp/impl/codegen/stub_options.h
  3. 20
      include/grpcpp/support/stub_options.h
  4. 2
      src/compiler/cpp_generator.cc
  5. 2
      test/cpp/codegen/compiler_test_golden

@ -22,13 +22,13 @@
#include <functional>
#include <grpcpp/client_context.h>
#include <grpcpp/impl/codegen/stub_options.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/byte_buffer.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
namespace grpc {

@ -19,26 +19,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
#define GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
// IWYU pragma: private, include <grpcpp/support/stub_options.h>
// IWYU pragma: private
namespace grpc {
/// Useful interface for generated stubs
class StubOptions {
public:
StubOptions() = default;
explicit StubOptions(const char* suffix_for_stats)
: suffix_for_stats_(suffix_for_stats) {}
void set_suffix_for_stats(const char* suffix_for_stats) {
suffix_for_stats_ = suffix_for_stats;
}
const char* suffix_for_stats() const { return suffix_for_stats_; }
private:
const char* suffix_for_stats_ = nullptr;
};
} // namespace grpc
/// TODO(chengyuc): Remove this file after solving compatibility.
#include <grpcpp/support/stub_options.h>
#endif // GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H

@ -19,6 +19,24 @@
#ifndef GRPCPP_SUPPORT_STUB_OPTIONS_H
#define GRPCPP_SUPPORT_STUB_OPTIONS_H
#include <grpcpp/impl/codegen/stub_options.h> // IWYU pragma: export
namespace grpc {
/// Useful interface for generated stubs
class StubOptions {
public:
StubOptions() = default;
explicit StubOptions(const char* suffix_for_stats)
: suffix_for_stats_(suffix_for_stats) {}
void set_suffix_for_stats(const char* suffix_for_stats) {
suffix_for_stats_ = suffix_for_stats;
}
const char* suffix_for_stats() const { return suffix_for_stats_; }
private:
const char* suffix_for_stats_ = nullptr;
};
} // namespace grpc
#endif // GRPCPP_SUPPORT_STUB_OPTIONS_H

@ -152,7 +152,7 @@ std::string GetHeaderIncludes(grpc_generator::File* file,
"grpcpp/server_context.h",
"grpcpp/impl/service_type.h",
"grpcpp/impl/codegen/status.h",
"grpcpp/impl/codegen/stub_options.h",
"grpcpp/support/stub_options.h",
"grpcpp/impl/codegen/sync_stream.h",
};
std::vector<std::string> headers(headers_strs, array_end(headers_strs));

@ -42,7 +42,7 @@
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/impl/codegen/stub_options.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/impl/codegen/sync_stream.h>
namespace grpc {

Loading…
Cancel
Save