This class provides a thread-safe queue. More...
#include <Radiant/SynchronizedQueue.hpp>
Public Member Functions | |
| bool | empty () const |
| Returns true if the queue is empty. More... | |
| T & | head () |
| Return a reference to the head item in the queue. More... | |
| const T & | head () const |
| Return a reference to the head item in the queue. More... | |
| SynchronizedQueue< T > & | operator= (const SynchronizedQueue &c) |
| Copies a queue. More... | |
| T | pop () |
| Removes the head item in the queue and returns it. More... | |
| void | push (const T &t) |
| Adds an element to the end of the queue. More... | |
| SynchronizedQueue () | |
| Constructs an empty queue. | |
| SynchronizedQueue (const SynchronizedQueue &c) | |
| Constructs a copy of another queue. More... | |
| bool | testAndPop (T &result) |
| Non-blocking call that returns false if the queue was empty. More... | |
This class provides a thread-safe queue.
| T | Type of the values stored |
|
inline |
Constructs a copy of another queue.
| c | queue to copy |
|
inline |
Returns true if the queue is empty.
|
inline |
Return a reference to the head item in the queue.
If the queue is empty, this function will block until something is pushed into it.
|
inline |
Return a reference to the head item in the queue.
If the queue is empty, this function will block until something is pushed into it.
|
inline |
|
inline |
Removes the head item in the queue and returns it.
If the queue is empty, the function will block until something is pushed into it.
|
inline |
Adds an element to the end of the queue.
| t | Value to add to the queue |
|
inline |
Non-blocking call that returns false if the queue was empty.
Otherwise pops the head and assigns it to result.
| result | head of the queue |