18#ifndef IOX_POSH_POPO_TYPED_PUBLISHER_IMPL_HPP
19#define IOX_POSH_POPO_TYPED_PUBLISHER_IMPL_HPP
21#include "iceoryx_hoofs/cxx/type_traits.hpp"
22#include "iceoryx_posh/internal/popo/base_publisher.hpp"
23#include "iceoryx_posh/internal/popo/publisher_interface.hpp"
24#include "iceoryx_posh/internal/popo/typed_port_api_trait.hpp"
25#include "iceoryx_posh/popo/sample.hpp"
33template <
typename T,
typename H = mepoo::NoUserHeader,
typename BasePublisherType = BasePublisher<>>
36 using DataTypeAssert =
typename TypedPortApiTrait<T>::Assert;
37 using HeaderTypeAssert =
typename TypedPortApiTrait<H>::Assert;
55 template <
typename... Args>
56 cxx::expected<Sample<T, H>, AllocationError>
loan(Args&&... args)
noexcept;
76 template <
typename Callable,
typename... ArgTypes>
77 cxx::expected<AllocationError>
publishResultOf(Callable c, ArgTypes... args)
noexcept;
80 using BasePublisherType::port;
85 cxx::expected<Sample<T, H>, AllocationError> loanSample() noexcept;
87 using PublisherSampleDeleter = SampleDeleter<typename BasePublisherType::PortType>;
88 PublisherSampleDeleter m_sampleDeleter{
port()};
94#include "iceoryx_posh/internal/popo/publisher_impl.inl"
class for the identification of a communication event including information on the service,...
Definition: service_description.hpp:81
const port_t & port() const noexcept
port
The PublisherImpl class implements the typed publisher API.
Definition: publisher_impl.hpp:35
cxx::expected< AllocationError > publishResultOf(Callable c, ArgTypes... args) noexcept
publishResultOf Loan a sample from memory, execute the provided callable to write to it,...
cxx::expected< AllocationError > publishCopyOf(const T &val) noexcept
publishCopyOf Copy the provided value into a loaned shared memory chunk and publish it.
void publish(Sample< T, H > &&sample) noexcept override
publish Publishes the given sample and then releases its loan.
cxx::expected< Sample< T, H >, AllocationError > loan(Args &&... args) noexcept
loan Get a sample from loaned shared memory and consctruct the data with the given arguments.
Definition: sample.hpp:32
The Sample class is a mutable abstraction over types which are written to loaned shared memory....
Definition: sample.hpp:38
This struct is used to configure the publisher.
Definition: publisher_options.hpp:33