Base class for management of Topology elements. Manager can Join/Leave the Topology, and Listen the topology change.
More...
#include <manager.h>
Base class for management of Topology elements. Manager can Join/Leave the Topology, and Listen the topology change.
◆ ChangeConnection
◆ ChangeFunc
◆ ChangeSignal
◆ RtpsParticipant
◆ RtpsPublisherAttr
◆ RtpsSubscriberAttr
◆ Manager()
apollo::cyber::service_discovery::Manager::Manager |
( |
| ) |
|
◆ ~Manager()
virtual apollo::cyber::service_discovery::Manager::~Manager |
( |
| ) |
|
|
virtual |
◆ AddChangeListener()
Add topology change listener, when topology changed, func will be called.
- Parameters
-
func | the callback function |
- Returns
- ChangeConnection Store it to use when you want to stop listening.
◆ Check()
virtual bool apollo::cyber::service_discovery::Manager::Check |
( |
const RoleAttributes & |
attr | ) |
|
|
protectedpure virtual |
◆ Convert()
void apollo::cyber::service_discovery::Manager::Convert |
( |
const RoleAttributes & |
attr, |
|
|
RoleType |
role, |
|
|
OperateType |
opt, |
|
|
ChangeMsg * |
msg |
|
) |
| |
|
protected |
◆ CreatePublisher()
bool apollo::cyber::service_discovery::Manager::CreatePublisher |
( |
RtpsParticipant * |
participant | ) |
|
|
protected |
◆ CreateSubscriber()
bool apollo::cyber::service_discovery::Manager::CreateSubscriber |
( |
RtpsParticipant * |
participant | ) |
|
|
protected |
◆ Dispose()
virtual void apollo::cyber::service_discovery::Manager::Dispose |
( |
const ChangeMsg & |
msg | ) |
|
|
protectedpure virtual |
◆ IsFromSameProcess()
bool apollo::cyber::service_discovery::Manager::IsFromSameProcess |
( |
const ChangeMsg & |
msg | ) |
|
|
protected |
◆ Join()
bool apollo::cyber::service_discovery::Manager::Join |
( |
const RoleAttributes & |
attr, |
|
|
RoleType |
role, |
|
|
bool |
need_publish = true |
|
) |
| |
Join the topology.
- Parameters
-
attr | is the attributes that will be sent to other Manager(include ourselves) |
role | is one of RoleType enum |
- Returns
- true if Join topology successfully
-
false if Join topology failed
◆ Leave()
bool apollo::cyber::service_discovery::Manager::Leave |
( |
const RoleAttributes & |
attr, |
|
|
RoleType |
role |
|
) |
| |
Leave the topology.
- Parameters
-
attr | is the attributes that will be sent to other Manager(include ourselves) |
role | if one of RoleType enum. |
- Returns
- true if Leave topology successfully
-
false if Leave topology failed
◆ NeedPublish()
virtual bool apollo::cyber::service_discovery::Manager::NeedPublish |
( |
const ChangeMsg & |
msg | ) |
const |
|
protectedvirtual |
◆ Notify()
void apollo::cyber::service_discovery::Manager::Notify |
( |
const ChangeMsg & |
msg | ) |
|
|
protected |
◆ OnRemoteChange()
void apollo::cyber::service_discovery::Manager::OnRemoteChange |
( |
const std::string & |
msg_str | ) |
|
|
protected |
◆ OnTopoModuleLeave()
virtual void apollo::cyber::service_discovery::Manager::OnTopoModuleLeave |
( |
const std::string & |
host_name, |
|
|
int |
process_id |
|
) |
| |
|
pure virtual |
Called when a process' topology manager instance leave.
- Parameters
-
host_name | is the process's host's name |
process_id | is the process' id |
◆ Publish()
bool apollo::cyber::service_discovery::Manager::Publish |
( |
const ChangeMsg & |
msg | ) |
|
|
protected |
◆ RemoveChangeListener()
void apollo::cyber::service_discovery::Manager::RemoveChangeListener |
( |
const ChangeConnection & |
conn | ) |
|
Remove our listener for topology change.
- Parameters
-
conn | is the return value of AddChangeListener |
◆ Shutdown()
virtual void apollo::cyber::service_discovery::Manager::Shutdown |
( |
| ) |
|
|
virtual |
◆ StartDiscovery()
bool apollo::cyber::service_discovery::Manager::StartDiscovery |
( |
RtpsParticipant * |
participant | ) |
|
Startup topology discovery.
- Parameters
-
participant | is used to create rtps Publisher and Subscriber |
- Returns
- true if start successfully
-
false if start fail
◆ StopDiscovery()
void apollo::cyber::service_discovery::Manager::StopDiscovery |
( |
| ) |
|
◆ allowed_role_
int apollo::cyber::service_discovery::Manager::allowed_role_ |
|
protected |
◆ change_type_
ChangeType apollo::cyber::service_discovery::Manager::change_type_ |
|
protected |
◆ channel_name_
std::string apollo::cyber::service_discovery::Manager::channel_name_ |
|
protected |
◆ host_name_
std::string apollo::cyber::service_discovery::Manager::host_name_ |
|
protected |
◆ is_discovery_started_
std::atomic<bool> apollo::cyber::service_discovery::Manager::is_discovery_started_ |
|
protected |
◆ is_shutdown_
std::atomic<bool> apollo::cyber::service_discovery::Manager::is_shutdown_ |
|
protected |
◆ listener_
◆ lock_
std::mutex apollo::cyber::service_discovery::Manager::lock_ |
|
protected |
◆ process_id_
int apollo::cyber::service_discovery::Manager::process_id_ |
|
protected |
◆ publisher_
eprosima::fastrtps::Publisher* apollo::cyber::service_discovery::Manager::publisher_ |
|
protected |
◆ signal_
ChangeSignal apollo::cyber::service_discovery::Manager::signal_ |
|
protected |
◆ subscriber_
eprosima::fastrtps::Subscriber* apollo::cyber::service_discovery::Manager::subscriber_ |
|
protected |
The documentation for this class was generated from the following file:
- cyber/service_discovery/specific_manager/manager.h