Apollo 10.0
自动驾驶开放平台
|
Topology Manager of Service related 更多...
#include <channel_manager.h>
Public 类型 | |
using | RoleAttrVec = std::vector< proto::RoleAttributes > |
using | WriterWarehouse = MultiValueWarehouse |
using | ReaderWarehouse = MultiValueWarehouse |
using | ExemptedMessageTypes = std::unordered_set< std::string > |
![]() | |
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 成员函数 | |
ChannelManager () | |
Construct a new Channel Manager object | |
virtual | ~ChannelManager () |
Destroy the Channel Manager object | |
void | GetChannelNames (std::vector< std::string > *channels) |
Get all channel names in the topology | |
void | GetProtoDesc (const std::string &channel_name, std::string *proto_desc) |
Get the Protocol Desc of channel_name | |
void | GetMsgType (const std::string &channel_name, std::string *msg_type) |
Get the Msg Type of channel_name | |
bool | HasWriter (const std::string &channel_name) |
Inquire if there is at least one Writer that publishes channel_name | |
void | GetWriters (RoleAttrVec *writers) |
Get All Writers object | |
void | GetWritersOfNode (const std::string &node_name, RoleAttrVec *writers) |
Get the Writers Of Node object | |
void | GetWritersOfChannel (const std::string &channel_name, RoleAttrVec *writers) |
Get the Writers Of Channel object | |
bool | HasReader (const std::string &channel_name) |
Inquire if there is at least one Reader that publishes channel_name | |
void | GetReaders (RoleAttrVec *readers) |
Get All Readers object | |
void | GetReadersOfNode (const std::string &node_name, RoleAttrVec *readers) |
Get the Readers Of Node object | |
void | GetReadersOfChannel (const std::string &channel_name, RoleAttrVec *readers) |
Get the Readers Of Channel object | |
void | GetUpstreamOfNode (const std::string &node_name, RoleAttrVec *upstream_nodes) |
Get the Upstream Of Node object. | |
void | GetDownstreamOfNode (const std::string &node_name, RoleAttrVec *downstream_nodes) |
Get the Downstream Of Node object. | |
FlowDirection | GetFlowDirection (const std::string &lhs_node_name, const std::string &rhs_node_name) |
Get the Flow Direction from lhs_node_node to rhs_node_name You can see FlowDirection's description for more information | |
bool | IsMessageTypeMatching (const std::string &lhs, const std::string &rhs) |
Is lhs and rhs have same MessageType | |
![]() | |
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. | |
友元 | |
class | TopologyManager |
额外继承的成员函数 | |
![]() | |
bool | CreatePublisher (const ParticipantPtr &participant) |
bool | CreateSubscriber (const ParticipantPtr &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::shared_ptr< std::string > &msg_str) |
bool | IsFromSameProcess (const ChangeMsg &msg) |
![]() | |
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_ |
Topology Manager of Service related
在文件 channel_manager.h 第 43 行定义.
using apollo::cyber::service_discovery::ChannelManager::ExemptedMessageTypes = std::unordered_set<std::string> |
在文件 channel_manager.h 第 50 行定义.
在文件 channel_manager.h 第 49 行定义.
using apollo::cyber::service_discovery::ChannelManager::RoleAttrVec = std::vector<proto::RoleAttributes> |
在文件 channel_manager.h 第 47 行定义.
在文件 channel_manager.h 第 48 行定义.
apollo::cyber::service_discovery::ChannelManager::ChannelManager | ( | ) |
Construct a new Channel Manager object
在文件 channel_manager.cc 第 32 行定义.
|
virtual |
void apollo::cyber::service_discovery::ChannelManager::GetChannelNames | ( | std::vector< std::string > * | channels | ) |
Get all channel names in the topology
channels | result vector |
在文件 channel_manager.cc 第 43 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetDownstreamOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | downstream_nodes | ||
) |
Get the Downstream Of Node object.
If Node A has writer that publishes channel-1, and Node B has reader that subscribes channel-1 then A is B's Upstream node, and B is A's Downstream node
node_name | node's name we want to inquire |
downstream_nodes | result RoleAttribute vector |
在文件 channel_manager.cc 第 168 行定义.
FlowDirection apollo::cyber::service_discovery::ChannelManager::GetFlowDirection | ( | const std::string & | lhs_node_name, |
const std::string & | rhs_node_name | ||
) |
Get the Flow Direction from lhs_node_node
to rhs_node_name
You can see FlowDirection's description for more information
在文件 channel_manager.cc 第 201 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetMsgType | ( | const std::string & | channel_name, |
std::string * | msg_type | ||
) |
Get the Msg Type of channel_name
channel_name | channel name we want to inquire |
msg_type | result string, empty if inquire failed |
在文件 channel_manager.cc 第 71 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetProtoDesc | ( | const std::string & | channel_name, |
std::string * | proto_desc | ||
) |
Get the Protocol Desc of channel_name
channel_name | channel name we want to inquire |
proto_desc | result string, empty if inquire failed |
在文件 channel_manager.cc 第 57 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetReaders | ( | RoleAttrVec * | readers | ) |
void apollo::cyber::service_discovery::ChannelManager::GetReadersOfChannel | ( | const std::string & | channel_name, |
RoleAttrVec * | readers | ||
) |
Get the Readers Of Channel object
channel_name | channel's name we want to inquire |
readers | result RoleAttribute vector |
在文件 channel_manager.cc 第 128 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetReadersOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | readers | ||
) |
Get the Readers Of Node object
node_name | node's name we want to inquire |
readers | result RoleAttribute vector |
在文件 channel_manager.cc 第 121 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetUpstreamOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | upstream_nodes | ||
) |
Get the Upstream Of Node object.
If Node A has writer that publishes channel-1, and Node B has reader that subscribes channel-1 then A is B's Upstream node, and B is A's Downstream node
node_name | node's name we want to inquire |
upstream_nodes | result RoleAttribute vector |
在文件 channel_manager.cc 第 135 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetWriters | ( | RoleAttrVec * | writers | ) |
void apollo::cyber::service_discovery::ChannelManager::GetWritersOfChannel | ( | const std::string & | channel_name, |
RoleAttrVec * | writers | ||
) |
Get the Writers Of Channel object
channel_name | channel's name we want to inquire |
writers | result RoleAttribute vector |
在文件 channel_manager.cc 第 104 行定义.
void apollo::cyber::service_discovery::ChannelManager::GetWritersOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | writers | ||
) |
Get the Writers Of Node object
node_name | node's name we want to inquire |
writers | result RoleAttribute vector |
在文件 channel_manager.cc 第 97 行定义.
bool apollo::cyber::service_discovery::ChannelManager::HasReader | ( | const std::string & | channel_name | ) |
Inquire if there is at least one Reader that publishes channel_name
channel_name | channel name we want to inquire |
在文件 channel_manager.cc 第 111 行定义.
bool apollo::cyber::service_discovery::ChannelManager::HasWriter | ( | const std::string & | channel_name | ) |
Inquire if there is at least one Writer that publishes channel_name
channel_name | channel name we want to inquire |
在文件 channel_manager.cc 第 87 行定义.
bool apollo::cyber::service_discovery::ChannelManager::IsMessageTypeMatching | ( | const std::string & | lhs, |
const std::string & | rhs | ||
) |
Is lhs
and rhs
have same MessageType
lhs | the left message type to compare |
rhs | the right message type to compare |
在文件 channel_manager.cc 第 208 行定义.
|
friend |
在文件 channel_manager.h 第 44 行定义.