Apollo
6.0
Open source self driving car software
|
Topology Manager of Service related. More...
#include <channel_manager.h>
Public Types | |
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 | RtpsParticipant = eprosima::fastrtps::Participant |
using | RtpsPublisherAttr = eprosima::fastrtps::PublisherAttributes |
using | RtpsSubscriberAttr = eprosima::fastrtps::SubscriberAttributes |
Public Member Functions | |
ChannelManager () | |
Construct a new Channel Manager object. More... | |
virtual | ~ChannelManager () |
Destroy the Channel Manager object. More... | |
void | GetChannelNames (std::vector< std::string > *channels) |
Get all channel names in the topology. More... | |
void | GetProtoDesc (const std::string &channel_name, std::string *proto_desc) |
Get the Protocol Desc of channel_name More... | |
void | GetMsgType (const std::string &channel_name, std::string *msg_type) |
Get the Msg Type of channel_name More... | |
bool | HasWriter (const std::string &channel_name) |
Inquire if there is at least one Writer that publishes channel_name More... | |
void | GetWriters (RoleAttrVec *writers) |
Get All Writers object. More... | |
void | GetWritersOfNode (const std::string &node_name, RoleAttrVec *writers) |
Get the Writers Of Node object. More... | |
void | GetWritersOfChannel (const std::string &channel_name, RoleAttrVec *writers) |
Get the Writers Of Channel object. More... | |
bool | HasReader (const std::string &channel_name) |
Inquire if there is at least one Reader that publishes channel_name More... | |
void | GetReaders (RoleAttrVec *readers) |
Get All Readers object. More... | |
void | GetReadersOfNode (const std::string &node_name, RoleAttrVec *readers) |
Get the Readers Of Node object. More... | |
void | GetReadersOfChannel (const std::string &channel_name, RoleAttrVec *readers) |
Get the Readers Of Channel object. More... | |
void | 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. More... | |
void | 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. More... | |
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. More... | |
bool | IsMessageTypeMatching (const std::string &lhs, const std::string &rhs) |
Is lhs and rhs have same MessageType. More... | |
![]() | |
Manager () | |
Construct a new Manager object. More... | |
virtual | ~Manager () |
Destroy the Manager object. More... | |
bool | StartDiscovery (RtpsParticipant *participant) |
Startup topology discovery. More... | |
void | StopDiscovery () |
Stop topology discovery. More... | |
virtual void | Shutdown () |
Shutdown module. More... | |
bool | Join (const RoleAttributes &attr, RoleType role, bool need_publish=true) |
Join the topology. More... | |
bool | Leave (const RoleAttributes &attr, RoleType role) |
Leave the topology. More... | |
ChangeConnection | AddChangeListener (const ChangeFunc &func) |
Add topology change listener, when topology changed, func will be called. More... | |
void | RemoveChangeListener (const ChangeConnection &conn) |
Remove our listener for topology change. More... | |
Friends | |
class | TopologyManager |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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_ |
SubscriberListener * | listener_ |
ChangeSignal | signal_ |
using apollo::cyber::service_discovery::ChannelManager::ExemptedMessageTypes = std::unordered_set<std::string> |
using apollo::cyber::service_discovery::ChannelManager::RoleAttrVec = std::vector<proto::RoleAttributes> |
apollo::cyber::service_discovery::ChannelManager::ChannelManager | ( | ) |
Construct a new Channel Manager object.
|
virtual |
Destroy the Channel Manager object.
void apollo::cyber::service_discovery::ChannelManager::GetChannelNames | ( | std::vector< std::string > * | channels | ) |
Get all channel names in the topology.
channels | result vector |
void apollo::cyber::service_discovery::ChannelManager::GetDownstreamOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | downstream_nodes | ||
) |
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.
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 |
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 |
void apollo::cyber::service_discovery::ChannelManager::GetReaders | ( | RoleAttrVec * | readers | ) |
Get All Readers object.
readers | result RoleAttr vector |
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 |
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 |
void apollo::cyber::service_discovery::ChannelManager::GetUpstreamOfNode | ( | const std::string & | node_name, |
RoleAttrVec * | upstream_nodes | ||
) |
void apollo::cyber::service_discovery::ChannelManager::GetWriters | ( | RoleAttrVec * | writers | ) |
Get All Writers object.
writers | result RoleAttr vector |
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 |
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 |
bool apollo::cyber::service_discovery::ChannelManager::HasReader | ( | const std::string & | channel_name | ) |
bool apollo::cyber::service_discovery::ChannelManager::HasWriter | ( | const std::string & | channel_name | ) |
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 |
|
friend |