iceoryx_doc  1.0.1
Public Member Functions | List of all members
iox::popo::UntypedPublisherImpl< BasePublisher_t > Class Template Reference
Inheritance diagram for iox::popo::UntypedPublisherImpl< BasePublisher_t >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::UntypedPublisherImpl< BasePublisher_t >:
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)=default
 
UntypedPublisherImploperator= (UntypedPublisherImpl &&rhs)=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) noexcept
 Get a chunk from loaned shared memory. More...
 
void publish (void *const userPayload) noexcept
 Publish the provided memory chunk. More...
 
void release (void *const userPayload) noexcept
 Releases the ownership of the chunk provided by the user-payload pointer. More...
 
- 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. More...
 
capro::ServiceDescription getServiceDescription () const noexcept
 getServiceDescription Get the service description of the publisher. More...
 
void offer () noexcept
 offer Offer the service to be subscribed to.
 
void stopOffer () noexcept
 stopOffer Stop offering the service.
 
bool isOffered () const noexcept
 isOffered More...
 
bool hasSubscribers () const noexcept
 hasSubscribers More...
 

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_t & port () const noexcept
 port More...
 
port_t & port () noexcept
 port More...
 
- Protected Attributes inherited from iox::popo::BasePublisher< port_t >
port_t m_port {nullptr}
 

Member Function Documentation

◆ loan()

template<typename BasePublisher_t >
cxx::expected< void *, AllocationError > iox::popo::UntypedPublisherImpl< BasePublisher_t >::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 
)
inlinenoexcept

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 BasePublisher_t >
void iox::popo::UntypedPublisherImpl< BasePublisher_t >::publish ( void *const  userPayload)
inlinenoexcept

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 BasePublisher_t >
void iox::popo::UntypedPublisherImpl< BasePublisher_t >::release ( void *const  userPayload)
inlinenoexcept

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 files: