17#ifndef IOX_HOOFS_CXX_VARIANT_QUEUE_HPP
18#define IOX_HOOFS_CXX_VARIANT_QUEUE_HPP
20#include "iceoryx_hoofs/concurrent/resizeable_lockfree_queue.hpp"
21#include "iceoryx_hoofs/cxx/expected.hpp"
22#include "iceoryx_hoofs/cxx/optional.hpp"
23#include "iceoryx_hoofs/cxx/variant.hpp"
24#include "iceoryx_hoofs/internal/concurrent/fifo.hpp"
25#include "iceoryx_hoofs/internal/concurrent/sofi.hpp"
39enum class VariantQueueTypes : uint64_t
41 FiFo_SingleProducerSingleConsumer = 0,
42 SoFi_SingleProducerSingleConsumer = 1,
43 FiFo_MultiProducerSingleConsumer = 2,
44 SoFi_MultiProducerSingleConsumer = 3
69template <
typename ValueType, u
int64_t Capacity>
74 concurrent::SoFi<ValueType, Capacity>,
127 VariantQueueTypes m_type;
133#include "iceoryx_hoofs/internal/cxx/variant_queue.inl"
implements a lock free queue (i.e. container with FIFO order) of elements of type T with a maximum ca...
Definition resizeable_lockfree_queue.hpp:48
wrapper of multiple fifo's
Definition variant_queue.hpp:71
optional< ValueType > pop() noexcept
pops an element from the fifo
fifo_t & getUnderlyingFiFo() noexcept
returns reference to the underlying fifo
uint64_t capacity() const noexcept
get the capacity of the queue.
optional< ValueType > push(const ValueType &value) noexcept
pushs an element into the fifo
bool setCapacity(const uint64_t newCapacity) noexcept
set the capacity of the queue
VariantQueue(const VariantQueueTypes type) noexcept
Constructor of a VariantQueue.
uint64_t size() noexcept
get the current size of the queue. Caution, another thread can have changed the size just after readi...
bool empty() const noexcept
returns true if empty otherwise true
Optional implementation from the C++17 standard with C++11. The interface is analog to the C++17 stan...
Definition optional.hpp:69
building block to easily create free function for logging in a library context
Definition lockfree_queue.hpp:29