parallel-cellular-automata
Framework for building parallel cellular automata.
|
A thread-safe wrapper around a queue. More...
#include <queues.hpp>
Public Member Functions | |
ThreadSafeQueue () | |
Construct a new ThreadSafeQueue object. | |
ThreadSafeQueue (ThreadSafeQueue const &other) | |
Construct a new ThreadSafeQueue object. More... | |
void | push (T elem) |
Insert an element into the queue. More... | |
bool | try_pop (T &result) |
Try to pop an element from the queue. More... | |
std::shared_ptr< T > | try_pop () |
Try to pop an element from the queue. More... | |
void | pop (T &result) |
Pop an element from the queue. More... | |
std::shared_ptr< T > | pop () |
Pop an element from the queue. More... | |
bool | empty () const |
Check if the queue is empty. More... | |
size_t | size () const |
returns the size of the queue. (The value may be outdated) More... | |
A thread-safe wrapper around a queue.
T |
|
inline |
Construct a new ThreadSafeQueue object.
other | queue to copy. |
|
inline |
Check if the queue is empty.
|
inline |
Pop an element from the queue.
|
inline |
Pop an element from the queue.
result | reference where to put the popped element. |
|
inline |
Insert an element into the queue.
elem | element to insert. |
|
inline |
returns the size of the queue. (The value may be outdated)
|
inline |
Try to pop an element from the queue.
|
inline |
Try to pop an element from the queue.
result | reference where to put the popped element. |