Move ProtoServerReflectionPlugin from grpc to grpc_impl namespace

pull/18600/head
Karthik Ravi Shankar 6 years ago
parent a10d4825c1
commit 8e092b45fa
  1. 1
      BUILD
  2. 1
      CMakeLists.txt
  3. 1
      Makefile
  4. 1
      build.yaml
  5. 31
      include/grpcpp/ext/proto_server_reflection_plugin.h
  6. 54
      include/grpcpp/ext/proto_server_reflection_plugin_impl.h
  7. 4
      src/cpp/ext/proto_server_reflection_plugin.cc
  8. 2
      tools/run_tests/generated/sources_and_headers.json

@ -2203,6 +2203,7 @@ grpc_cc_library(
public_hdrs = [
"include/grpc++/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin_impl.h",
],
deps = [
":grpc++",

@ -3962,6 +3962,7 @@ target_link_libraries(grpc++_reflection
foreach(_hdr
include/grpc++/ext/proto_server_reflection_plugin.h
include/grpcpp/ext/proto_server_reflection_plugin.h
include/grpcpp/ext/proto_server_reflection_plugin_impl.h
)
string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH)

@ -6296,6 +6296,7 @@ LIBGRPC++_REFLECTION_SRC = \
PUBLIC_HEADERS_CXX += \
include/grpc++/ext/proto_server_reflection_plugin.h \
include/grpcpp/ext/proto_server_reflection_plugin.h \
include/grpcpp/ext/proto_server_reflection_plugin_impl.h \
LIBGRPC++_REFLECTION_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_REFLECTION_SRC))))

@ -1741,6 +1741,7 @@ libs:
public_headers:
- include/grpc++/ext/proto_server_reflection_plugin.h
- include/grpcpp/ext/proto_server_reflection_plugin.h
- include/grpcpp/ext/proto_server_reflection_plugin_impl.h
headers:
- src/cpp/ext/proto_server_reflection.h
src:

@ -1,6 +1,6 @@
/*
*
* Copyright 2015 gRPC authors.
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,34 +19,17 @@
#ifndef GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
#define GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/support/config.h>
namespace grpc {
class ServerInitializer;
class ProtoServerReflection;
} // namespace grpc
#include <grpcpp/ext/proto_server_reflection_plugin_impl.h>
namespace grpc {
namespace reflection {
class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
public:
ProtoServerReflectionPlugin();
::grpc::string name() override;
void InitServer(::grpc::ServerInitializer* si) override;
void Finish(::grpc::ServerInitializer* si) override;
void ChangeArguments(const ::grpc::string& name, void* value) override;
bool has_async_methods() const override;
bool has_sync_methods() const override;
private:
std::shared_ptr<grpc::ProtoServerReflection> reflection_service_;
};
typedef ::grpc_impl::reflection::ProtoServerReflectionPlugin
ProtoServerReflectionPlugin;
/// Add proto reflection plugin to \a ServerBuilder.
/// This function should be called at the static initialization time.
void InitProtoReflectionServerBuilderPlugin();
static inline void InitProtoReflectionServerBuilderPlugin() {
::grpc_impl::reflection::InitProtoReflectionServerBuilderPlugin();
}
} // namespace reflection
} // namespace grpc

@ -0,0 +1,54 @@
/*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_IMPL_H
#define GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_IMPL_H
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/support/config.h>
namespace grpc {
class ServerInitializer;
class ProtoServerReflection;
} // namespace grpc
namespace grpc_impl {
namespace reflection {
class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
public:
ProtoServerReflectionPlugin();
::grpc::string name() override;
void InitServer(::grpc::ServerInitializer* si) override;
void Finish(::grpc::ServerInitializer* si) override;
void ChangeArguments(const ::grpc::string& name, void* value) override;
bool has_async_methods() const override;
bool has_sync_methods() const override;
private:
std::shared_ptr<grpc::ProtoServerReflection> reflection_service_;
};
/// Add proto reflection plugin to \a ServerBuilder.
/// This function should be called at the static initialization time.
void InitProtoReflectionServerBuilderPlugin();
} // namespace reflection
} // namespace grpc_impl
#endif // GRPCPP_EXT_PROTO_SERVER_REFLECTION_PLUGIN_IMPL_H

@ -23,7 +23,7 @@
#include "src/cpp/ext/proto_server_reflection.h"
namespace grpc {
namespace grpc_impl {
namespace reflection {
ProtoServerReflectionPlugin::ProtoServerReflectionPlugin()
@ -79,4 +79,4 @@ struct StaticProtoReflectionPluginInitializer {
} static_proto_reflection_plugin_initializer;
} // namespace reflection
} // namespace grpc
} // namespace grpc_impl

@ -6629,6 +6629,7 @@
"headers": [
"include/grpc++/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin_impl.h",
"src/cpp/ext/proto_server_reflection.h"
],
"is_filegroup": false,
@ -6637,6 +6638,7 @@
"src": [
"include/grpc++/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin.h",
"include/grpcpp/ext/proto_server_reflection_plugin_impl.h",
"src/cpp/ext/proto_server_reflection.cc",
"src/cpp/ext/proto_server_reflection.h",
"src/cpp/ext/proto_server_reflection_plugin.cc"

Loading…
Cancel
Save