iceoryx_doc  1.0.1
Public Types | Public Member Functions | Protected Member Functions | List of all members
iox::popo::ChunkQueuePopper< ChunkQueueDataType > Class Template Reference

The ChunkQueuePopper is the low layer building block to receive SharedChunks. It follows a first-in-first-out principle. Together with the ChunkDistributor and the ChunkQueuePusher, the ChunkQueuePopper builds the infrastructure to exchange memory chunks between different data producers and consumers that could be located in different processes. A ChunkQueuePopper is used to build elements of higher abstraction layers that also do memory managemet and provide an API towards the real user. More...

#include <chunk_queue_popper.hpp>

Public Types

using MemberType_t = ChunkQueueDataType
 

Public Member Functions

 ChunkQueuePopper (cxx::not_null< MemberType_t *const > chunkQueueDataPtr) noexcept
 
 ChunkQueuePopper (const ChunkQueuePopper &other)=delete
 
ChunkQueuePopperoperator= (const ChunkQueuePopper &)=delete
 
 ChunkQueuePopper (ChunkQueuePopper &&rhs)=default
 
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...
 

Protected Member Functions

const MemberType_t * getMembers () const noexcept
 
MemberType_t * getMembers () noexcept
 

Detailed Description

template<typename ChunkQueueDataType>
class iox::popo::ChunkQueuePopper< ChunkQueueDataType >

The ChunkQueuePopper is the low layer building block to receive SharedChunks. It follows a first-in-first-out principle. Together with the ChunkDistributor and the ChunkQueuePusher, the ChunkQueuePopper builds the infrastructure to exchange memory chunks between different data producers and consumers that could be located in different processes. A ChunkQueuePopper is used to build elements of higher abstraction layers that also do memory managemet and provide an API towards the real user.

Member Function Documentation

◆ empty()

template<typename ChunkQueueDataType >
bool iox::popo::ChunkQueuePopper< ChunkQueueDataType >::empty
inlinenoexcept

pop a chunk from the chunk queue

Returns
if the queue is empty return true, otherwise false

◆ getCurrentCapacity()

template<typename ChunkQueueDataType >
uint64_t iox::popo::ChunkQueuePopper< ChunkQueueDataType >::getCurrentCapacity
inlinenoexcept

get the current capacity of the queue.

Returns
current queue capacity

◆ getMaximumCapacity()

template<typename ChunkQueueDataType >
uint64_t iox::popo::ChunkQueuePopper< ChunkQueueDataType >::getMaximumCapacity
inlinenoexcept

get the maximum capacity of the queue.

Returns
maximum capacity of this queue

◆ hasLostChunks()

template<typename ChunkQueueDataType >
bool iox::popo::ChunkQueuePopper< ChunkQueueDataType >::hasLostChunks
inlinenoexcept

check if chunks were lost and reset flag

Returns
true if the underlying queue has lost chunks due to an overflow since the last call of this method

◆ isConditionVariableSet()

template<typename ChunkQueueDataType >
bool iox::popo::ChunkQueuePopper< ChunkQueueDataType >::isConditionVariableSet
inlinenoexcept

Returns the information whether a condition variable is attached.

Returns
true if condition variable is set, false if not

◆ setCapacity()

template<typename ChunkQueueDataType >
void iox::popo::ChunkQueuePopper< ChunkQueueDataType >::setCapacity ( const uint64_t  newCapacity)
inlinenoexcept

set the capacity of the queue

Parameters
[in]newCapacityvalid values are 0 < newCapacity < MAX_SUBSCRIBER_QUEUE_CAPACITY
Precondition
it is important that no pop or push calls occur during this call
Concurrent:
not thread safe

◆ setConditionVariable()

template<typename ChunkQueueDataType >
void iox::popo::ChunkQueuePopper< ChunkQueueDataType >::setConditionVariable ( ConditionVariableData conditionVariableDataRef,
const uint64_t  notificationIndex 
)
inlinenoexcept

Attaches a condition variable.

Parameters
[in]ConditionVariableDataPtr,pointerto an condition variable data object

◆ size()

template<typename ChunkQueueDataType >
uint64_t iox::popo::ChunkQueuePopper< ChunkQueueDataType >::size
inlinenoexcept

get the current size of the queue. Caution, another thread can have changed the size just after reading it

Returns
queue size

◆ tryPop()

template<typename ChunkQueueDataType >
cxx::optional< mepoo::SharedChunk > iox::popo::ChunkQueuePopper< ChunkQueueDataType >::tryPop
inlinenoexcept

pop a chunk from the chunk queue

Returns
optional for a shared chunk that is set if the queue is not empty

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