Class PortManager

Class Documentation

class PortManager

Public Types

using PortConfigInfo = iox::runtime::PortConfigInfo

Public Functions

PortManager(RouDiMemoryInterface *roudiMemoryInterface) noexcept
virtual ~PortManager() noexcept = default
void stopPortIntrospection() noexcept

Todo:

Remove this later

void doDiscovery() noexcept
cxx::expected<PublisherPortRouDiType::MemberType_t*, PortPoolError> acquirePublisherPortData(const capro::ServiceDescription &service, const popo::PublisherOptions &publisherOptions, const RuntimeName_t &runtimeName, mepoo::MemoryManager *const payloadDataSegmentMemoryManager, const PortConfigInfo &portConfigInfo) noexcept
PublisherPortRouDiType::MemberType_t *acquireInternalPublisherPortData(const capro::ServiceDescription &service, const popo::PublisherOptions &publisherOptions, mepoo::MemoryManager *const payloadDataSegmentMemoryManager) noexcept
cxx::expected<SubscriberPortType::MemberType_t*, PortPoolError> acquireSubscriberPortData(const capro::ServiceDescription &service, const popo::SubscriberOptions &subscriberOptions, const RuntimeName_t &runtimeName, const PortConfigInfo &portConfigInfo) noexcept
cxx::expected<popo::ClientPortData*, PortPoolError> acquireClientPortData(const capro::ServiceDescription &service, const popo::ClientOptions &clientOptions, const RuntimeName_t &runtimeName, mepoo::MemoryManager *const payloadDataSegmentMemoryManager, const PortConfigInfo &portConfigInfo) noexcept

Acquires a ClientPortData for further usage.

Parameters:
  • service[in] is the ServiceDescription for the new client port

  • clientOptions[in] for the new client port

  • runtimeName[in] of the runtime the new client port belongs to

  • payloadDataSegmentMemoryManager[in] to acquire chunks for the requests

  • portConfigInfo[in] for the new client port

Returns:

on success a pointer to a ClientPortData; on error a PortPoolError

cxx::expected<popo::ServerPortData*, PortPoolError> acquireServerPortData(const capro::ServiceDescription &service, const popo::ServerOptions &serverOptions, const RuntimeName_t &runtimeName, mepoo::MemoryManager *const payloadDataSegmentMemoryManager, const PortConfigInfo &portConfigInfo) noexcept

Acquires a ServerPortData for further usage.

Parameters:
  • service[in] is the ServiceDescription for the new server port

  • serverOptions[in] for the new server port

  • runtimeName[in] of the runtime the new server port belongs to

  • payloadDataSegmentMemoryManager[in] to acquire chunks for the requests

  • portConfigInfo[in] for the new server port

Returns:

on success a pointer to a ServerPortData; on error a PortPoolError

popo::InterfacePortData *acquireInterfacePortData(capro::Interfaces interface, const RuntimeName_t &runtimeName, const NodeName_t &nodeName = {""}) noexcept
cxx::expected<runtime::NodeData*, PortPoolError> acquireNodeData(const RuntimeName_t &runtimeName, const NodeName_t &nodeName) noexcept
cxx::expected<popo::ConditionVariableData*, PortPoolError> acquireConditionVariableData(const RuntimeName_t &runtimeName) noexcept
void unblockProcessShutdown(const RuntimeName_t &runtimeName) noexcept

Used to unblock potential locks in the shutdown phase of a process.

Parameters:

name[in] of the process runtime which is about to shut down

void unblockRouDiShutdown() noexcept

Used to unblock potential locks in the shutdown phase of RouDi.

void deletePortsOfProcess(const RuntimeName_t &runtimeName) noexcept

Protected Functions

void makeAllPublisherPortsToStopOffer() noexcept
void destroyPublisherPort(PublisherPortRouDiType::MemberType_t *const publisherPortData) noexcept
void destroySubscriberPort(SubscriberPortType::MemberType_t *const subscriberPortData) noexcept
void handlePublisherPorts() noexcept
void doDiscoveryForPublisherPort(PublisherPortRouDiType &publisherPort) noexcept
void handleSubscriberPorts() noexcept
void doDiscoveryForSubscriberPort(SubscriberPortType &subscriberPort) noexcept
void destroyClientPort(popo::ClientPortData *const clientPortData) noexcept
void handleClientPorts() noexcept
void doDiscoveryForClientPort(popo::ClientPortRouDi &clientPort) noexcept
void makeAllServerPortsToStopOffer() noexcept
void destroyServerPort(popo::ServerPortData *const clientPortData) noexcept
void handleServerPorts() noexcept
void doDiscoveryForServerPort(popo::ServerPortRouDi &serverPort) noexcept
void handleInterfaces() noexcept
void handleNodes() noexcept
void handleConditionVariables() noexcept
bool isCompatiblePubSub(const PublisherPortRouDiType &publisher, const SubscriberPortType &subscriber) const noexcept
bool sendToAllMatchingPublisherPorts(const capro::CaproMessage &message, SubscriberPortType &subscriberSource) noexcept
void sendToAllMatchingSubscriberPorts(const capro::CaproMessage &message, PublisherPortRouDiType &publisherSource) noexcept
bool isCompatibleClientServer(const popo::ServerPortRouDi &server, const popo::ClientPortRouDi &client) const noexcept
void sendToAllMatchingClientPorts(const capro::CaproMessage &message, popo::ServerPortRouDi &serverSource) noexcept
bool sendToAllMatchingServerPorts(const capro::CaproMessage &message, popo::ClientPortRouDi &clientSource) noexcept
void sendToAllMatchingInterfacePorts(const capro::CaproMessage &message) noexcept
void addPublisherToServiceRegistry(const capro::ServiceDescription &service) noexcept
void removePublisherFromServiceRegistry(const capro::ServiceDescription &service) noexcept
void addServerToServiceRegistry(const capro::ServiceDescription &service) noexcept
void removeServerFromServiceRegistry(const capro::ServiceDescription &service) noexcept
template<typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
cxx::optional<RuntimeName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription &service) noexcept
template<typename T, std::enable_if_t< std::is_same< T, iox::build::ManyToManyPolicy >::value > * = nullptr> cxx::optional< RuntimeName_t > doesViolateCommunicationPolicy (const capro::ServiceDescription &service IOX_MAYBE_UNUSED) noexcept
bool isInternal(const capro::ServiceDescription &service) const noexcept
void publishServiceRegistry() const noexcept
const ServiceRegistry &serviceRegistry() const noexcept