Public Member Functions

eq::base::MTQueue< T > Class Template Reference

A thread-safe queue with a blocking read access. More...

#include <mtQueue.h>

Collaboration diagram for eq::base::MTQueue< T >:

List of all members.

Public Member Functions

 MTQueue ()
 Construct a new queue.
 MTQueue (const MTQueue< T > &from)
 Construct a copy of a queue.
 ~MTQueue ()
 Destruct this Queue.
MTQueue< T > & operator= (const MTQueue< T > &from)
 Assign the values of another queue.
bool isEmpty () const
size_t getSize () const
void clear ()
 Reset (empty) the queue.
pop ()
 Retrieve and pop the front element from the queue, may block.
bool tryPop (T &result)
 Retrieve and pop the front element from the queue if it is not empty.
bool getFront (T &result) const
bool getBack (T &result) const
void push (const T &element)
 Push a new element to the back of the queue.
void push (const std::vector< T > &elements)
 Push a vector of elements to the back of the queue.
void pushFront (const T &element)
 Push a new element to the front of the queue.
void pushFront (const std::vector< T > &elements)
 Push a vector of elements to the front of the queue.

Detailed Description

template<typename T>
class eq::base::MTQueue< T >

A thread-safe queue with a blocking read access.

Typically used to communicate between two execution threads.

Definition at line 37 of file mtQueue.h.


Constructor & Destructor Documentation

template<typename T>
eq::base::MTQueue< T >::MTQueue (  ) [inline]

Construct a new queue.

Version:
1.0

Definition at line 41 of file mtQueue.h.

template<typename T>
eq::base::MTQueue< T >::MTQueue ( const MTQueue< T > &  from ) [inline]

Construct a copy of a queue.

Version:
1.0

Definition at line 44 of file mtQueue.h.

template<typename T>
eq::base::MTQueue< T >::~MTQueue (  ) [inline]

Destruct this Queue.

Version:
1.0

Definition at line 47 of file mtQueue.h.


Member Function Documentation

template<typename T>
void eq::base::MTQueue< T >::clear (  ) [inline]

Reset (empty) the queue.

Version:
1.0

Definition at line 66 of file mtQueue.h.

template<typename T>
bool eq::base::MTQueue< T >::getBack ( T &  result ) const [inline]
Parameters:
resultthe last value or unmodified.
Returns:
true if an element was placed in result, false if the queue is empty.
Version:
1.0

Definition at line 139 of file mtQueue.h.

template<typename T>
bool eq::base::MTQueue< T >::getFront ( T &  result ) const [inline]
Parameters:
resultthe front value or unmodified.
Returns:
true if an element was placed in result, false if the queue is empty.
Version:
1.0

Definition at line 119 of file mtQueue.h.

template<typename T>
size_t eq::base::MTQueue< T >::getSize (  ) const [inline]
Returns:
the number of items currently in the queue.
Version:
1.0

Definition at line 63 of file mtQueue.h.

Referenced by co::CommandQueue::getSize().

Here is the caller graph for this function:

template<typename T>
bool eq::base::MTQueue< T >::isEmpty (  ) const [inline]
Returns:
true if the queue is empty, false otherwise.
Version:
1.0

Definition at line 60 of file mtQueue.h.

Referenced by co::CommandQueue::isEmpty().

Here is the caller graph for this function:

template<typename T>
MTQueue< T >& eq::base::MTQueue< T >::operator= ( const MTQueue< T > &  from ) [inline]

Assign the values of another queue.

Version:
1.0

Definition at line 50 of file mtQueue.h.

template<typename T>
T eq::base::MTQueue< T >::pop (  ) [inline]

Retrieve and pop the front element from the queue, may block.

Version:
1.0

Definition at line 77 of file mtQueue.h.

template<typename T>
void eq::base::MTQueue< T >::push ( const std::vector< T > &  elements ) [inline]

Push a vector of elements to the back of the queue.

Version:
1.0

Definition at line 163 of file mtQueue.h.

template<typename T>
void eq::base::MTQueue< T >::push ( const T &  element ) [inline]

Push a new element to the back of the queue.

Version:
1.0

Definition at line 154 of file mtQueue.h.

Referenced by co::CommandQueue::wakeup().

Here is the caller graph for this function:

template<typename T>
void eq::base::MTQueue< T >::pushFront ( const T &  element ) [inline]

Push a new element to the front of the queue.

Version:
1.0

Definition at line 172 of file mtQueue.h.

template<typename T>
void eq::base::MTQueue< T >::pushFront ( const std::vector< T > &  elements ) [inline]

Push a vector of elements to the front of the queue.

Version:
1.0

Definition at line 181 of file mtQueue.h.

template<typename T>
bool eq::base::MTQueue< T >::tryPop ( T &  result ) [inline]

Retrieve and pop the front element from the queue if it is not empty.

Parameters:
resultthe front value or unmodified.
Returns:
true if an element was placed in result, false if the queue is empty.
Version:
1.0

Definition at line 98 of file mtQueue.h.


The documentation for this class was generated from the following file:
Generated on Wed Dec 22 2010 15:45:47 for Equalizer 1.0-alpha by  1.7.2