Skip to content

iox::popo::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. More...

#include <chunk_queue_popper.hpp>

Public Types🔗

Name
using ChunkQueueDataType MemberType_t

Public Functions🔗

Name
ChunkQueuePopper(cxx::not_null< MemberType_t *const > chunkQueueDataPtr)
ChunkQueuePopper(const ChunkQueuePopper & other)
ChunkQueuePopper & operator=(const ChunkQueuePopper & )
ChunkQueuePopper(ChunkQueuePopper && rhs) =default
ChunkQueuePopper & operator=(ChunkQueuePopper && rhs) =default
virtual ~ChunkQueuePopper() =default
cxx::optional< mepoo::SharedChunk > tryPop()
pop a chunk from the chunk queue
bool hasLostChunks()
check if chunks were lost and reset flag
bool empty() const
pop a chunk from the chunk queue
uint64_t size()
get the current size of the queue. Caution, another thread can have changed the size just after reading it
void setCapacity(const uint64_t newCapacity)
set the capacity of the queue
uint64_t getCurrentCapacity() const
get the current capacity of the queue.
uint64_t getMaximumCapacity() const
get the maximum capacity of the queue.
void clear()
clear the queue
void setConditionVariable(ConditionVariableData & conditionVariableDataRef, const uint64_t notificationIndex)
Attaches a condition variable.
void unsetConditionVariable()
Detaches a condition variable.
bool isConditionVariableSet() const
Returns the information whether a condition variable is attached.

Protected Functions🔗

Name
const MemberType_t * getMembers() const
MemberType_t * getMembers()

Detailed Description🔗

template <typename ChunkQueueDataType >
class iox::popo::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 Documentation🔗

using MemberType_t🔗

using iox::popo::ChunkQueuePopper< ChunkQueueDataType >::MemberType_t =  ChunkQueueDataType;

Public Functions Documentation🔗

function ChunkQueuePopper🔗

inline explicit ChunkQueuePopper(
    cxx::not_null< MemberType_t *const > chunkQueueDataPtr
)

function ChunkQueuePopper🔗

ChunkQueuePopper(
    const ChunkQueuePopper & other
)

function operator=🔗

ChunkQueuePopper & operator=(
    const ChunkQueuePopper & 
)

function ChunkQueuePopper🔗

ChunkQueuePopper(
    ChunkQueuePopper && rhs
) =default

function operator=🔗

ChunkQueuePopper & operator=(
    ChunkQueuePopper && rhs
) =default

function ~ChunkQueuePopper🔗

virtual ~ChunkQueuePopper() =default

function tryPop🔗

inline cxx::optional< mepoo::SharedChunk > tryPop()

pop a chunk from the chunk queue

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

function hasLostChunks🔗

inline bool hasLostChunks()

check if chunks were lost and reset flag

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

function empty🔗

inline bool empty() const

pop a chunk from the chunk queue

Return: if the queue is empty return true, otherwise false

function size🔗

inline uint64_t size()

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

Return: queue size

function setCapacity🔗

inline void setCapacity(
    const uint64_t newCapacity
)

set the capacity of the queue

Parameters:

  • newCapacity valid values are 0 < newCapacity < MAX_SUBSCRIBER_QUEUE_CAPACITY

Precondition: it is important that no pop or push calls occur during this call

function getCurrentCapacity🔗

inline uint64_t getCurrentCapacity() const

get the current capacity of the queue.

Return: current queue capacity

function getMaximumCapacity🔗

inline uint64_t getMaximumCapacity() const

get the maximum capacity of the queue.

Return: maximum capacity of this queue

function clear🔗

inline void clear()

clear the queue

function setConditionVariable🔗

inline void setConditionVariable(
    ConditionVariableData & conditionVariableDataRef,
    const uint64_t notificationIndex
)

Attaches a condition variable.

Parameters:

  • ConditionVariableDataPtrpointer to an condition variable data object

function unsetConditionVariable🔗

inline void unsetConditionVariable()

Detaches a condition variable.

function isConditionVariableSet🔗

inline bool isConditionVariableSet() const

Returns the information whether a condition variable is attached.

Return: true if condition variable is set, false if not

Protected Functions Documentation🔗

function getMembers🔗

inline const MemberType_t * getMembers() const

function getMembers🔗

MemberType_t * getMembers()

Updated on 26 April 2021 at 15:31:02 CEST