17 #ifndef IOX_UTILS_CXX_VARIANT_QUEUE_HPP
18 #define IOX_UTILS_CXX_VARIANT_QUEUE_HPP
20 #include "iceoryx_utils/concurrent/resizeable_lockfree_queue.hpp"
21 #include "iceoryx_utils/cxx/expected.hpp"
22 #include "iceoryx_utils/cxx/optional.hpp"
23 #include "iceoryx_utils/cxx/variant.hpp"
24 #include "iceoryx_utils/internal/concurrent/fifo.hpp"
25 #include "iceoryx_utils/internal/concurrent/sofi.hpp"
39 enum class VariantQueueTypes : uint64_t
41 FiFo_SingleProducerSingleConsumer = 0,
42 SoFi_SingleProducerSingleConsumer = 1,
43 FiFo_MultiProducerSingleConsumer = 2,
44 SoFi_MultiProducerSingleConsumer = 3
69 template <
typename ValueType, u
int64_t Capacity>
95 bool empty()
const noexcept;
100 uint64_t
size() noexcept;
110 bool setCapacity(
const uint64_t newCapacity) noexcept;
127 VariantQueueTypes m_type;
133 #include "iceoryx_utils/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
Thread safe producer and consumer queue with a safe overflowing behavior. SoFi is designed in a FIFO ...
Definition: sofi.hpp:46
wrapper of multiple fifo's
Definition: variant_queue.hpp:71
fifo_t & getUnderlyingFiFo() noexcept
returns reference to the underlying fifo
Definition: variant_queue.inl:250
optional< ValueType > pop() noexcept
pops an element from the fifo
Definition: variant_queue.inl:94
uint64_t capacity() const noexcept
get the capacity of the queue.
Definition: variant_queue.inl:217
optional< ValueType > push(const ValueType &value) noexcept
pushs an element into the fifo
Definition: variant_queue.inl:53
bool setCapacity(const uint64_t newCapacity) noexcept
set the capacity of the queue
Definition: variant_queue.inl:188
VariantQueue(const VariantQueueTypes type) noexcept
Constructor of a VariantQueue.
Definition: variant_queue.inl:27
uint64_t size() noexcept
get the current size of the queue. Caution, another thread can have changed the size just after readi...
Definition: variant_queue.inl:155
bool empty() const noexcept
returns true if empty otherwise true
Definition: variant_queue.inl:126
Optional implementation from the C++17 standard with C++11. The interface is analog to the C++17 stan...
Definition: optional.hpp:63
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28