17 #ifndef IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_QUEUE_POPPER_HPP
18 #define IOX_POSH_POPO_BUILDING_BLOCKS_CHUNK_QUEUE_POPPER_HPP
20 #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp"
21 #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp"
22 #include "iceoryx_posh/internal/popo/building_blocks/condition_notifier.hpp"
23 #include "iceoryx_utils/cxx/helplets.hpp"
24 #include "iceoryx_utils/cxx/optional.hpp"
35 template <
typename ChunkQueueDataType>
39 using MemberType_t = ChunkQueueDataType;
41 explicit ChunkQueuePopper(cxx::not_null<MemberType_t* const> chunkQueueDataPtr) noexcept;
51 cxx::optional<mepoo::SharedChunk>
tryPop() noexcept;
59 bool empty()
const noexcept;
64 uint64_t
size() noexcept;
70 void setCapacity(
const uint64_t newCapacity) noexcept;
81 void clear() noexcept;
86 const uint64_t notificationIndex) noexcept;
96 const MemberType_t* getMembers()
const noexcept;
97 MemberType_t* getMembers() noexcept;
100 MemberType_t* m_chunkQueueDataPtr;
106 #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_popper.inl"
The ChunkQueuePopper is the low layer building block to receive SharedChunks. It follows a first-in-f...
Definition: chunk_queue_popper.hpp:37
void unsetConditionVariable() noexcept
Detaches a condition variable.
Definition: chunk_queue_popper.inl:137
void clear() noexcept
clear the queue
Definition: chunk_queue_popper.inl:117
uint64_t getCurrentCapacity() const noexcept
get the current capacity of the queue.
Definition: chunk_queue_popper.inl:105
bool empty() const noexcept
pop a chunk from the chunk queue
Definition: chunk_queue_popper.inl:87
uint64_t getMaximumCapacity() const noexcept
get the maximum capacity of the queue.
Definition: chunk_queue_popper.inl:111
bool hasLostChunks() noexcept
check if chunks were lost and reset flag
Definition: chunk_queue_popper.inl:76
void setConditionVariable(ConditionVariableData &conditionVariableDataRef, const uint64_t notificationIndex) noexcept
Attaches a condition variable.
Definition: chunk_queue_popper.inl:127
uint64_t size() noexcept
get the current size of the queue. Caution, another thread can have changed the size just after readi...
Definition: chunk_queue_popper.inl:93
cxx::optional< mepoo::SharedChunk > tryPop() noexcept
pop a chunk from the chunk queue
Definition: chunk_queue_popper.inl:48
void setCapacity(const uint64_t newCapacity) noexcept
set the capacity of the queue
Definition: chunk_queue_popper.inl:99
bool isConditionVariableSet() const noexcept
Returns the information whether a condition variable is attached.
Definition: chunk_queue_popper.inl:146
Definition: service_description.hpp:29
Definition: condition_variable_data.hpp:31