Merge pull request #23305 from karthikravis/channel-posix

Move create_channel_posix from ::grpc_impl to ::grpc
pull/23350/head
Karthik Ravi Shankar 5 years ago committed by GitHub
commit 4e86fa660b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 1
      BUILD.gn
  3. 2
      CMakeLists.txt
  4. 2
      Makefile
  5. 2
      build_autogenerated.yaml
  6. 1
      gRPC-C++.podspec
  7. 49
      include/grpcpp/create_channel_posix.h
  8. 70
      include/grpcpp/create_channel_posix_impl.h
  9. 32
      src/cpp/client/create_channel_posix.cc
  10. 1
      tools/doxygen/Doxyfile.c++
  11. 1
      tools/doxygen/Doxyfile.c++.internal

@ -227,7 +227,6 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/create_channel.h",
"include/grpcpp/create_channel_impl.h",
"include/grpcpp/create_channel_posix.h",
"include/grpcpp/create_channel_posix_impl.h",
"include/grpcpp/ext/health_check_service_server_builder_option.h",
"include/grpcpp/generic/async_generic_service.h",
"include/grpcpp/generic/generic_stub.h",

@ -1228,7 +1228,6 @@ config("grpc_config") {
"include/grpcpp/create_channel.h",
"include/grpcpp/create_channel_impl.h",
"include/grpcpp/create_channel_posix.h",
"include/grpcpp/create_channel_posix_impl.h",
"include/grpcpp/ext/health_check_service_server_builder_option.h",
"include/grpcpp/generic/async_generic_service.h",
"include/grpcpp/generic/generic_stub.h",

@ -2792,7 +2792,6 @@ foreach(_hdr
include/grpcpp/create_channel.h
include/grpcpp/create_channel_impl.h
include/grpcpp/create_channel_posix.h
include/grpcpp/create_channel_posix_impl.h
include/grpcpp/ext/health_check_service_server_builder_option.h
include/grpcpp/generic/async_generic_service.h
include/grpcpp/generic/generic_stub.h
@ -3484,7 +3483,6 @@ foreach(_hdr
include/grpcpp/create_channel.h
include/grpcpp/create_channel_impl.h
include/grpcpp/create_channel_posix.h
include/grpcpp/create_channel_posix_impl.h
include/grpcpp/ext/health_check_service_server_builder_option.h
include/grpcpp/generic/async_generic_service.h
include/grpcpp/generic/generic_stub.h

@ -4989,7 +4989,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/create_channel.h \
include/grpcpp/create_channel_impl.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/create_channel_posix_impl.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
include/grpcpp/generic/generic_stub.h \
@ -5686,7 +5685,6 @@ PUBLIC_HEADERS_CXX += \
include/grpcpp/create_channel.h \
include/grpcpp/create_channel_impl.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/create_channel_posix_impl.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
include/grpcpp/generic/generic_stub.h \

@ -2336,7 +2336,6 @@ libs:
- include/grpcpp/create_channel.h
- include/grpcpp/create_channel_impl.h
- include/grpcpp/create_channel_posix.h
- include/grpcpp/create_channel_posix_impl.h
- include/grpcpp/ext/health_check_service_server_builder_option.h
- include/grpcpp/generic/async_generic_service.h
- include/grpcpp/generic/generic_stub.h
@ -2727,7 +2726,6 @@ libs:
- include/grpcpp/create_channel.h
- include/grpcpp/create_channel_impl.h
- include/grpcpp/create_channel_posix.h
- include/grpcpp/create_channel_posix_impl.h
- include/grpcpp/ext/health_check_service_server_builder_option.h
- include/grpcpp/generic/async_generic_service.h
- include/grpcpp/generic/generic_stub.h

@ -86,7 +86,6 @@ Pod::Spec.new do |s|
'include/grpcpp/create_channel.h',
'include/grpcpp/create_channel_impl.h',
'include/grpcpp/create_channel_posix.h',
'include/grpcpp/create_channel_posix_impl.h',
'include/grpcpp/ext/health_check_service_server_builder_option.h',
'include/grpcpp/generic/async_generic_service.h',
'include/grpcpp/generic/generic_stub.h',

@ -1,6 +1,6 @@
/*
*
* Copyright 2019 gRPC authors.
* Copyright 2016 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,47 @@
#ifndef GRPCPP_CREATE_CHANNEL_POSIX_H
#define GRPCPP_CREATE_CHANNEL_POSIX_H
#include <grpcpp/create_channel_posix_impl.h>
#include <memory>
#include <grpc/support/port_platform.h>
#include <grpcpp/channel.h>
#include <grpcpp/support/channel_arguments.h>
namespace grpc {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
static inline std::shared_ptr<Channel> CreateInsecureChannelFromFd(
const grpc::string& target, int fd) {
return ::grpc_impl::CreateInsecureChannelFromFd(target, fd);
}
/// Create a new \a Channel communicating over the given file descriptor.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd(
const grpc::string& target, int fd);
static inline std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
const grpc::string& target, int fd, const ChannelArguments& args) {
return ::grpc_impl::CreateCustomInsecureChannelFromFd(target, fd, args);
}
/// Create a new \a Channel communicating over given file descriptor with custom
/// channel arguments.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
/// \param args Options for channel creation.
std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd(
const grpc::string& target, int fd, const grpc::ChannelArguments& args);
namespace experimental {
static inline std::shared_ptr<Channel>
/// Create a new \a Channel communicating over given file descriptor with custom
/// channel arguments.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
/// \param args Options for channel creation.
/// \param interceptor_creators Vector of interceptor factory objects.
std::shared_ptr<grpc::Channel>
CreateCustomInsecureChannelWithInterceptorsFromFd(
const grpc::string& target, int fd, const ChannelArguments& args,
const grpc::string& target, int fd, const grpc::ChannelArguments& args,
std::unique_ptr<std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>>
interceptor_creators) {
return ::grpc_impl::experimental::
CreateCustomInsecureChannelWithInterceptorsFromFd(
target, fd, args, std::move(interceptor_creators));
}
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>>
interceptor_creators);
} // namespace experimental

@ -1,70 +0,0 @@
/*
*
* Copyright 2016 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_CREATE_CHANNEL_POSIX_IMPL_H
#define GRPCPP_CREATE_CHANNEL_POSIX_IMPL_H
#include <memory>
#include <grpc/support/port_platform.h>
#include <grpcpp/channel.h>
#include <grpcpp/support/channel_arguments.h>
namespace grpc_impl {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
/// Create a new \a Channel communicating over the given file descriptor.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd(
const grpc::string& target, int fd);
/// Create a new \a Channel communicating over given file descriptor with custom
/// channel arguments.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
/// \param args Options for channel creation.
std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd(
const grpc::string& target, int fd, const grpc::ChannelArguments& args);
namespace experimental {
/// Create a new \a Channel communicating over given file descriptor with custom
/// channel arguments.
///
/// \param target The name of the target.
/// \param fd The file descriptor representing a socket.
/// \param args Options for channel creation.
/// \param interceptor_creators Vector of interceptor factory objects.
std::shared_ptr<grpc::Channel>
CreateCustomInsecureChannelWithInterceptorsFromFd(
const grpc::string& target, int fd, const grpc::ChannelArguments& args,
std::unique_ptr<std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>>
interceptor_creators);
} // namespace experimental
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
} // namespace grpc_impl
#endif // GRPCPP_CREATE_CHANNEL_POSIX_IMPL_H

@ -27,37 +27,39 @@
namespace grpc_impl {
class ChannelArguments;
} // namespace grpc_impl
namespace grpc {
#ifdef GPR_SUPPORT_CHANNELS_FROM_FD
std::shared_ptr<grpc::Channel> CreateInsecureChannelFromFd(
const grpc::string& target, int fd) {
std::shared_ptr<Channel> CreateInsecureChannelFromFd(const grpc::string& target,
int fd) {
grpc::internal::GrpcLibrary init_lib;
init_lib.init();
return ::grpc::CreateChannelInternal(
return CreateChannelInternal(
"", grpc_insecure_channel_create_from_fd(target.c_str(), fd, nullptr),
std::vector<std::unique_ptr<
grpc::experimental::ClientInterceptorFactoryInterface>>());
std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
}
std::shared_ptr<grpc::Channel> CreateCustomInsecureChannelFromFd(
std::shared_ptr<Channel> CreateCustomInsecureChannelFromFd(
const grpc::string& target, int fd, const grpc::ChannelArguments& args) {
grpc::internal::GrpcLibrary init_lib;
internal::GrpcLibrary init_lib;
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
return ::grpc::CreateChannelInternal(
return CreateChannelInternal(
"",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
std::vector<std::unique_ptr<
grpc::experimental::ClientInterceptorFactoryInterface>>());
std::vector<
std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
}
namespace experimental {
std::shared_ptr<grpc::Channel>
CreateCustomInsecureChannelWithInterceptorsFromFd(
const grpc::string& target, int fd, const grpc::ChannelArguments& args,
std::shared_ptr<Channel> CreateCustomInsecureChannelWithInterceptorsFromFd(
const grpc::string& target, int fd, const ChannelArguments& args,
std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators) {
@ -65,7 +67,7 @@ CreateCustomInsecureChannelWithInterceptorsFromFd(
init_lib.init();
grpc_channel_args channel_args;
args.SetChannelArgs(&channel_args);
return ::grpc::CreateChannelInternal(
return CreateChannelInternal(
"",
grpc_insecure_channel_create_from_fd(target.c_str(), fd, &channel_args),
std::move(interceptor_creators));
@ -75,4 +77,4 @@ CreateCustomInsecureChannelWithInterceptorsFromFd(
#endif // GPR_SUPPORT_CHANNELS_FROM_FD
} // namespace grpc_impl
} // namespace grpc

@ -942,7 +942,6 @@ include/grpcpp/completion_queue_impl.h \
include/grpcpp/create_channel.h \
include/grpcpp/create_channel_impl.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/create_channel_posix_impl.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
include/grpcpp/generic/generic_stub.h \

@ -942,7 +942,6 @@ include/grpcpp/completion_queue_impl.h \
include/grpcpp/create_channel.h \
include/grpcpp/create_channel_impl.h \
include/grpcpp/create_channel_posix.h \
include/grpcpp/create_channel_posix_impl.h \
include/grpcpp/ext/health_check_service_server_builder_option.h \
include/grpcpp/generic/async_generic_service.h \
include/grpcpp/generic/generic_stub.h \

Loading…
Cancel
Save