3#include <Common/assertion.h>
18 m_queue(initialCapacity)
25 if(!m_queue.enqueue(std::forward<U>(item)))
27 throw std::runtime_error(
28 "Cannot enqueue an item to TAtomicQuasiQueue. Max subqueue size reached.");
33template<std::input_iterator Iterator>
36 if(!m_queue.enqueue_bulk(firstItem, numItems))
38 throw std::runtime_error(
39 "Cannot enqueue an item to TAtomicQuasiQueue. Max subqueue size reached.");
47 return m_queue.try_enqueue(std::forward<U>(item));
54 return m_queue.try_dequeue(*out_item);
58template<std::output_iterator<T> Iterator>
61 return m_queue.try_dequeue_bulk(out_firstItem, numItems);
67 return m_queue.size_approx();
std::size_t estimatedSize() const
Approximated size of the queue.
Definition TAtomicQuasiQueue.ipp:65
bool tryDequeue(T *out_item)
Try to dequeue an item. While there is no contention, dequeue fails if there is no item or the memory...
Definition TAtomicQuasiQueue.ipp:51
std::size_t tryDequeueBulk(Iterator out_firstItem, std::size_t numItems)
Definition TAtomicQuasiQueue.ipp:59
TAtomicQuasiQueue()
Definition TAtomicQuasiQueue.ipp:12
bool tryEnqueue(U &&item)
Try to enqueue an item. Never allocate memory.
Definition TAtomicQuasiQueue.ipp:45
void enqueue(U &&item)
Enqueue an item. Allocate memory if required. Basic aquire-release semantics are guaranteed....
Definition TAtomicQuasiQueue.ipp:23
void enqueueBulk(Iterator firstItem, std::size_t numItems)
Enqueue multiple items at once. Similar to enqueue(1). Use std::make_move_iterator if the items shoul...
Definition TAtomicQuasiQueue.ipp:34
The root for all renderer implementations.
Definition EEngineProject.h:6