The UntypedPublisherImpl class implements the untyped publisher API.
More...
#include <iceoryx_posh/internal/popo/untyped_publisher_impl.hpp>
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: