Class PortPool

Class Documentation

class PortPool

Public Functions

PortPool(PortPoolData &portPoolData) noexcept
virtual ~PortPool() noexcept = default
cxx::vector<PublisherPortRouDiType::MemberType_t*, MAX_PUBLISHERS> getPublisherPortDataList() noexcept

Todo:

don’t create the vector with each call but only when the data really change there could be a member “cxx::vector<popo::PublisherPortData* m_publisherPorts;” and publisherPorts() would just update this member if the publisher ports actually changed

cxx::vector<SubscriberPortType::MemberType_t*, MAX_SUBSCRIBERS> getSubscriberPortDataList() noexcept
cxx::vector<popo::ClientPortData*, MAX_CLIENTS> getClientPortDataList() noexcept
cxx::vector<popo::ServerPortData*, MAX_SERVERS> getServerPortDataList() noexcept
cxx::vector<popo::InterfacePortData*, MAX_INTERFACE_NUMBER> getInterfacePortDataList() noexcept
cxx::vector<runtime::NodeData*, MAX_NODE_NUMBER> getNodeDataList() noexcept
cxx::vector<popo::ConditionVariableData*, MAX_NUMBER_OF_CONDITION_VARIABLES> getConditionVariableDataList() noexcept
cxx::expected<PublisherPortRouDiType::MemberType_t*, PortPoolError> addPublisherPort(const capro::ServiceDescription &serviceDescription, mepoo::MemoryManager *const memoryManager, const RuntimeName_t &runtimeName, const popo::PublisherOptions &publisherOptions, const mepoo::MemoryInfo &memoryInfo = mepoo::MemoryInfo()) noexcept
cxx::expected<SubscriberPortType::MemberType_t*, PortPoolError> addSubscriberPort(const capro::ServiceDescription &serviceDescription, const RuntimeName_t &runtimeName, const popo::SubscriberOptions &subscriberOptions, const mepoo::MemoryInfo &memoryInfo = mepoo::MemoryInfo()) noexcept
template<typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData *constructSubscriber(const capro::ServiceDescription &serviceDescription, const RuntimeName_t &runtimeName, const popo::SubscriberOptions &subscriberOptions, const mepoo::MemoryInfo &memoryInfo) noexcept
template<typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData *constructSubscriber(const capro::ServiceDescription &serviceDescription, const RuntimeName_t &runtimeName, const popo::SubscriberOptions &subscriberOptions, const mepoo::MemoryInfo &memoryInfo) noexcept
cxx::expected<popo::ClientPortData*, PortPoolError> addClientPort(const capro::ServiceDescription &serviceDescription, mepoo::MemoryManager *const memoryManager, const RuntimeName_t &runtimeName, const popo::ClientOptions &clientOptions, const mepoo::MemoryInfo &memoryInfo = mepoo::MemoryInfo()) noexcept

Adds a ClientPortData to the internal pool and returns a pointer for further usage.

Parameters:
  • serviceDescription[in] for the new client port

  • memoryManager[in] to acquire chunks for the requests

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

  • clientOptions[in] for the new client port

  • memoryInfo[in] for the new client port

Returns:

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

cxx::expected<popo::ServerPortData*, PortPoolError> addServerPort(const capro::ServiceDescription &serviceDescription, mepoo::MemoryManager *const memoryManager, const RuntimeName_t &runtimeName, const popo::ServerOptions &serverOptions, const mepoo::MemoryInfo &memoryInfo = mepoo::MemoryInfo()) noexcept

Adds a ServerPortData to the internal pool and returns a pointer for further usage.

Parameters:
  • serviceDescription[in] for the new server port

  • memoryManager[in] to acquire chunks for the responses

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

  • serverOptions[in] for the new server port

  • memoryInfo[in] for the new server port

Returns:

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

cxx::expected<popo::InterfacePortData*, PortPoolError> addInterfacePort(const RuntimeName_t &runtimeName, const capro::Interfaces interface) noexcept
cxx::expected<runtime::NodeData*, PortPoolError> addNodeData(const RuntimeName_t &runtimeName, const NodeName_t &nodeName, const uint64_t nodeDeviceIdentifier) noexcept
cxx::expected<popo::ConditionVariableData*, PortPoolError> addConditionVariableData(const RuntimeName_t &runtimeName) noexcept
void removePublisherPort(const PublisherPortRouDiType::MemberType_t *const portData) noexcept

Removes a PublisherPortData from the internal pool.

Note

after this call the provided PublisherPortData is no longer available for usage

Parameters:

portData[in] is a pointer to the PublisherPortData to be removed

void removeSubscriberPort(const SubscriberPortType::MemberType_t *const portData) noexcept

Removes a SubscriberPortData from the internal pool.

Note

after this call the provided SubscriberPortData is no longer available for usage

Parameters:

portData[in] is a pointer to the SubscriberPortData to be removed

void removeClientPort(const popo::ClientPortData *const portData) noexcept

Removes a ClientPortData from the internal pool.

Note

after this call the provided ClientPortData is no longer available for usage

Parameters:

portData[in] is a pointer to the ClientPortData to be removed

void removeServerPort(const popo::ServerPortData *const portData) noexcept

Removes a ServerPortData from the internal pool.

Note

after this call the provided ServerPortData is no longer available for usage

Parameters:

portData[in] is a pointer to the ServerPortData to be removed

void removeInterfacePort(const popo::InterfacePortData *const portData) noexcept

Removes a InterfacePortData from the internal pool.

Note

after this call the provided InterfacePortData is no longer available for usage

Parameters:

portData[in] is a pointer to the InterfacePortData to be removed

void removeNodeData(const runtime::NodeData *const nodeData) noexcept

Removes a NodeData from the internal pool.

Note

after this call the provided NodeData is no longer available for usage

Parameters:

nodeData[in] is a pointer to the NodeData to be removed

void removeConditionVariableData(const popo::ConditionVariableData *const conditionVariableData) noexcept

Removes a ConditionVariableData from the internal pool.

Note

after this call the provided ConditionVariableData is no longer available for usage

Parameters:

conditionVariableData[in] is a pointer to the ConditionVariableData to be removed