diff options
author | Karthik Ravi Shankar <karthikrs@google.com> | 2020-07-13 14:57:01 -0700 |
---|---|---|
committer | Karthik Ravi Shankar <karthikrs@google.com> | 2020-07-13 14:57:01 -0700 |
commit | f9fac8a6b7ca7a7c660decf9d29b6c32a6691c3e (patch) | |
tree | 77c1a3cc5b2668e8ca99104934e9b78c9f96ff8a /include/grpcpp/ext/proto_server_reflection_plugin.h | |
parent | 6ff6066dd59aff38fec77a25127427609983b650 (diff) | |
download | grpc-grpc-f9fac8a6b7ca7a7c660decf9d29b6c32a6691c3e.tar.gz |
Move ProtoServerReflectionPlugin from grpc_impl to grpc namespace
Reverts: https://github.com/grpc/grpc/pull/18600
Diffstat (limited to 'include/grpcpp/ext/proto_server_reflection_plugin.h')
-rw-r--r-- | include/grpcpp/ext/proto_server_reflection_plugin.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/include/grpcpp/ext/proto_server_reflection_plugin.h b/include/grpcpp/ext/proto_server_reflection_plugin.h index f6f2202ffb..14b58cdfe0 100644 --- a/include/grpcpp/ext/proto_server_reflection_plugin.h +++ b/include/grpcpp/ext/proto_server_reflection_plugin.h @@ -1,6 +1,6 @@ /* * - * Copyright 2019 gRPC authors. + * 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. @@ -19,17 +19,35 @@ #ifndef 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 { +class ProtoServerReflection; + namespace reflection { -typedef ::grpc_impl::reflection::ProtoServerReflectionPlugin - ProtoServerReflectionPlugin; +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_; +}; -static inline void InitProtoReflectionServerBuilderPlugin() { - ::grpc_impl::reflection::InitProtoReflectionServerBuilderPlugin(); -} +/// Add proto reflection plugin to \a ServerBuilder. +/// This function should be called at the static initialization time. +void InitProtoReflectionServerBuilderPlugin(); } // namespace reflection } // namespace grpc |