iceoryx_doc  1.0.1
Public Types | Public Member Functions | List of all members
iox::popo::ChunkReceiver< ChunkReceiverDataType > Class Template Reference

The ChunkReceiver is a building block of the shared memory communication infrastructure. It extends the functionality of a ChunkQueuePopper with the abililty to pass chunks to the user side (user process). Together with the ChunkSender, they are the next abstraction layer on top of ChunkDistributor and ChunkQueuePopper. The ChunkRceiver holds the ownership of the SharedChunks and does a bookkeeping which chunks are currently passed to the user side. More...

#include <chunk_receiver.hpp>

Inheritance diagram for iox::popo::ChunkReceiver< ChunkReceiverDataType >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::ChunkReceiver< ChunkReceiverDataType >:
Collaboration graph
[legend]

Public Types

using MemberType_t = ChunkReceiverDataType
 
using Base_t = ChunkQueuePopper< typename ChunkReceiverDataType::ChunkQueueData_t >
 
- Public Types inherited from iox::popo::ChunkQueuePopper< ChunkReceiverDataType::ChunkQueueData_t >
using MemberType_t = ChunkReceiverDataType::ChunkQueueData_t
 

Public Member Functions

 ChunkReceiver (cxx::not_null< MemberType_t *const > chunkReceiverDataPtr) noexcept
 
 ChunkReceiver (const ChunkReceiver &other)=delete
 
ChunkReceiveroperator= (const ChunkReceiver &)=delete
 
 ChunkReceiver (ChunkReceiver &&rhs)=default
 
ChunkReceiveroperator= (ChunkReceiver &&rhs)=default
 
cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResult > tryGet () noexcept
 Tries to get the next received chunk. If there is a new one the ChunkHeader of this new chunk is received The ownerhip of the SharedChunk remains in the ChunkReceiver for being able to cleanup if the user process disappears. More...
 
void release (const mepoo::ChunkHeader *const chunkHeader) noexcept
 Release a chunk that was obtained with get. 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.
 
- Public Member Functions inherited from iox::popo::ChunkQueuePopper< ChunkReceiverDataType::ChunkQueueData_t >
 ChunkQueuePopper (cxx::not_null< MemberType_t *const > chunkQueueDataPtr) noexcept
 
 ChunkQueuePopper (const ChunkQueuePopper &other)=delete
 
 ChunkQueuePopper (ChunkQueuePopper &&rhs)=default
 
ChunkQueuePopperoperator= (const ChunkQueuePopper &)=delete
 
ChunkQueuePopperoperator= (ChunkQueuePopper &&rhs)=default
 
cxx::optional< mepoo::SharedChunktryPop () noexcept
 pop a chunk from the chunk queue More...
 
bool hasLostChunks () noexcept
 check if chunks were lost and reset flag More...
 
bool empty () const noexcept
 pop a chunk from the chunk queue More...
 
uint64_t size () noexcept
 get the current size of the queue. Caution, another thread can have changed the size just after reading it More...
 
void setCapacity (const uint64_t newCapacity) noexcept
 set the capacity of the queue More...
 
uint64_t getCurrentCapacity () const noexcept
 get the current capacity of the queue. More...
 
uint64_t getMaximumCapacity () const noexcept
 get the maximum capacity of the queue. More...
 
void clear () noexcept
 clear the queue
 
void setConditionVariable (ConditionVariableData &conditionVariableDataRef, const uint64_t notificationIndex) noexcept
 Attaches a condition variable. More...
 
void unsetConditionVariable () noexcept
 Detaches a condition variable.
 
bool isConditionVariableSet () const noexcept
 Returns the information whether a condition variable is attached. More...
 

Additional Inherited Members

- Protected Member Functions inherited from iox::popo::ChunkQueuePopper< ChunkReceiverDataType::ChunkQueueData_t >
const MemberType_t * getMembers () const noexcept
 
MemberType_t * getMembers () noexcept
 

Detailed Description

template<typename ChunkReceiverDataType>
class iox::popo::ChunkReceiver< ChunkReceiverDataType >

The ChunkReceiver is a building block of the shared memory communication infrastructure. It extends the functionality of a ChunkQueuePopper with the abililty to pass chunks to the user side (user process). Together with the ChunkSender, they are the next abstraction layer on top of ChunkDistributor and ChunkQueuePopper. The ChunkRceiver holds the ownership of the SharedChunks and does a bookkeeping which chunks are currently passed to the user side.

Member Function Documentation

◆ release()

template<typename ChunkReceiverDataType >
void iox::popo::ChunkReceiver< ChunkReceiverDataType >::release ( const mepoo::ChunkHeader *const  chunkHeader)
inlinenoexcept

Release a chunk that was obtained with get.

Parameters
[in]chunkHeader,pointerto the ChunkHeader to release

◆ tryGet()

template<typename ChunkReceiverDataType >
cxx::expected< const mepoo::ChunkHeader *, ChunkReceiveResult > iox::popo::ChunkReceiver< ChunkReceiverDataType >::tryGet
inlinenoexcept

Tries to get the next received chunk. If there is a new one the ChunkHeader of this new chunk is received The ownerhip of the SharedChunk remains in the ChunkReceiver for being able to cleanup if the user process disappears.

Returns
New chunk header, ChunkReceiveResult on error or if there are no new chunks in the underlying queue

The documentation for this class was generated from the following files: