Skip to content

Commit

Permalink
iox-#27 Add client and server port to PortManager
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Feb 10, 2022
1 parent 0828e0f commit e35218f
Show file tree
Hide file tree
Showing 3 changed files with 332 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ namespace iox
error(PORT_MANAGER__INTROSPECTION_MEMORY_MANAGER_UNAVAILABLE) \
error(PORT_MANAGER__HANDLE_PUBLISHER_PORTS_INVALID_CAPRO_MESSAGE) \
error(PORT_MANAGER__HANDLE_SUBSCRIBER_PORTS_INVALID_CAPRO_MESSAGE) \
error(PORT_MANAGER__HANDLE_CLIENT_PORTS_INVALID_CAPRO_MESSAGE) \
error(PORT_MANAGER__HANDLE_SERVER_PORTS_INVALID_CAPRO_MESSAGE) \
error(PORT_MANAGER__NO_PUBLISHER_PORT_FOR_INTROSPECTIONPORTSERVICE) \
error(PORT_MANAGER__NO_PUBLISHER_PORT_FOR_INTROSPECTIONPORTTHROUGHPUTSERVICE) \
error(PORT_MANAGER__NO_PUBLISHER_PORT_FOR_INTROSPECTIONCHANGINGDATASERVICE) \
Expand Down
37 changes: 37 additions & 0 deletions iceoryx_posh/include/iceoryx_posh/internal/roudi/port_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@
#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iceoryx_posh/internal/capro/capro_message.hpp"
#include "iceoryx_posh/internal/mepoo/memory_manager.hpp"
#include "iceoryx_posh/internal/popo/ports/client_port_roudi.hpp"
#include "iceoryx_posh/internal/popo/ports/client_port_user.hpp"
#include "iceoryx_posh/internal/popo/ports/interface_port.hpp"
#include "iceoryx_posh/internal/popo/ports/publisher_port_roudi.hpp"
#include "iceoryx_posh/internal/popo/ports/publisher_port_user.hpp"
#include "iceoryx_posh/internal/popo/ports/server_port_roudi.hpp"
#include "iceoryx_posh/internal/popo/ports/server_port_user.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_multi_producer.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_single_producer.hpp"
#include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
Expand Down Expand Up @@ -76,6 +80,20 @@ class PortManager
const RuntimeName_t& runtimeName,
const PortConfigInfo& portConfigInfo) noexcept;

cxx::expected<popo::ClientPortRouDi::MemberType_t*, PortPoolError>
acquireClientPortData(const capro::ServiceDescription& service,
const popo::ClientOptions& clientOptions,
const RuntimeName_t& runtimeName,
mepoo::MemoryManager* const payloadDataSegmentMemoryManager,
const PortConfigInfo& portConfigInfo) noexcept;

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

popo::InterfacePortData* acquireInterfacePortData(capro::Interfaces interface,
const RuntimeName_t& runtimeName,
const NodeName_t& nodeName = {""}) noexcept;
Expand Down Expand Up @@ -115,6 +133,20 @@ class PortManager

void doDiscoveryForSubscriberPort(SubscriberPortType& subscriberPort) noexcept;

void destroyClientPort(popo::ClientPortRouDi::MemberType_t* const clientPortData) noexcept;

void handleClientPorts() noexcept;

void doDiscoveryForClientPort(popo::ClientPortRouDi& clientPort) noexcept;

void makeAllServerPortsToStopOffer() noexcept;

void destroyServerPort(popo::ServerPortRouDi::MemberType_t* const clientPortData) noexcept;

void handleServerPorts() noexcept;

void doDiscoveryForServerPort(popo::ServerPortRouDi& serverPort) noexcept;

void handleInterfaces() noexcept;

void handleNodes() noexcept;
Expand All @@ -127,6 +159,11 @@ class PortManager
void sendToAllMatchingSubscriberPorts(const capro::CaproMessage& message,
PublisherPortRouDiType& publisherSource) 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 addEntryToServiceRegistry(const capro::ServiceDescription& service) noexcept;
Expand Down
Loading

0 comments on commit e35218f

Please sign in to comment.