30#ifndef __ADS_UniqueQueue
31 #define __ADS_UniqueQueue
64template< std::equality_comparable T , Duplicate D = Duplicate::IGNORE_NEW >
73 [[nodiscard]]
bool empty(
void )
const;
99 [[nodiscard]]
const T &
top(
void )
const;
105 [[nodiscard]] std::size_t
size(
void )
const;
137 [[nodiscard]]
bool unique(
void )
const;
143 std::size_t f_size = 0;
155#include "ADS/queue/impl/UniqueQueue.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The LIST of the book: a SEQUENCE [see ADT.h] realized as a bidirectional circular list of cells with ...
a SEQUENCE realized as a bidirectional circular list with a sentinel, its cells from a pool if Pooled
Definition List.h:118
Iterator< true > const_iterator
the iterator on the constant items
Definition List.h:324
Cell * Pos
a position is the address of a cell
Definition List.h:132
a QUEUE with no duplicates; the equality of T must be an equivalence, so an item unequal to itself (e...
Definition UniqueQueue.h:66
typename List< T >::const_iterator iterator
a constant iterator of the list
Definition UniqueQueue.h:118
T value_type
the type of the items
Definition UniqueQueue.h:112
bool empty(void) const
true if there is no item
const_iterator end(void) const
the iterator past the item at the back
Definition UniqueQueue.h:126
const_iterator cend(void) const
as end()
Definition UniqueQueue.h:132
void enqueue(const T &v)
puts at the back, unless the policy keeps an old copy of it
T dequeue(void)
removes the item at the front and returns it
T Item
the type of the items
Definition UniqueQueue.h:70
const T & top(void) const
the item at the front
const_iterator begin(void) const
the iterator on the item at the front
Definition UniqueQueue.h:123
const T & reference
a constant reference
Definition UniqueQueue.h:115
std::size_t size_type
the type of the sizes
Definition UniqueQueue.h:113
std::ptrdiff_t difference_type
the type of the distances
Definition UniqueQueue.h:114
typename List< T >::const_iterator const_iterator
a constant iterator of the list
Definition UniqueQueue.h:120
std::size_t size(void) const
the number of items,
const_iterator cbegin(void) const
as begin()
Definition UniqueQueue.h:129
const T & const_reference
a constant reference
Definition UniqueQueue.h:116
bool contains(const T &v) const
whether is in the queue,
Duplicate
what enqueue() does with an item already in the queue
Definition UniqueQueue.h:56
@ FORGET_OLD
the old copy is removed, the item goes to the back
Definition UniqueQueue.h:58
@ IGNORE_NEW
the queue is left as it is
Definition UniqueQueue.h:57