The PublisherImpl class implements the typed publisher API.
More...
#include <iceoryx_posh/internal/popo/publisher_impl.hpp>
template<typename T, typename H = mepoo::NoUserHeader, typename BasePublisherType = BasePublisher<>>
class iox::popo::PublisherImpl< T, H, BasePublisherType >
The PublisherImpl class implements the typed publisher API.
- Note
- Not intended for public usage! Use the
Publisher
instead!
◆ loan()
template<typename T , typename H = mepoo::NoUserHeader, typename BasePublisherType = BasePublisher<>>
template<typename... Args>
loan Get a sample from loaned shared memory and consctruct the data with the given arguments.
- Parameters
-
args | Arguments used to construct the data. |
- Returns
- An instance of the sample that resides in shared memory or an error if unable ot allocate memory to loan.
The loaned sample is automatically released when it goes out of scope.
◆ publish()
template<typename T , typename H = mepoo::NoUserHeader, typename BasePublisherType = BasePublisher<>>
publish Publishes the given sample and then releases its loan.
- Parameters
-
sample | The sample to publish. |
◆ publishCopyOf()
template<typename T , typename H = mepoo::NoUserHeader, typename BasePublisherType = BasePublisher<>>
publishCopyOf Copy the provided value into a loaned shared memory chunk and publish it.
- Parameters
-
- Returns
- Error if unable to allocate memory to loan.
◆ publishResultOf()
template<typename T , typename H = mepoo::NoUserHeader, typename BasePublisherType = BasePublisher<>>
template<typename Callable , typename... ArgTypes>
cxx::expected<AllocationError> iox::popo::PublisherImpl< T, H, BasePublisherType >::publishResultOf |
( |
Callable |
c, |
|
|
ArgTypes... |
args |
|
) |
| |
|
noexcept |
publishResultOf Loan a sample from memory, execute the provided callable to write to it, then publish it.
- Parameters
-
c | Callable with the signature void(T*, ArgTypes...) that write's it's result to T*. |
args | The arguments of the callable. |
- Returns
- Error if unable to allocate memory to loan.
The documentation for this class was generated from the following file: