Skip to content

iox::popo::UntypedPublisherImpl🔗

The UntypedPublisherImpl class implements the untyped publisher API. More...

#include <iceoryx_posh/internal/popo/untyped_publisher_impl.hpp>

Inherits from iox::popo::BasePublisher<>

Public Functions🔗

Name
UntypedPublisherImpl(const capro::ServiceDescription & service, const PublisherOptions & publisherOptions =PublisherOptions())
UntypedPublisherImpl(const UntypedPublisherImpl & other)
UntypedPublisherImpl & operator=(const UntypedPublisherImpl & )
UntypedPublisherImpl(UntypedPublisherImpl && rhs)
UntypedPublisherImpl & operator=(UntypedPublisherImpl && rhs)
virtual ~UntypedPublisherImpl() =default
cxx::expected< void *, AllocationError > loan(const uint32_t userPayloadSize, const uint32_t userPayloadAlignment =iox::CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT, const uint32_t userHeaderSize =iox::CHUNK_NO_USER_HEADER_SIZE, const uint32_t userHeaderAlignment =iox::CHUNK_NO_USER_HEADER_ALIGNMENT)
Get a chunk from loaned shared memory.
void publish(void *const userPayload)
Publish the provided memory chunk.
void release(void *const userPayload)
Releases the ownership of the chunk provided by the user-payload pointer.

Additional inherited members🔗

Public Types inherited from iox::popo::BasePublisher<>

Name
using port_t PortType

Public Functions inherited from iox::popo::BasePublisher<>

Name
BasePublisher(const BasePublisher & other)
BasePublisher(BasePublisher && rhs)
virtual ~BasePublisher()
uid_t getUid() const
uid Get the UID of the publisher.
capro::ServiceDescription getServiceDescription() const
getServiceDescription Get the service description of the publisher.
void offer()
offer Offer the service to be subscribed to.
void stopOffer()
stopOffer Stop offering the service.
bool isOffered() const
isOffered
bool hasSubscribers() const
hasSubscribers

Protected Functions inherited from iox::popo::BasePublisher<>

Name
BasePublisher() =default
BasePublisher(const capro::ServiceDescription & service, const PublisherOptions & publisherOptions)
const port_t & port() const
port
port_t & port()
port

Protected Attributes inherited from iox::popo::BasePublisher<>

Name
port_t m_port

Detailed Description🔗

template <typename BasePublisherType  =BasePublisher<>>
class iox::popo::UntypedPublisherImpl;

The UntypedPublisherImpl class implements the untyped publisher API.

Note: Not intended for public usage! Use the [UntypedPublisher](/v2.0.5/API-reference/posh/Classes/classiox_1_1popo_1_1UntypedPublisher/) instead!

Public Functions Documentation🔗

function UntypedPublisherImpl🔗

explicit UntypedPublisherImpl(
    const capro::ServiceDescription & service,
    const PublisherOptions & publisherOptions =PublisherOptions()
)

function UntypedPublisherImpl🔗

UntypedPublisherImpl(
    const UntypedPublisherImpl & other
)

function operator=🔗

UntypedPublisherImpl & operator=(
    const UntypedPublisherImpl & 
)

function UntypedPublisherImpl🔗

UntypedPublisherImpl(
    UntypedPublisherImpl && rhs
)

function operator=🔗

UntypedPublisherImpl & operator=(
    UntypedPublisherImpl && rhs
)

function ~UntypedPublisherImpl🔗

virtual ~UntypedPublisherImpl() =default

function loan🔗

cxx::expected< void *, AllocationError > loan(
    const uint32_t userPayloadSize,
    const uint32_t userPayloadAlignment =iox::CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT,
    const uint32_t userHeaderSize =iox::CHUNK_NO_USER_HEADER_SIZE,
    const uint32_t userHeaderAlignment =iox::CHUNK_NO_USER_HEADER_ALIGNMENT
)

Get a chunk from loaned shared memory.

Parameters:

  • usePayloadSize The expected user-payload size of the chunk.
  • userPayloadAlignment The expected user-payload alignment of the chunk.

Return: A pointer to the user-payload of a chunk of memory with the requested size or an AllocationError if no chunk could be loaned.

Note: An AllocationError occurs if no chunk is available in the shared memory.

function publish🔗

void publish(
    void *const userPayload
)

Publish the provided memory chunk.

Parameters:

  • userPayload Pointer to the user-payload of the allocated shared memory chunk.

Return: Error if provided pointer is not a user-payload of a valid memory chunk.

function release🔗

void release(
    void *const userPayload
)

Releases the ownership of the chunk provided by the user-payload pointer.

Parameters:

  • userPayload pointer to the user-payload of the chunk to be released

The userPayload pointer must have been previously provided by loan and not have been already released. The chunk must not be accessed afterwards as its memory may have been reclaimed.


Updated on 18 December 2023 at 13:11:43 CET