Merge pull request #23471 from karthikravis/proto-server

Move ProtoServerReflectionPlugin from grpc_impl to grpc namespace
pull/23344/head
Karthik Ravi Shankar 5 years ago committed by GitHub
commit 3253bb32e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 1
      CMakeLists.txt
  3. 1
      Makefile
  4. 32
      include/grpcpp/ext/proto_server_reflection_plugin.h
  5. 55
      include/grpcpp/ext/proto_server_reflection_plugin_impl.h
  6. 4
      src/cpp/ext/proto_server_reflection_plugin.cc

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

@ -3139,7 +3139,6 @@ target_link_libraries(grpc++_reflection
foreach(_hdr foreach(_hdr
include/grpc++/ext/proto_server_reflection_plugin.h include/grpc++/ext/proto_server_reflection_plugin.h
include/grpcpp/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}) string(REPLACE "include/" "" _path ${_hdr})
get_filename_component(_path ${_path} PATH) get_filename_component(_path ${_path} PATH)

@ -5097,7 +5097,6 @@ LIBGRPC++_REFLECTION_SRC = \
PUBLIC_HEADERS_CXX += \ PUBLIC_HEADERS_CXX += \
include/grpc++/ext/proto_server_reflection_plugin.h \ include/grpc++/ext/proto_server_reflection_plugin.h \
include/grpcpp/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)))) LIBGRPC++_REFLECTION_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGRPC++_REFLECTION_SRC))))

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

@ -1,55 +0,0 @@
/*
*
* 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 ProtoServerReflection;
} // namespace grpc
namespace grpc_impl {
class ServerInitializer;
namespace reflection {
class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin {
public:
ProtoServerReflectionPlugin();
::std::string name() override;
void InitServer(::grpc_impl::ServerInitializer* si) override;
void Finish(::grpc_impl::ServerInitializer* si) override;
void ChangeArguments(const ::std::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" #include "src/cpp/ext/proto_server_reflection.h"
namespace grpc_impl { namespace grpc {
namespace reflection { namespace reflection {
ProtoServerReflectionPlugin::ProtoServerReflectionPlugin() ProtoServerReflectionPlugin::ProtoServerReflectionPlugin()
@ -80,4 +80,4 @@ struct StaticProtoReflectionPluginInitializer {
} static_proto_reflection_plugin_initializer; } static_proto_reflection_plugin_initializer;
} // namespace reflection } // namespace reflection
} // namespace grpc_impl } // namespace grpc

Loading…
Cancel
Save