iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iox::popo::UntypedPublisherImpl< BasePublisherType > Class Template Reference

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

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

Inheritance diagram for iox::popo::UntypedPublisherImpl< BasePublisherType >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::UntypedPublisherImpl< BasePublisherType >:
Collaboration graph
[legend]

Public Member Functions

 UntypedPublisherImpl (const capro::ServiceDescription &service, const PublisherOptions &publisherOptions=PublisherOptions())
 
 UntypedPublisherImpl (const UntypedPublisherImpl &other)=delete
 
UntypedPublisherImploperator= (const UntypedPublisherImpl &)=delete
 
 UntypedPublisherImpl (UntypedPublisherImpl &&rhs)=delete
 
UntypedPublisherImploperator= (UntypedPublisherImpl &&rhs)=delete
 
cxx::expected< void *, AllocationErrorloan (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) noexcept
 Get a chunk from loaned shared memory.
 
void publish (void *const userPayload) noexcept
 Publish the provided memory chunk.
 
void release (void *const userPayload) noexcept
 Releases the ownership of the chunk provided by the user-payload pointer.
 
- Public Member Functions inherited from iox::popo::BasePublisher< port_t >
 BasePublisher (const BasePublisher &other)=delete
 
BasePublisheroperator= (const BasePublisher &)=delete
 
 BasePublisher (BasePublisher &&rhs)=delete
 
BasePublisheroperator= (BasePublisher &&rhs)=delete
 
uid_t getUid () const noexcept
 uid Get the UID of the publisher.
 
capro::ServiceDescription getServiceDescription () const noexcept
 getServiceDescription Get the service description of the publisher.
 
void offer () noexcept
 offer Offer the service to be subscribed to.
 
void stopOffer () noexcept
 stopOffer Stop offering the service.
 
bool isOffered () const noexcept
 isOffered
 
bool hasSubscribers () const noexcept
 hasSubscribers
 

Additional Inherited Members

- Public Types inherited from iox::popo::BasePublisher< port_t >
using PortType = port_t
 
- Protected Member Functions inherited from iox::popo::BasePublisher< port_t >
 BasePublisher (const capro::ServiceDescription &service, const PublisherOptions &publisherOptions)
 
const port_tport () const noexcept
 port
 
port_tport () noexcept
 port
 
- Protected Attributes inherited from iox::popo::BasePublisher< port_t >
port_t m_port {nullptr}
 

Detailed Description

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

The UntypedPublisherImpl class implements the untyped publisher API.

Note
Not intended for public usage! Use the UntypedPublisher instead!

Member Function Documentation

◆ loan()

template<typename BasePublisherType = BasePublisher<>>
cxx::expected< void *, AllocationError > iox::popo::UntypedPublisherImpl< BasePublisherType >::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 
)
noexcept

Get a chunk from loaned shared memory.

Parameters
usePayloadSizeThe expected user-payload size of the chunk.
userPayloadAlignmentThe expected user-payload alignment of the chunk.
Returns
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.

◆ publish()

template<typename BasePublisherType = BasePublisher<>>
void iox::popo::UntypedPublisherImpl< BasePublisherType >::publish ( void *const  userPayload)
noexcept

Publish the provided memory chunk.

Parameters
userPayloadPointer to the user-payload of the allocated shared memory chunk.
Returns
Error if provided pointer is not a user-payload of a valid memory chunk.

◆ release()

template<typename BasePublisherType = BasePublisher<>>
void iox::popo::UntypedPublisherImpl< BasePublisherType >::release ( void *const  userPayload)
noexcept

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

Parameters
userPayloadpointer 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.


The documentation for this class was generated from the following file: