17 #ifndef IOX_UTILS_CONCURRENT_FIFO_HPP
18 #define IOX_UTILS_CONCURRENT_FIFO_HPP
20 #include "iceoryx_utils/cxx/optional.hpp"
29 template <
typename ValueType, u
int64_t Capacity>
36 bool push(
const ValueType& f_value) noexcept;
44 bool empty()
const noexcept;
47 uint64_t
size()
const noexcept;
50 static constexpr uint64_t
capacity() noexcept;
53 bool is_full()
const noexcept;
56 ValueType m_data[Capacity];
57 std::atomic<uint64_t> m_write_pos{0};
58 std::atomic<uint64_t> m_read_pos{0};
64 #include "iceoryx_utils/internal/concurrent/fifo.inl"
single pusher single pop'er thread safe fifo
Definition: fifo.hpp:31
uint64_t size() const noexcept
returns the size of the fifo
Definition: fifo.inl:54
static constexpr uint64_t capacity() noexcept
returns the capacity of the fifo
Definition: fifo.inl:60
bool empty() const noexcept
returns true when the fifo is empty, otherwise false
Definition: fifo.inl:66
cxx::optional< ValueType > pop() noexcept
returns the oldest value from the fifo and removes it
Definition: fifo.inl:72
bool push(const ValueType &f_value) noexcept
pushes a value into the fifo
Definition: fifo.inl:27
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