Apollo  6.0
Open source self driving car software
Public Types | Public Member Functions | Friends | List of all members
apollo::cyber::service_discovery::NodeManager Class Reference

Topology Manager of Node related. More...

#include <node_manager.h>

Inheritance diagram for apollo::cyber::service_discovery::NodeManager:
Inheritance graph
Collaboration diagram for apollo::cyber::service_discovery::NodeManager:
Collaboration graph

Public Types

using RoleAttrVec = std::vector< RoleAttributes >
 
using NodeWarehouse = SingleValueWarehouse
 
- Public Types inherited from 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 Member Functions

 NodeManager ()
 Construct a new Node Manager object. More...
 
virtual ~NodeManager ()
 Destroy the Node Manager object. More...
 
bool HasNode (const std::string &node_name)
 Checkout whether we have node_name in topology. More...
 
void GetNodes (RoleAttrVec *nodes)
 Get the Nodes object. More...
 
- Public Member Functions inherited from apollo::cyber::service_discovery::Manager
 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

- Protected Member Functions inherited from 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 Attributes inherited from 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_
 

Detailed Description

Topology Manager of Node related.

Member Typedef Documentation

◆ NodeWarehouse

◆ RoleAttrVec

Constructor & Destructor Documentation

◆ NodeManager()

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

Construct a new Node Manager object.

◆ ~NodeManager()

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

Destroy the Node Manager object.

Member Function Documentation

◆ GetNodes()

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

Get the Nodes object.

Parameters
nodesresult RoleAttr vector

◆ HasNode()

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

Checkout whether we have node_name in topology.

Parameters
node_nameNode's name we want to inquire
Returns
true if this node found
false if this node not exits

Friends And Related Function Documentation

◆ TopologyManager

friend class TopologyManager
friend

The documentation for this class was generated from the following file: