#include <atomic>
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <grpc/grpc.h>
#include <grpc/impl/connectivity_state.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/call_op_set_interface.h>
#include <grpcpp/impl/completion_queue_tag.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/impl/sync.h>
#include <grpcpp/support/client_interceptor.h>
#include <grpcpp/support/slice.h>
#include "src/core/lib/iomgr/iomgr.h"
namespace grpc {
Channel::Channel(
const std::string& host, grpc_channel* channel,
std::vector<
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators)
: … { … }
Channel::~Channel() { … }
namespace {
inline grpc_slice SliceFromArray(const char* arr, size_t len) { … }
std::string GetChannelInfoField(grpc_channel* channel,
grpc_channel_info* channel_info,
char*** channel_info_field) { … }
}
std::string Channel::GetLoadBalancingPolicyName() const { … }
std::string Channel::GetServiceConfigJSON() const { … }
namespace experimental {
void ChannelResetConnectionBackoff(Channel* channel) { … }
}
grpc::internal::Call Channel::CreateCallInternal(
const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
grpc::CompletionQueue* cq, size_t interceptor_pos) { … }
grpc::internal::Call Channel::CreateCall(
const grpc::internal::RpcMethod& method, grpc::ClientContext* context,
CompletionQueue* cq) { … }
void Channel::PerformOpsOnCall(grpc::internal::CallOpSetInterface* ops,
grpc::internal::Call* call) { … }
void* Channel::RegisterMethod(const char* method) { … }
grpc_connectivity_state Channel::GetState(bool try_to_connect) { … }
namespace {
class TagSaver final : public grpc::internal::CompletionQueueTag { … };
}
void Channel::NotifyOnStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline,
grpc::CompletionQueue* cq, void* tag) { … }
bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
gpr_timespec deadline) { … }
namespace {
class ShutdownCallback : public grpc_completion_queue_functor { … };
}
::grpc::CompletionQueue* Channel::CallbackCQ() { … }
}