17 #ifndef IOX_POSH_POPO_PORTS_PUBLISHER_PORT_USER_HPP
18 #define IOX_POSH_POPO_PORTS_PUBLISHER_PORT_USER_HPP
20 #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp"
21 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp"
22 #include "iceoryx_posh/internal/popo/ports/base_port.hpp"
23 #include "iceoryx_posh/internal/popo/ports/publisher_port_data.hpp"
24 #include "iceoryx_posh/mepoo/chunk_header.hpp"
25 #include "iceoryx_utils/cxx/expected.hpp"
26 #include "iceoryx_utils/cxx/helplets.hpp"
27 #include "iceoryx_utils/cxx/optional.hpp"
28 #include "iceoryx_utils/error_handling/error_handling.hpp"
43 explicit PublisherPortUser(cxx::not_null<MemberType_t* const> publisherPortDataPtr) noexcept;
60 cxx::expected<mepoo::ChunkHeader*, AllocationError>
62 const uint32_t userPayloadAlignment,
63 const uint32_t userHeaderSize = 0U,
64 const uint32_t userHeaderAlignment = 1U) noexcept;
72 void sendChunk(mepoo::ChunkHeader* const chunkHeader) noexcept;
this class is the base for all ports. it is constructed from a member pointer and is only movable....
Definition: base_port.hpp:43
The ChunkSender is a building block of the shared memory communication infrastructure....
Definition: chunk_sender.hpp:49
The PublisherPortUser provides the API for accessing a publisher port from the user side....
Definition: publisher_port_user.hpp:39
void stopOffer() noexcept
stop offering this publisher port, all subscribers will be removed from this publisher
bool hasSubscribers() const noexcept
Checks whether there are currently subscribers connected to this publisher.
bool isOffered() const noexcept
Checks whether the publisher port is currently offered.
void sendChunk(mepoo::ChunkHeader *const chunkHeader) noexcept
Send an allocated chunk to all connected subscriber ports.
cxx::optional< const mepoo::ChunkHeader * > tryGetPreviousChunk() const noexcept
Returns the last sent chunk if there is one.
void releaseChunk(mepoo::ChunkHeader *const chunkHeader) noexcept
Free an allocated chunk without sending it.
cxx::expected< mepoo::ChunkHeader *, AllocationError > tryAllocateChunk(const uint32_t userPayloadSize, const uint32_t userPayloadAlignment, const uint32_t userHeaderSize=0U, const uint32_t userHeaderAlignment=1U) noexcept
Allocate a chunk, the ownership of the SharedChunk remains in the PublisherPortUser for being able to...
void offer() noexcept
offer this publiher port in the system
Definition: service_description.hpp:29
Defines different base port data.
Definition: base_port_data.hpp:34
Definition: publisher_port_data.hpp:39