17 #ifndef IOX_POSH_ROUDI_PORT_MANAGER_HPP
18 #define IOX_POSH_ROUDI_PORT_MANAGER_HPP
20 #include "iceoryx_posh/iceoryx_posh_config.hpp"
21 #include "iceoryx_posh/iceoryx_posh_types.hpp"
22 #include "iceoryx_posh/internal/capro/capro_message.hpp"
23 #include "iceoryx_posh/internal/mepoo/memory_manager.hpp"
24 #include "iceoryx_posh/internal/popo/ports/application_port.hpp"
25 #include "iceoryx_posh/internal/popo/ports/interface_port.hpp"
26 #include "iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp"
27 #include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp"
28 #include "iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp"
29 #include "iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp"
30 #include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
31 #include "iceoryx_posh/internal/roudi/introspection/port_introspection.hpp"
32 #include "iceoryx_posh/internal/roudi/service_registry.hpp"
33 #include "iceoryx_posh/internal/runtime/ipc_message.hpp"
34 #include "iceoryx_posh/internal/runtime/node_data.hpp"
35 #include "iceoryx_posh/mepoo/chunk_header.hpp"
36 #include "iceoryx_posh/mepoo/memory_info.hpp"
37 #include "iceoryx_posh/mepoo/mepoo_config.hpp"
38 #include "iceoryx_posh/roudi/memory/roudi_memory_interface.hpp"
39 #include "iceoryx_posh/roudi/port_pool.hpp"
40 #include "iceoryx_posh/runtime/port_config_info.hpp"
41 #include "iceoryx_utils/cxx/optional.hpp"
42 #include "iceoryx_utils/cxx/type_traits.hpp"
43 #include "iceoryx_utils/internal/posix_wrapper/shared_memory_object.hpp"
44 #include "iceoryx_utils/posix_wrapper/posix_access_rights.hpp"
52 capro::Interfaces StringToCaProInterface(
const capro::IdString_t& str) noexcept;
65 void doDiscovery() noexcept;
68 acquirePublisherPortData(const capro::ServiceDescription& service,
69 const popo::PublisherOptions& publisherOptions,
70 const RuntimeName_t& runtimeName,
71 mepoo::MemoryManager* const payloadDataSegmentMemoryManager,
74 cxx::expected<SubscriberPortType::MemberType_t*, PortPoolError>
75 acquireSubscriberPortData(const capro::ServiceDescription& service,
76 const popo::SubscriberOptions& subscriberOptions,
77 const RuntimeName_t& runtimeName,
80 popo::InterfacePortData* acquireInterfacePortData(capro::Interfaces interface,
81 const RuntimeName_t& runtimeName,
82 const NodeName_t& nodeName = {
""}) noexcept;
86 cxx::expected<runtime::NodeData*, PortPoolError> acquireNodeData(
const RuntimeName_t& runtimeName,
87 const NodeName_t& nodeName) noexcept;
89 cxx::expected<popo::ConditionVariableData*, PortPoolError>
90 acquireConditionVariableData(
const RuntimeName_t& runtimeName) noexcept;
99 void deletePortsOfProcess(const RuntimeName_t& runtimeName) noexcept;
101 const std::atomic<uint64_t>* serviceRegistryChangeCounter() noexcept;
102 runtime::IpcMessage findService(const capro::ServiceDescription& service) noexcept;
105 void makeAllPublisherPortsToStopOffer() noexcept;
109 void destroySubscriberPort(SubscriberPortType::MemberType_t* const subscriberPortData) noexcept;
111 void handlePublisherPorts() noexcept;
115 void handleSubscriberPorts() noexcept;
117 void doDiscoveryForSubscriberPort(SubscriberPortType& subscriberPort) noexcept;
119 void handleInterfaces() noexcept;
121 void handleApplications() noexcept;
123 void handleNodes() noexcept;
125 void handleConditionVariables() noexcept;
127 bool sendToAllMatchingPublisherPorts(const capro::CaproMessage& message,
128 SubscriberPortType& subscriberSource) noexcept;
130 void sendToAllMatchingSubscriberPorts(const capro::CaproMessage& message,
133 void sendToAllMatchingInterfacePorts(const capro::CaproMessage& message) noexcept;
135 void addEntryToServiceRegistry(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept;
136 void removeEntryFromServiceRegistry(const capro::IdString_t& service, const capro::IdString_t& instance) noexcept;
138 template <typename T, std::enable_if_t<std::is_same<T,
iox::build::OneToManyPolicy>::value>* =
nullptr>
139 cxx::optional<RuntimeName_t>
140 doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const noexcept;
142 template <typename T, std::enable_if_t<std::is_same<T,
iox::build::ManyToManyPolicy>::value>* =
nullptr>
143 cxx::optional<RuntimeName_t>
144 doesViolateCommunicationPolicy(const capro::ServiceDescription& service IOX_MAYBE_UNUSED) const noexcept;
149 ServiceRegistry m_serviceRegistry;
155 #include "iceoryx_posh/internal/roudi/port_manager.inl"
The PublisherPortRouDi provides the API for accessing a publisher port from the RouDi middleware daem...
Definition: publisher_port_roudi.hpp:36
Definition: port_manager.hpp:55
void unblockProcessShutdown(const RuntimeName_t &runtimeName) noexcept
Used to unblock potential locks in the shutdown phase of a process.
void stopPortIntrospection() noexcept
void unblockRouDiShutdown() noexcept
Used to unblock potential locks in the shutdown phase of RouDi.
Definition: port_pool.hpp:55
Definition: roudi_memory_interface.hpp:36
PortIntrospection< PublisherPortUserType, SubscriberPortUserType > PortIntrospectionType
typedef for the templated port introspection class that is used by RouDi for the actual port introspe...
Definition: port_introspection.hpp:330
Definition: service_description.hpp:29
Definition: application_port_data.hpp:29
Stores information necessary to create the right type of port on RouDi side. Different types of ports...
Definition: port_config_info.hpp:32