50#include <lal/detail/array.hpp>
68template <
typename value_t>
72 void init(
const std::size_t n)
noexcept {
79 void push(
const value_t& v)
noexcept {
86 void push(value_t&& v)
noexcept {
98 [[nodiscard]] value_t&&
pop() noexcept {
106 [[nodiscard]] value_t&
front() noexcept {
114 [[nodiscard]]
const value_t&
front() const noexcept {
121 [[nodiscard]] std::size_t
size() const noexcept {
Simple array-like fixed-size queue.
Definition queue_array.hpp:69
value_t & front() noexcept
Returns a reference to the front element.
Definition queue_array.hpp:106
void init(const std::size_t n) noexcept
Initializes the queue to hold n elements.
Definition queue_array.hpp:72
void reset() noexcept
Makes the queue usable again.
Definition queue_array.hpp:131
void push(value_t &&v) noexcept
Insert a new element to the queue.
Definition queue_array.hpp:86
std::size_t size() const noexcept
Returns the size of the queue.
Definition queue_array.hpp:121
const value_t * end() const noexcept
Constant pointer to end.
Definition queue_array.hpp:160
value_t * end() noexcept
Pointer to end.
Definition queue_array.hpp:158
std::size_t m_right
Right pointer to m_queue.
Definition queue_array.hpp:169
array< value_t > m_queue
Data (array) of the queue.
Definition queue_array.hpp:164
value_t * begin() noexcept
Pointer to begin.
Definition queue_array.hpp:154
const value_t & front() const noexcept
Returns a constant reference to the front element.
Definition queue_array.hpp:114
bool is_full() const noexcept
Is the queue full?
Definition queue_array.hpp:151
value_t && pop() noexcept
Pops the first element of the queue.
Definition queue_array.hpp:98
void push(const value_t &v) noexcept
Insert a new element to the queue.
Definition queue_array.hpp:79
std::size_t m_left
Left pointer to m_queue.
Definition queue_array.hpp:167
bool is_exhausted() const noexcept
Has the queue exhausted its resources?
Definition queue_array.hpp:142
const value_t * begin() const noexcept
Constant pointer to begin.
Definition queue_array.hpp:156
Main namespace of the library.
Definition basic_types.hpp:48
Wrapper of a C array for automatic deallocation of memory.
Definition array.hpp:59
T * begin() noexcept
Non-constant raw pointer to first element.
Definition array.hpp:300
std::size_t size() const noexcept
Size of the array.
Definition array.hpp:215
void resize(const std::size_t new_size) noexcept
Resize the array.
Definition array.hpp:187