Template Class ChunkQueuePopper
Defined in File chunk_queue_popper.hpp
Class Documentation
-
template<typename ChunkQueueDataType>
class ChunkQueuePopper 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.
Public Types
-
using MemberType_t = ChunkQueueDataType
Public Functions
-
explicit ChunkQueuePopper(cxx::not_null<MemberType_t*const> chunkQueueDataPtr) noexcept
-
ChunkQueuePopper(const ChunkQueuePopper &other) = delete
-
ChunkQueuePopper &operator=(const ChunkQueuePopper&) = delete
-
ChunkQueuePopper(ChunkQueuePopper &&rhs) noexcept = default
-
ChunkQueuePopper &operator=(ChunkQueuePopper &&rhs) noexcept = default
-
virtual ~ChunkQueuePopper() noexcept = default
-
cxx::optional<mepoo::SharedChunk> tryPop() noexcept
pop a chunk from the chunk queue
- Returns:
optional for a shared chunk that is set if the queue is not empty
-
bool hasLostChunks() noexcept
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
-
bool empty() const noexcept
pop a chunk from the chunk queue
- Returns:
if the queue is empty return true, otherwise false
-
uint64_t size() noexcept
get the current size of the queue. Caution, another thread can have changed the size just after reading it
- Returns:
queue size
-
void setCapacity(const uint64_t newCapacity) noexcept
set the capacity of the queue
- Parameters:
newCapacity – [in] valid values are 0 < newCapacity < MAX_SUBSCRIBER_QUEUE_CAPACITY
- Pre:
it is important that no pop or push calls occur during this call @concurrent not thread safe
-
uint64_t getCurrentCapacity() const noexcept
get the current capacity of the queue.
- Returns:
current queue capacity
-
uint64_t getMaximumCapacity() const noexcept
get the maximum capacity of the queue.
- Returns:
maximum capacity of this queue
-
void clear() noexcept
clear the queue
-
void setConditionVariable(ConditionVariableData &conditionVariableDataRef, const uint64_t notificationIndex) noexcept
Attaches a condition variable.
- Parameters:
ConditionVariableDataPtr, pointer – [in] to an condition variable data object
-
void unsetConditionVariable() noexcept
Detaches a condition variable.
-
bool isConditionVariableSet() const noexcept
Returns the information whether a condition variable is attached.
- Returns:
true if condition variable is set, false if not
Protected Functions
-
const MemberType_t *getMembers() const noexcept
-
MemberType_t *getMembers() noexcept
-
using MemberType_t = ChunkQueueDataType