42 bool empty(
void)
const;
50 void push(U &&elem,
const size_t index);
55 const T &
front(
void)
const;
72 std::vector<std::pair<T, bool>> _pushedElems;
74 inline void _wrapIndex(
void)
76 if (++_indexToAck == _pushedElems.size()) _indexToAck = 0;
90 _pushedElems(capacity, std::make_pair(T(), false)),
99 return _readyElems.
empty();
102 template <
typename T>
103 template <
typename U>
107 if (index == _indexToAck)
109 assert(not _readyElems.
full());
110 _readyElems.
push_back(std::forward<U>(elem));
119 assert(index < _pushedElems.size());
120 _pushedElems[index].first = std::forward<U>(elem);
121 _pushedElems[index].second =
true;
125 while (_pushedElems[_indexToAck].second)
128 assert(not _readyElems.
full());
129 _readyElems.
push_back(std::move(_pushedElems[_indexToAck].first));
130 _pushedElems[_indexToAck].second =
false;
137 template <
typename T>
140 return _readyElems.
front();
143 template <
typename T>
146 return _readyElems.
front();
149 template <
typename T>
155 template <
typename T>
bool full(void) const
Is the deque full? – num elements == capacity.
Definition: RingDeque.hpp:311
void pop_front(void)
Pop and element from the front of the queue.
Definition: RingDeque.hpp:244
const T & front(void) const
Get a const reference to the front element.
Definition: RingDeque.hpp:253
Definition: ArchiveEntry.hpp:20
void push(U &&elem, const size_t index)
Definition: OrderedQueue.hpp:104
bool empty(void) const
Definition: OrderedQueue.hpp:97
bool empty(void) const
Is the deque empty? – no elements.
Definition: RingDeque.hpp:305
void pop(void)
Definition: OrderedQueue.hpp:150
size_t capacity(void) const
How many elements can be stored?
Definition: RingDeque.hpp:323
void push_back(U &&elem)
Push an element onto the back of the queue.
Definition: RingDeque.hpp:268
size_t capacity(void) const
How many elements can be stored?
Definition: OrderedQueue.hpp:156
const T & front(void) const
Definition: OrderedQueue.hpp:138
Definition: OrderedQueue.hpp:28
OrderedQueue(void)
Construct a size-zero ordered queue.
Definition: OrderedQueue.hpp:81