Apollo 10.0
自动驾驶开放平台
|
Base class for management of Topology elements. 更多...
#include <manager.h>
Public 类型 | |
using | ChangeSignal = base::Signal< const ChangeMsg & > |
using | ChangeFunc = std::function< void(const ChangeMsg &)> |
using | ChangeConnection = base::Connection< const ChangeMsg & > |
using | ParticipantPtr = std::shared_ptr< transport::Participant > |
using | PublisherPtr = std::shared_ptr< transport::Publisher > |
using | SubscriberPtr = std::shared_ptr< transport::Subscriber > |
Public 成员函数 | |
Manager () | |
Construct a new Manager object | |
virtual | ~Manager () |
Destroy the Manager object | |
bool | StartDiscovery (const ParticipantPtr &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. | |
virtual void | OnTopoModuleLeave (const std::string &host_name, int process_id)=0 |
Called when a process' topology manager instance leave | |
Protected 成员函数 | |
bool | CreatePublisher (const ParticipantPtr &participant) |
bool | CreateSubscriber (const ParticipantPtr &participant) |
virtual bool | Check (const RoleAttributes &attr)=0 |
virtual void | Dispose (const ChangeMsg &msg)=0 |
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::shared_ptr< std::string > &msg_str) |
bool | IsFromSameProcess (const ChangeMsg &msg) |
Protected 属性 | |
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_ |
PublisherPtr | publisher_ |
SubscriberPtr | subscriber_ |
ParticipantPtr | participant_ |
std::mutex | lock_ |
ChangeSignal | signal_ |
Base class for management of Topology elements.
Manager can Join/Leave the Topology, and Listen the topology change
using apollo::cyber::service_discovery::Manager::ChangeFunc = std::function<void(const ChangeMsg&)> |
using apollo::cyber::service_discovery::Manager::ParticipantPtr = std::shared_ptr<transport::Participant> |
using apollo::cyber::service_discovery::Manager::PublisherPtr = std::shared_ptr<transport::Publisher> |
using apollo::cyber::service_discovery::Manager::SubscriberPtr = std::shared_ptr<transport::Subscriber> |
apollo::cyber::service_discovery::Manager::Manager | ( | ) |
Construct a new Manager object
在文件 manager.cc 第 32 行定义.
|
virtual |
Destroy the Manager object
在文件 manager.cc 第 44 行定义.
Manager::ChangeConnection apollo::cyber::service_discovery::Manager::AddChangeListener | ( | const ChangeFunc & | func | ) |
Add topology change listener, when topology changed, func will be called.
func | the callback function |
在文件 manager.cc 第 110 行定义.
|
protectedpure virtual |
|
protected |
在文件 manager.cc 第 137 行定义.
|
protected |
在文件 manager.cc 第 119 行定义.
|
protected |
在文件 manager.cc 第 125 行定义.
|
protectedpure virtual |
|
protected |
在文件 manager.cc 第 187 行定义.
bool apollo::cyber::service_discovery::Manager::Join | ( | const RoleAttributes & | attr, |
RoleType | role, | ||
bool | need_publish = true |
||
) |
Join the topology
attr | is the attributes that will be sent to other Manager(include ourselves) |
role | is one of RoleType enum |
在文件 manager.cc 第 77 行定义.
bool apollo::cyber::service_discovery::Manager::Leave | ( | const RoleAttributes & | attr, |
RoleType | role | ||
) |
Leave the topology
attr | is the attributes that will be sent to other Manager(include ourselves) |
role | if one of RoleType enum. |
在文件 manager.cc 第 94 行定义.
|
protectedvirtual |
在文件 manager.cc 第 132 行定义.
|
protected |
在文件 manager.cc 第 153 行定义.
|
protected |
在文件 manager.cc 第 155 行定义.
|
pure virtual |
Called when a process' topology manager instance leave
host_name | is the process's host's name |
process_id | is the process' id |
|
protected |
在文件 manager.cc 第 170 行定义.
void apollo::cyber::service_discovery::Manager::RemoveChangeListener | ( | const ChangeConnection & | conn | ) |
Remove our listener for topology change.
conn | is the return value of AddChangeListener |
在文件 manager.cc 第 114 行定义.
|
virtual |
Shutdown module
在文件 manager.cc 第 68 行定义.
bool apollo::cyber::service_discovery::Manager::StartDiscovery | ( | const ParticipantPtr & | participant | ) |
Startup topology discovery
participant | is used to create rtps Publisher and Subscriber |
在文件 manager.cc 第 46 行定义.
void apollo::cyber::service_discovery::Manager::StopDiscovery | ( | ) |
Stop topology discovery
在文件 manager.cc 第 62 行定义.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |