33#ifndef __ADS_LinkedQueue
34 #define __ADS_LinkedQueue
87 [[nodiscard]]
bool empty(
void )
const;
126 [[nodiscard]]
const T &
top(
void )
const;
129 [[nodiscard]] std::size_t
size(
void )
const;
176 Cell * f_front =
nullptr;
177 Cell * f_back =
nullptr;
178 std::size_t f_size = 0;
191#include "ADS/queue/impl/LinkedQueue.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The iterators that the containers of the library have in common, beyond the book: they give a contain...
A pool of objects of one type, beyond the book: make() builds an object in a slot of the pool and fre...
a forward iterator along the cells C linked by the member Next, on the items V in the member Value; n...
Definition Iterators.h:132
const T & top(void) const
the item at the front
LinkedIterator< Cell, T, &Cell::next, &Cell::value > const_iterator
a constant iterator along the cells
Definition LinkedQueue.h:156
LinkedQueue & operator=(LinkedQueue other) noexcept
the items of other, by copy and swap
const_iterator begin(void) const
the iterator on the item at the front
Definition LinkedQueue.h:160
const T & reference
a constant reference
Definition LinkedQueue.h:151
LinkedQueue(void)=default
the empty queue
const_iterator end(void) const
the iterator past the item at the back, nil
Definition LinkedQueue.h:165
void swap(LinkedQueue &other) noexcept
exchanges the cells with other
T dequeue(void)
removes the item at the front and returns it
T Item
the type of the items
Definition LinkedQueue.h:66
std::ptrdiff_t difference_type
the type of the distances
Definition LinkedQueue.h:150
LinkedQueue(const LinkedQueue &other)
a copy of other, cell by cell
LinkedIterator< Cell, T, &Cell::next, &Cell::value > iterator
a constant iterator along the cells
Definition LinkedQueue.h:154
const_iterator cbegin(void) const
as begin()
Definition LinkedQueue.h:170
~LinkedQueue()
frees the cells
void enqueue(const T &v)
puts at the back
bool operator==(const LinkedQueue &o) const
the same items in the same order
std::size_t size_type
the type of the sizes
Definition LinkedQueue.h:149
bool empty(void) const
true if there is no item
const T & const_reference
a constant reference
Definition LinkedQueue.h:152
T value_type
the type of the items
Definition LinkedQueue.h:148
std::size_t size(void) const
the number of items,
const_iterator cend(void) const
as end()
Definition LinkedQueue.h:173
LinkedQueue(LinkedQueue &&other) noexcept
the cells of other, which is left empty