Skip to content

iox::popo::BasePort🔗

this class is the base for all ports. it is constructed from a member pointer and is only movable. only movable rational: a port has only one member, a pointer to its data. if a port is copied then both ports would work on the same data even though these are two independent copies. this would case a weird shared state, race conditions and so on More...

#include <base_port.hpp>

Inherited by iox::popo::ApplicationPort, iox::popo::ClientPortRouDi, iox::popo::ClientPortUser, iox::popo::InterfacePort, iox::popo::PublisherPortRouDi, iox::popo::PublisherPortUser, iox::popo::ServerPortRouDi, iox::popo::ServerPortUser, iox::popo::SubscriberPortRouDi, iox::popo::SubscriberPortUser

Public Types🔗

Name
using BasePortData MemberType_t

Public Functions🔗

Name
BasePort(MemberType_t *const basePortDataPtr)
BasePort(const BasePort & other)
BasePort & operator=(const BasePort & )
BasePort(BasePort && )
BasePort & operator=(BasePort && )
virtual ~BasePort() =default
operator bool() const
a port can be constructed from a nullptr, additionally it also can be moved and in these cases the member methods would work on a nullptr. to circumvent this problem
capro::ServiceDescription getCaProServiceDescription() const
Reads Type of actual CaPro Port (publisher/subscriber...)
RuntimeName_t getRuntimeName() const
Gets name of the application's runtime for the active port.
UniquePortId getUniqueID() const
Gets Id of the active port.
NodeName_t getNodeName() const
returns node name for the active port
void destroy()
Indicate that this port can be destroyed.
bool toBeDestroyed() const
Checks whether port can be destroyed.

Protected Functions🔗

Name
const MemberType_t * getMembers() const
MemberType_t * getMembers()

Detailed Description🔗

class iox::popo::BasePort;

this class is the base for all ports. it is constructed from a member pointer and is only movable. only movable rational: a port has only one member, a pointer to its data. if a port is copied then both ports would work on the same data even though these are two independent copies. this would case a weird shared state, race conditions and so on

before using a port it is, depending on the use case, important to verify that the port member pointers are set

auto port = std::move(GetPortFromSomewhereElse());
if ( port ) {
    // do stuff
}

Public Types Documentation🔗

using MemberType_t🔗

using iox::popo::BasePort::MemberType_t =  BasePortData;

Public Functions Documentation🔗

function BasePort🔗

explicit BasePort(
    MemberType_t *const basePortDataPtr
)

function BasePort🔗

BasePort(
    const BasePort & other
)

function operator=🔗

BasePort & operator=(
    const BasePort & 
)

function BasePort🔗

BasePort(
    BasePort && 
)

function operator=🔗

BasePort & operator=(
    BasePort && 
)

function ~BasePort🔗

virtual ~BasePort() =default

function operator bool🔗

operator bool() const

a port can be constructed from a nullptr, additionally it also can be moved and in these cases the member methods would work on a nullptr. to circumvent this problem

Return: if the memberpointer is not null it returns true, otherwise false

function getCaProServiceDescription🔗

capro::ServiceDescription getCaProServiceDescription() const

Reads Type of actual CaPro Port (publisher/subscriber...)

Return: m_portType Type of Port in struct BasePortType

function getRuntimeName🔗

RuntimeName_t getRuntimeName() const

Gets name of the application's runtime for the active port.

Return: runtime name as String

function getUniqueID🔗

UniquePortId getUniqueID() const

Gets Id of the active port.

Return: UniqueId name as Integer

function getNodeName🔗

NodeName_t getNodeName() const

returns node name for the active port

Return: node name as a string

function destroy🔗

void destroy()

Indicate that this port can be destroyed.

function toBeDestroyed🔗

bool toBeDestroyed() const

Checks whether port can be destroyed.

Return: true if it shall be destroyed, false if not

Protected Functions Documentation🔗

function getMembers🔗

inline const MemberType_t * getMembers() const

function getMembers🔗

MemberType_t * getMembers()

Updated on 17 June 2021 at 11:15:27 CEST