#include <thread-queue.h>
Public Member Functions | |
void | push (const T &t) |
void | pop () |
T | pop_front () |
bool | try_pop_front (T &result) |
T & | front () |
T & | back () |
int | size () |
Unbounded queue to let several threads communicate.
Reading on an empty queue is blocking.
Definition at line 26 of file thread-queue.h.
T& thread_queue< T >::back | ( | ) | [inline] |
Return the newest element in the queue without removing it
Definition at line 85 of file thread-queue.h.
T& thread_queue< T >::front | ( | ) | [inline] |
Return the oldest element in the queue without removing it.
Definition at line 76 of file thread-queue.h.
void thread_queue< T >::pop | ( | ) | [inline] |
Remove the oldest element in the queue. Blocking if the queue is empty.
Definition at line 38 of file thread-queue.h.
T thread_queue< T >::pop_front | ( | ) | [inline] |
Like pop(), but return the element removed
Definition at line 47 of file thread-queue.h.
void thread_queue< T >::push | ( | const T & | t | ) | [inline] |
Insert t in the queue
Definition at line 29 of file thread-queue.h.
int thread_queue< T >::size | ( | ) | [inline] |
Number of elements in the queue
Definition at line 94 of file thread-queue.h.
bool thread_queue< T >::try_pop_front | ( | T & | result | ) | [inline] |
Non-blocking version of pop_front()
Return true and sets "result" if the queue is not empty. Return false otherwise.
Definition at line 65 of file thread-queue.h.