The UntypedPublisherImpl class implements the untyped publisher API.
More...
#include <iceoryx_posh/internal/popo/untyped_publisher_impl.hpp>
|
|
| UntypedPublisherImpl (const capro::ServiceDescription &service, const PublisherOptions &publisherOptions=PublisherOptions()) |
|
| UntypedPublisherImpl (const UntypedPublisherImpl &other)=delete |
|
UntypedPublisherImpl & | operator= (const UntypedPublisherImpl &)=delete |
|
| UntypedPublisherImpl (UntypedPublisherImpl &&rhs)=delete |
|
UntypedPublisherImpl & | operator= (UntypedPublisherImpl &&rhs)=delete |
| 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.
|
| 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.
|
|
| BasePublisher (const BasePublisher &other)=delete |
|
BasePublisher & | operator= (const BasePublisher &)=delete |
|
| BasePublisher (BasePublisher &&rhs)=delete |
|
BasePublisher & | operator= (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
|
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!
◆ 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
-
| usePayloadSize | The expected user-payload size of the chunk. |
| userPayloadAlignment | The 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<>>
Publish the provided memory chunk.
- Parameters
-
| userPayload | Pointer 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<>>
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.
The documentation for this class was generated from the following file: