17 #ifndef IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_SENDER_HPP
18 #define IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_SENDER_HPP
20 #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp"
21 #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp"
22 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp"
23 #include "iceoryx_posh/internal/popo/building_blocks/typed_unique_id.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"
34 enum class AllocationError
37 RUNNING_OUT_OF_CHUNKS,
38 TOO_MANY_CHUNKS_ALLOCATED_IN_PARALLEL,
39 INVALID_PARAMETER_FOR_USER_PAYLOAD_OR_USER_HEADER,
47 template <
typename ChunkSenderDataType>
51 using MemberType_t = ChunkSenderDataType;
54 explicit ChunkSender(cxx::not_null<MemberType_t* const> chunkSenderDataPtr) noexcept;
74 const uint32_t userPayloadSize,
75 const uint32_t userPayloadAlignment,
76 const uint32_t userHeaderSize,
77 const uint32_t userHeaderAlignment) noexcept;
107 const MemberType_t* getMembers()
const noexcept;
108 MemberType_t* getMembers() noexcept;
114 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender.inl"
WARNING: SharedChunk is not thread safe! Don't share SharedChunk objects between threads!...
Definition: shared_chunk.hpp:35
The ChunkDistributor is the low layer building block to send SharedChunks to a dynamic number of Chun...
Definition: chunk_distributor.hpp:63
The ChunkSender is a building block of the shared memory communication infrastructure....
Definition: chunk_sender.hpp:49
void release(const mepoo::ChunkHeader *const chunkHeader) noexcept
Release an allocated chunk without sending it.
Definition: chunk_sender.inl:114
void send(mepoo::ChunkHeader *const chunkHeader) noexcept
Send an allocated chunk to all connected ChunkQueuePopper.
Definition: chunk_sender.inl:125
void pushToHistory(mepoo::ChunkHeader *const chunkHeader) noexcept
Push an allocated chunk to the history without sending it.
Definition: chunk_sender.inl:140
cxx::expected< mepoo::ChunkHeader *, AllocationError > tryAllocate(const UniquePortId originId, const uint32_t userPayloadSize, const uint32_t userPayloadAlignment, const uint32_t userHeaderSize, const uint32_t userHeaderAlignment) noexcept
allocate a chunk, the ownership of the SharedChunk remains in the ChunkSender for being able to clean...
Definition: chunk_sender.inl:45
void releaseAll() noexcept
Release all the chunks that are currently held. Caution: Only call this if the user process is no mor...
Definition: chunk_sender.inl:168
cxx::optional< const mepoo::ChunkHeader * > tryGetPreviousChunk() const noexcept
Returns the last sent chunk if there is one.
Definition: chunk_sender.inl:155
Definition: service_description.hpp:29