Apollo 11.0
自动驾驶开放平台
apollo::cyber::service_discovery::NodeManager类 参考

Topology Manager of Node related 更多...

#include <node_manager.h>

类 apollo::cyber::service_discovery::NodeManager 继承关系图:
apollo::cyber::service_discovery::NodeManager 的协作图:

Public 类型

using RoleAttrVec = std::vector< RoleAttributes >
 
using NodeWarehouse = SingleValueWarehouse
 
- Public 类型 继承自 apollo::cyber::service_discovery::Manager
using ChangeSignal = base::Signal< const ChangeMsg & >
 
using ChangeFunc = std::function< void(const ChangeMsg &)>
 
using ChangeConnection = base::Connection< const ChangeMsg & >
 
using RtpsParticipant = eprosima::fastrtps::Participant
 
using RtpsPublisherAttr = eprosima::fastrtps::PublisherAttributes
 
using RtpsSubscriberAttr = eprosima::fastrtps::SubscriberAttributes
 

Public 成员函数

 NodeManager ()
 Construct a new Node Manager object
 
virtual ~NodeManager ()
 Destroy the Node Manager object
 
bool HasNode (const std::string &node_name)
 Checkout whether we have node_name in topology
 
void GetNodes (RoleAttrVec *nodes)
 Get the Nodes object
 
- Public 成员函数 继承自 apollo::cyber::service_discovery::Manager
 Manager ()
 Construct a new Manager object
 
virtual ~Manager ()
 Destroy the Manager object
 
bool StartDiscovery (RtpsParticipant *participant)
 Startup topology discovery
 
void StopDiscovery ()
 Stop topology discovery
 
virtual void Shutdown ()
 Shutdown module
 
bool Join (const RoleAttributes &attr, RoleType role, bool need_publish=true)
 Join the topology
 
bool Leave (const RoleAttributes &attr, RoleType role)
 Leave the topology
 
ChangeConnection AddChangeListener (const ChangeFunc &func)
 Add topology change listener, when topology changed, func will be called.
 
void RemoveChangeListener (const ChangeConnection &conn)
 Remove our listener for topology change.
 

友元

class TopologyManager
 

额外继承的成员函数

- Protected 成员函数 继承自 apollo::cyber::service_discovery::Manager
bool CreatePublisher (RtpsParticipant *participant)
 
bool CreateSubscriber (RtpsParticipant *participant)
 
virtual bool NeedPublish (const ChangeMsg &msg) const
 
void Convert (const RoleAttributes &attr, RoleType role, OperateType opt, ChangeMsg *msg)
 
void Notify (const ChangeMsg &msg)
 
bool Publish (const ChangeMsg &msg)
 
void OnRemoteChange (const std::string &msg_str)
 
bool IsFromSameProcess (const ChangeMsg &msg)
 
- Protected 属性 继承自 apollo::cyber::service_discovery::Manager
std::atomic< bool > is_shutdown_
 
std::atomic< bool > is_discovery_started_
 
int allowed_role_
 
ChangeType change_type_
 
std::string host_name_
 
int process_id_
 
std::string channel_name_
 
eprosima::fastrtps::Publisher * publisher_
 
std::mutex lock_
 
eprosima::fastrtps::Subscriber * subscriber_
 
SubscriberListenerlistener_
 
ChangeSignal signal_
 

详细描述

Topology Manager of Node related

在文件 node_manager.h38 行定义.

成员类型定义说明

◆ NodeWarehouse

◆ RoleAttrVec

构造及析构函数说明

◆ NodeManager()

apollo::cyber::service_discovery::NodeManager::NodeManager ( )

Construct a new Node Manager object

在文件 node_manager.cc27 行定义.

27 {
28 allowed_role_ |= 1 << RoleType::ROLE_NODE;
29 change_type_ = ChangeType::CHANGE_NODE;
30 channel_name_ = "node_change_broadcast";
31}

◆ ~NodeManager()

apollo::cyber::service_discovery::NodeManager::~NodeManager ( )
virtual

Destroy the Node Manager object

在文件 node_manager.cc33 行定义.

33{}

成员函数说明

◆ GetNodes()

void apollo::cyber::service_discovery::NodeManager::GetNodes ( RoleAttrVec nodes)

Get the Nodes object

参数
nodesresult RoleAttr vector

在文件 node_manager.cc40 行定义.

40 {
41 RETURN_IF_NULL(nodes);
42 nodes_.GetAllRoles(nodes);
43}
void GetAllRoles(std::vector< RolePtr > *roles) override
#define RETURN_IF_NULL(ptr)
Definition log.h:90

◆ HasNode()

bool apollo::cyber::service_discovery::NodeManager::HasNode ( const std::string &  node_name)

Checkout whether we have node_name in topology

参数
node_nameNode's name we want to inquire
返回
true if this node found
false if this node not exits

在文件 node_manager.cc35 行定义.

35 {
36 uint64_t key = common::GlobalData::RegisterNode(node_name);
37 return nodes_.Search(key);
38}
static uint64_t RegisterNode(const std::string &node_name)

友元及相关函数文档

◆ TopologyManager

friend class TopologyManager
friend

在文件 node_manager.h39 行定义.


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