Skip to content


The Publisher class for the publish-subscribe messaging pattern in iceoryx. More...

#include <iceoryx_posh/popo/publisher.hpp>

Inherits from iox::popo::PublisherImpl< T, mepoo::NoUserHeader >, iox::popo::BasePublisher<>, iox::popo::PublisherInterface< T, mepoo::NoUserHeader >

Additional inherited members🔗

Public Functions inherited from iox::popo::PublisherImpl< T, mepoo::NoUserHeader >

PublisherImpl(const capro::ServiceDescription & service, const PublisherOptions & publisherOptions =PublisherOptions())
PublisherImpl(const PublisherImpl & other)
PublisherImpl & operator=(const PublisherImpl & )
PublisherImpl(PublisherImpl && rhs)
PublisherImpl & operator=(PublisherImpl && rhs)
virtual ~PublisherImpl() =default
template <typename... Args>
cxx::expected< Sample< T, H >, AllocationError >
loan(Args &&... args)
loan Get a sample from loaned shared memory and consctruct the data with the given arguments.
void publish(Sample< T, H > && sample) override
publish Publishes the given sample and then releases its loan.
cxx::expected< AllocationError > publishCopyOf(const T & val)
publishCopyOf Copy the provided value into a loaned shared memory chunk and publish it.
template <typename Callable ,typename... ArgTypes>
cxx::expected< AllocationError >
publishResultOf(Callable c, ArgTypes... args)
publishResultOf Loan a sample from memory, execute the provided callable to write to it, then publish it.

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

using port_t PortType

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

BasePublisher(const BasePublisher & other)
BasePublisher & operator=(const BasePublisher & )
BasePublisher(BasePublisher && rhs)
BasePublisher & operator=(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
bool hasSubscribers() const

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

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

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

port_t m_port

Detailed Description🔗

template <typename T ,
typename H  =mepoo::NoUserHeader>
class iox::popo::Publisher;

The Publisher class for the publish-subscribe messaging pattern in iceoryx.


  • T user payload type
  • H user header type

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