Public Member Functions

thread_queue< T > Class Template Reference

#include <thread-queue.h>

List of all members.

Public Member Functions

void push (const T &t)
void pop ()
pop_front ()
bool try_pop_front (T &result)
T & front ()
T & back ()
int size ()

Detailed Description

template<typename T>
class thread_queue< T >

Unbounded queue to let several threads communicate.

Reading on an empty queue is blocking.

Definition at line 26 of file thread-queue.h.


Member Function Documentation

template<typename T>
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.

template<typename T>
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.

template<typename T>
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.

template<typename T>
T thread_queue< T >::pop_front (  )  [inline]

Like pop(), but return the element removed

Definition at line 47 of file thread-queue.h.

template<typename T>
void thread_queue< T >::push ( const T &  t  )  [inline]

Insert t in the queue

Definition at line 29 of file thread-queue.h.

template<typename T>
int thread_queue< T >::size (  )  [inline]

Number of elements in the queue

Definition at line 94 of file thread-queue.h.

template<typename T>
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.


The documentation for this class was generated from the following file:
 All Classes Files Functions Defines