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 TBlockableAtomicQuasiQueue. 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 TBlockableAtomicQuasiQueue. Max subqueue size reached.");
47 return m_queue.try_enqueue(std::forward<U>(item));
54 return m_queue.try_dequeue(*out_item);
61 m_queue.wait_dequeue(*out_item);
65template<std::output_iterator<T> Iterator>
68 return m_queue.wait_dequeue_bulk(out_firstItem, numItems);
74 return m_queue.size_approx();
bool tryEnqueue(U &&item)
Try to enqueue an item. Never allocate memory.
Definition TBlockableAtomicQuasiQueue.ipp:45
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 TBlockableAtomicQuasiQueue.ipp:34
void waitDequeue(T *out_item)
Blocks the current thread until there is something to dequeue.
Definition TBlockableAtomicQuasiQueue.ipp:58
TBlockableAtomicQuasiQueue()
Definition TBlockableAtomicQuasiQueue.ipp:12
void enqueue(U &&item)
Enqueue an item. Allocate memory if required. Basic aquire-release semantics are guaranteed....
Definition TBlockableAtomicQuasiQueue.ipp:23
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 TBlockableAtomicQuasiQueue.ipp:51
std::size_t estimatedSize() const
Approximated size of the queue.
Definition TBlockableAtomicQuasiQueue.ipp:72
std::size_t waitDequeueBulk(Iterator out_firstItem, std::size_t numItems)
Definition TBlockableAtomicQuasiQueue.ipp:66
The root for all renderer implementations.
Definition EEngineProject.h:6