#include <threadsafe_queue.h>
Classes | |
struct | iterator_t |
struct | real_iter_t |
Public Member Functions | |
void | push_back (T &t) |
push an element onto the back of the queue | |
bool | pop_front (T &t) |
pop an element from the front of the queue. | |
int | size (void) const throw () |
returns the number of elements in the queue | |
void | getIterator (iterator_t &i) const throw () |
resets the given iterator to point to the beginning of the queue | |
bool | getNextElement (iterator_t &i, T &t) const |
gets element pointed to by iterator, and increments iterator | |
Static Public Member Functions | |
static int | getRealIteratorSize (void) throw () |
for debugging/validation only | |
Private Types | |
typedef std::deque< T >::iterator | iterator |
typedef threadsafe_queue< T > | queue_t |
Private Member Functions | |
queue_t * | getNonConst (void) const throw () |
Static Private Member Functions | |
static real_iter_t * | getRealIter (iterator_t &i) throw () |
Private Attributes | |
smart_mutex | m_mutex |
std::deque< T > | m_queue |
dword_t | m_rvn |
A threadsafe FIFO queue. Supports basic push/pop operations, and iteration.
Definition at line 49 of file threadsafe_queue.h.
typedef std::deque<T>::iterator threadsafe_queue< T >::iterator [private] |
Definition at line 52 of file threadsafe_queue.h.
typedef threadsafe_queue<T> threadsafe_queue< T >::queue_t [private] |
Definition at line 53 of file threadsafe_queue.h.
void threadsafe_queue< T >::push_back | ( | T & | t | ) | [inline] |
push an element onto the back of the queue
Definition at line 67 of file threadsafe_queue.h.
bool threadsafe_queue< T >::pop_front | ( | T & | t | ) | [inline] |
pop an element from the front of the queue.
Returns false if the queue is empty
Definition at line 75 of file threadsafe_queue.h.
int threadsafe_queue< T >::size | ( | void | ) | const throw () [inline] |
returns the number of elements in the queue
Definition at line 88 of file threadsafe_queue.h.
void threadsafe_queue< T >::getIterator | ( | iterator_t & | i | ) | const throw () [inline] |
resets the given iterator to point to the beginning of the queue
Definition at line 95 of file threadsafe_queue.h.
bool threadsafe_queue< T >::getNextElement | ( | iterator_t & | i, | |
T & | t | |||
) | const [inline] |
gets element pointed to by iterator, and increments iterator
Definition at line 104 of file threadsafe_queue.h.
static int threadsafe_queue< T >::getRealIteratorSize | ( | void | ) | throw () [inline, static] |
for debugging/validation only
Definition at line 122 of file threadsafe_queue.h.
static real_iter_t* threadsafe_queue< T >::getRealIter | ( | iterator_t & | i | ) | throw () [inline, static, private] |
Definition at line 128 of file threadsafe_queue.h.
queue_t* threadsafe_queue< T >::getNonConst | ( | void | ) | const throw () [inline, private] |
Definition at line 135 of file threadsafe_queue.h.
smart_mutex threadsafe_queue< T >::m_mutex [private] |
Definition at line 140 of file threadsafe_queue.h.
std::deque<T> threadsafe_queue< T >::m_queue [private] |
Definition at line 141 of file threadsafe_queue.h.
dword_t threadsafe_queue< T >::m_rvn [private] |
Definition at line 142 of file threadsafe_queue.h.