iceoryx_doc
1.0.1
|
The ChunkSender is a building block of the shared memory communication infrastructure. It extends the functionality of a ChunkDistributor with the abililty to allocate and free memory chunks. For getting chunks of memory the MemoryManger is used. Together with the ChunkReceiver, they are the next abstraction layer on top of ChunkDistributor and ChunkQueuePopper. The ChunkSender holds the ownership of the SharedChunks and does a bookkeeping which chunks are currently passed to the user side. More...
#include <chunk_sender.hpp>
Public Types | |
using | MemberType_t = ChunkSenderDataType |
using | Base_t = ChunkDistributor< typename ChunkSenderDataType::ChunkDistributorData_t > |
![]() | |
using | MemberType_t = ChunkSenderDataType::ChunkDistributorData_t |
using | ChunkQueueData_t = typename ChunkDistributorDataType::ChunkQueueData_t |
using | ChunkQueuePusher_t = typename ChunkDistributorDataType::ChunkQueuePusher_t |
Public Member Functions | |
ChunkSender (cxx::not_null< MemberType_t *const > chunkSenderDataPtr) noexcept | |
ChunkSender (const ChunkSender &other)=delete | |
ChunkSender & | operator= (const ChunkSender &)=delete |
ChunkSender (ChunkSender &&rhs)=default | |
ChunkSender & | operator= (ChunkSender &&rhs)=default |
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 cleanup if the user process disappears More... | |
void | release (const mepoo::ChunkHeader *const chunkHeader) noexcept |
Release an allocated chunk without sending it. More... | |
void | send (mepoo::ChunkHeader *const chunkHeader) noexcept |
Send an allocated chunk to all connected ChunkQueuePopper. More... | |
void | pushToHistory (mepoo::ChunkHeader *const chunkHeader) noexcept |
Push an allocated chunk to the history without sending it. More... | |
cxx::optional< const mepoo::ChunkHeader * > | tryGetPreviousChunk () const noexcept |
Returns the last sent chunk if there is one. More... | |
void | releaseAll () noexcept |
Release all the chunks that are currently held. Caution: Only call this if the user process is no more running E.g. This cleans up chunks that were held by a user process that died unexpectetly, for avoiding lost chunks in the system. | |
![]() | |
ChunkDistributor (cxx::not_null< MemberType_t *const > chunkDistrubutorDataPtr) noexcept | |
ChunkDistributor (const ChunkDistributor &other)=delete | |
ChunkDistributor (ChunkDistributor &&rhs)=default | |
ChunkDistributor & | operator= (const ChunkDistributor &)=delete |
ChunkDistributor & | operator= (ChunkDistributor &&rhs)=default |
cxx::expected< ChunkDistributorError > | tryAddQueue (cxx::not_null< ChunkQueueData_t *const > queueToAdd, const uint64_t requestedHistory=0u) noexcept |
Add a queue to the internal list of chunk queues to which chunks are delivered when calling deliverToAllStoredQueues. More... | |
cxx::expected< ChunkDistributorError > | tryRemoveQueue (cxx::not_null< ChunkQueueData_t *const > queueToRemove) noexcept |
Remove a queue from the internal list of chunk queues. More... | |
void | removeAllQueues () noexcept |
Delete all the stored chunk queues. | |
bool | hasStoredQueues () const noexcept |
Get the information whether there are any stored chunk queues. More... | |
void | deliverToAllStoredQueues (mepoo::SharedChunk chunk) noexcept |
Deliver the provided shared chunk to all the stored chunk queues. The chunk will be added to the chunk history. More... | |
bool | deliverToQueue (cxx::not_null< ChunkQueueData_t *const > queue, mepoo::SharedChunk chunk) noexcept |
Deliver the provided shared chunk to the provided chunk queue. The chunk will NOT be added to the chunk history. More... | |
void | addToHistoryWithoutDelivery (mepoo::SharedChunk chunk) noexcept |
Update the chunk history but do not deliver the chunk to any chunk queue. E.g. use case is to to update a non offered field in ara. More... | |
uint64_t | getHistorySize () noexcept |
Get the current size of the chunk history. More... | |
uint64_t | getHistoryCapacity () const noexcept |
Get the capacity of the chunk history. More... | |
void | clearHistory () noexcept |
Clears the chunk history. | |
void | cleanup () noexcept |
cleanup the used shrared memory chunks More... | |
Additional Inherited Members | |
![]() | |
const MemberType_t * | getMembers () const noexcept |
MemberType_t * | getMembers () noexcept |
The ChunkSender is a building block of the shared memory communication infrastructure. It extends the functionality of a ChunkDistributor with the abililty to allocate and free memory chunks. For getting chunks of memory the MemoryManger is used. Together with the ChunkReceiver, they are the next abstraction layer on top of ChunkDistributor and ChunkQueuePopper. The ChunkSender holds the ownership of the SharedChunks and does a bookkeeping which chunks are currently passed to the user side.
|
inlinenoexcept |
Push an allocated chunk to the history without sending it.
[in] | chunkHeader,pointer | to the ChunkHeader to push to the history |
|
inlinenoexcept |
Release an allocated chunk without sending it.
[in] | chunkHeader,pointer | to the ChunkHeader to release |
|
inlinenoexcept |
Send an allocated chunk to all connected ChunkQueuePopper.
[in] | chunkHeader,pointer | to the ChunkHeader to send |
|
inlinenoexcept |
allocate a chunk, the ownership of the SharedChunk remains in the ChunkSender for being able to cleanup if the user process disappears
[in] | originId,the | unique id of the entity which requested this allocate |
[in] | userPayloadSize,size | of the user-payload without additional headers |
[in] | userPayloadAlignment,alignment | of the user-payload |
[in] | userHeaderSize,size | of the user-header; use iox::CHUNK_NO_USER_HEADER_SIZE to omit a user-header |
[in] | userHeaderAlignment,alignment | of the user-header; use iox::CHUNK_NO_USER_HEADER_ALIGNMENT to omit a user-header |
|
inlinenoexcept |
Returns the last sent chunk if there is one.