Apollo 10.0
自动驾驶开放平台
apollo::v2x::ObuInterFaceGrpcImpl类 参考

#include <obu_interface_grpc_impl.h>

类 apollo::v2x::ObuInterFaceGrpcImpl 继承关系图:
apollo::v2x::ObuInterFaceGrpcImpl 的协作图:

Public 成员函数

 ObuInterFaceGrpcImpl ()
 
 ~ObuInterFaceGrpcImpl ()
 
bool InitialServer () override
 
bool InitialClient () override
 
void GetV2xTrafficLightFromObu (std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight > *msg) override
 
void GetV2xObstaclesFromObu (std::shared_ptr<::apollo::v2x::V2XObstacles > *msg) override
 
void GetV2xRsiFromObu (std::shared_ptr<::apollo::v2x::obu::ObuRsi > *msg) override
 
void SendCarStatusToObu (const std::shared_ptr<::apollo::v2x::CarStatus > &msg) override
 
bool InitFlag ()
 
- Public 成员函数 继承自 apollo::v2x::ObuInterFaceBase
 ObuInterFaceBase ()
 
virtual ~ObuInterFaceBase ()
 

详细描述

在文件 obu_interface_grpc_impl.h38 行定义.

构造及析构函数说明

◆ ObuInterFaceGrpcImpl()

apollo::v2x::ObuInterFaceGrpcImpl::ObuInterFaceGrpcImpl ( )

在文件 obu_interface_grpc_impl.cc38 行定义.

39 : grpc_client_(new GrpcClientImpl(grpc::CreateChannel(
40 FLAGS_grpc_client_host + ":" + FLAGS_grpc_client_port,
41 grpc::InsecureChannelCredentials()))) {
42 AINFO << "ObuInterFaceGrpcImpl Start Construct.";
43 cli_init_ = grpc_client_->InitFlag();
44 grpc_server_.reset(new GrpcServerImpl());
45 srv_init_ = grpc_server_->InitFlag();
48 init_succ_ = true;
49}
#define AINFO
Definition log.h:42

◆ ~ObuInterFaceGrpcImpl()

apollo::v2x::ObuInterFaceGrpcImpl::~ObuInterFaceGrpcImpl ( )

在文件 obu_interface_grpc_impl.cc51 行定义.

51 {
52 {
53 std::unique_lock<std::mutex> lck(mutex_);
54 exit_flag_ = true;
55 }
56 condition_.notify_all();
57 if (!!thread_grpc_ && thread_grpc_->joinable()) {
58 thread_grpc_->join();
59 }
60 AINFO << "close obu interface success";
61}

成员函数说明

◆ GetV2xObstaclesFromObu()

void apollo::v2x::ObuInterFaceGrpcImpl::GetV2xObstaclesFromObu ( std::shared_ptr<::apollo::v2x::V2XObstacles > *  msg)
overridevirtual

重载 apollo::v2x::ObuInterFaceBase .

在文件 obu_interface_grpc_impl.cc99 行定义.

100 {
101 grpc_server_->GetMsgFromGrpc(msg);
102}

◆ GetV2xRsiFromObu()

void apollo::v2x::ObuInterFaceGrpcImpl::GetV2xRsiFromObu ( std::shared_ptr<::apollo::v2x::obu::ObuRsi > *  msg)
overridevirtual

重载 apollo::v2x::ObuInterFaceBase .

在文件 obu_interface_grpc_impl.cc104 行定义.

104 {
105 grpc_server_->GetMsgFromGrpc(msg);
106}

◆ GetV2xTrafficLightFromObu()

void apollo::v2x::ObuInterFaceGrpcImpl::GetV2xTrafficLightFromObu ( std::shared_ptr<::apollo::v2x::obu::ObuTrafficLight > *  msg)
overridevirtual

重载 apollo::v2x::ObuInterFaceBase .

在文件 obu_interface_grpc_impl.cc94 行定义.

95 {
96 grpc_server_->GetMsgFromGrpc(msg);
97}

◆ InitFlag()

bool apollo::v2x::ObuInterFaceGrpcImpl::InitFlag ( )
inline

在文件 obu_interface_grpc_impl.h71 行定义.

71{ return init_succ_; }

◆ InitialClient()

bool apollo::v2x::ObuInterFaceGrpcImpl::InitialClient ( )
overridevirtual

实现了 apollo::v2x::ObuInterFaceBase.

在文件 obu_interface_grpc_impl.cc63 行定义.

63{ return cli_init_; }

◆ InitialServer()

bool apollo::v2x::ObuInterFaceGrpcImpl::InitialServer ( )
overridevirtual

实现了 apollo::v2x::ObuInterFaceBase.

在文件 obu_interface_grpc_impl.cc65 行定义.

65 {
66 if (!srv_init_) {
67 return false;
68 }
69 thread_grpc_.reset(new std::thread([this]() { this->ThreadRunServer(); }));
70 return thread_grpc_ != nullptr;
71}

◆ SendCarStatusToObu()

void apollo::v2x::ObuInterFaceGrpcImpl::SendCarStatusToObu ( const std::shared_ptr<::apollo::v2x::CarStatus > &  msg)
overridevirtual

重载 apollo::v2x::ObuInterFaceBase .

在文件 obu_interface_grpc_impl.cc108 行定义.

109 {
110 grpc_client_->SendMsgToGrpc(msg);
111}

该类的文档由以下文件生成: