Apollo
6.0
Open source self driving car software
|
Topology Manager of Service related. More...
#include <service_manager.h>
Public Types | |
using | RoleAttrVec = std::vector< RoleAttributes > |
using | ServerWarehouse = SingleValueWarehouse |
using | ClientWarehouse = MultiValueWarehouse |
![]() | |
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 | |
ServiceManager () | |
Construct a new Service Manager object. More... | |
virtual | ~ServiceManager () |
Destroy the Service Manager object. More... | |
bool | HasService (const std::string &service_name) |
Inquire whether service_name exists in topology. More... | |
void | GetServers (RoleAttrVec *servers) |
Get the All Server in the topology. More... | |
void | GetClients (const std::string &service_name, RoleAttrVec *clients) |
Get the Clients object that subscribes service_name 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::ServiceManager::RoleAttrVec = std::vector<RoleAttributes> |
apollo::cyber::service_discovery::ServiceManager::ServiceManager | ( | ) |
|
virtual |
void apollo::cyber::service_discovery::ServiceManager::GetClients | ( | const std::string & | service_name, |
RoleAttrVec * | clients | ||
) |
Get the Clients object that subscribes service_name
service_name | Name of service you want to get |
clients | result vector |
void apollo::cyber::service_discovery::ServiceManager::GetServers | ( | RoleAttrVec * | servers | ) |
Get the All Server in the topology.
servers | result RoleAttr vector |
bool apollo::cyber::service_discovery::ServiceManager::HasService | ( | const std::string & | service_name | ) |
Inquire whether service_name
exists in topology.
service_name | the name we inquire |
|
friend |