Template Class ConcurrentQueue

Class Documentation

template<typename T>
class ConcurrentQueue

Templated class implementing a thread safe queue that can be accessed (via push and pop) from multiple threads. This implementation is inspired by the concurrent_queue within the TBB library.

Public Functions

inline bool empty() const noexcept
Returns:

True, if queue is empty. False, otherwise.

inline size_t size() const noexcept
Returns:

Size of queue. I.e. number of elements stored inside queue.

inline void push(const T &input) noexcept

Pushed a copy of input into the queue container. This will induce a notification via the condition variable that a new member is inside the queue.

inline void pop(T &output) noexcept

Pops a copy of the first item in the container and assigns it to output. The popped item is destroyed. If queue is empty, this method will wait until an item becomes available.