Apollo 10.0
自动驾驶开放平台
apollo::cyber::NodeChannelImpl类 参考

The implementation for Node to create Objects connected by Channels. 更多...

#include <node_channel_impl.h>

apollo::cyber::NodeChannelImpl 的协作图:

Public 类型

using NodeManagerPtr = std::shared_ptr< service_discovery::NodeManager >
 

Public 成员函数

 NodeChannelImpl (const std::string &node_name)
 Construct a new Node Channel Impl object
 
virtual ~NodeChannelImpl ()
 Destroy the Node Channel Impl object
 
const std::string & NodeName () const
 get name of this node
 

友元

class Node
 

详细描述

The implementation for Node to create Objects connected by Channels.

e.g. Channel Reader and Writer

在文件 node_channel_impl.h67 行定义.

成员类型定义说明

◆ NodeManagerPtr

构造及析构函数说明

◆ NodeChannelImpl()

apollo::cyber::NodeChannelImpl::NodeChannelImpl ( const std::string &  node_name)
inlineexplicit

Construct a new Node Channel Impl object

参数
node_namenode name

在文件 node_channel_impl.h78 行定义.

79 : is_reality_mode_(true), node_name_(node_name) {
80 node_attr_.set_host_name(common::GlobalData::Instance()->HostName());
81 node_attr_.set_host_ip(common::GlobalData::Instance()->HostIp());
82 node_attr_.set_process_id(common::GlobalData::Instance()->ProcessId());
83 node_attr_.set_node_name(node_name);
84 uint64_t node_id = common::GlobalData::RegisterNode(node_name);
85 node_attr_.set_node_id(node_id);
86
87 is_reality_mode_ = common::GlobalData::Instance()->IsRealityMode();
88
89 if (is_reality_mode_) {
90 node_manager_ =
91 service_discovery::TopologyManager::Instance()->node_manager();
92 node_manager_->Join(node_attr_, RoleType::ROLE_NODE);
93 }
94 }
static uint64_t RegisterNode(const std::string &node_name)

◆ ~NodeChannelImpl()

virtual apollo::cyber::NodeChannelImpl::~NodeChannelImpl ( )
inlinevirtual

Destroy the Node Channel Impl object

在文件 node_channel_impl.h99 行定义.

99 {
100 if (is_reality_mode_) {
101 node_manager_->Leave(node_attr_, RoleType::ROLE_NODE);
102 node_manager_ = nullptr;
103 }
104 }

成员函数说明

◆ NodeName()

const std::string & apollo::cyber::NodeChannelImpl::NodeName ( ) const
inline

get name of this node

返回
const std::string& actual node name

在文件 node_channel_impl.h111 行定义.

111{ return node_name_; }

友元及相关函数文档

◆ Node

friend class Node
friend

在文件 node_channel_impl.h68 行定义.


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