42 bool empty(
void)
const;
50 void push(U &&elem,
const size_t index);
55 const T &
front(
void)
const;
72 std::vector<T> _pushedElems;
73 std::vector<bool> _pushedElemsFlag;
87 _pushedElems(capacity),
88 _pushedElemsFlag(capacity, false),
97 return _readyElems.empty();
100 template <
typename T>
101 template <
typename U>
105 assert(index < _pushedElems.size());
106 _pushedElems[index] = std::forward<U>(elem);
107 _pushedElemsFlag[index] =
true;
110 while (_pushedElemsFlag[_indexToAck])
113 assert(not _readyElems.full());
114 _readyElems.push_back(_pushedElems[_indexToAck]);
115 _pushedElems[_indexToAck] = T();
116 _pushedElemsFlag[_indexToAck] =
false;
119 if (++_indexToAck == _pushedElems.size()) _indexToAck = 0;
123 template <
typename T>
126 return _readyElems.front();
129 template <
typename T>
132 return _readyElems.front();
135 template <
typename T>
138 _readyElems.pop_front();
141 template <
typename T>
144 return _readyElems.capacity();
const T & front(void) const
Definition: OrderedQueue.hpp:124
size_t capacity(void) const
How many elements can be stored?
Definition: OrderedQueue.hpp:142
void push(U &&elem, const size_t index)
Definition: OrderedQueue.hpp:102
bool empty(void) const
Definition: OrderedQueue.hpp:95
Definition: RingDeque.hpp:29
void pop(void)
Definition: OrderedQueue.hpp:136
Definition: OrderedQueue.hpp:28
OrderedQueue(void)
Construct a size-zero ordered queue.
Definition: OrderedQueue.hpp:78