A thread-safe queue with a blocking read access. More...
#include <mtQueue.h>
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. | |
| T | 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. | |
A thread-safe queue with a blocking read access.
Typically used to communicate between two execution threads.
To instantiate the template code for this class, applications have to include pthread.h before this file. pthread.h is not automatically included to avoid hard to resolve type conflicts with other header files on Windows.
Definition at line 43 of file mtQueue.h.
| eq::base::MTQueue< T >::MTQueue | ( | ) |
Construct a new queue.
| eq::base::MTQueue< T >::MTQueue | ( | const MTQueue< T > & | from | ) |
Construct a copy of a queue.
| eq::base::MTQueue< T >::~MTQueue | ( | ) |
Destruct this Queue.
| MTQueue< T >& eq::base::MTQueue< T >::operator= | ( | const MTQueue< T > & | from | ) |
Assign the values of another queue.
| bool eq::base::MTQueue< T >::isEmpty | ( | ) | const [inline] |
Definition at line 59 of file mtQueue.h.
Referenced by eq::net::VersionedSlaveCM::addInstanceDatas(), eq::net::CommandQueue::isEmpty(), eq::net::RSPConnection::readSync(), eq::Node::TransmitThread::run(), and eq::net::RSPConnection::write().

| size_t eq::base::MTQueue< T >::getSize | ( | ) | const [inline] |
Definition at line 62 of file mtQueue.h.
Referenced by eq::net::CommandQueue::getSize().

| void eq::base::MTQueue< T >::clear | ( | ) |
Reset (empty) the queue.
Referenced by eq::net::RSPConnection::close(), and eq::net::RSPConnection::listen().

| T eq::base::MTQueue< T >::pop | ( | ) |
Retrieve and pop the front element from the queue, may block.
Referenced by eq::net::VersionedSlaveCM::applyMapData(), eq::net::CommandQueue::pop(), eq::net::RSPConnection::readSync(), eq::Node::TransmitThread::run(), eq::net::VersionedSlaveCM::sync(), and eq::net::RSPConnection::write().

| bool eq::base::MTQueue< T >::tryPop | ( | T & | result | ) |
Retrieve and pop the front element from the queue if it is not empty.
| result | the front value or unmodified. |
Referenced by eq::net::CommandQueue::flush(), and eq::net::CommandQueue::tryPop().

| bool eq::base::MTQueue< T >::getFront | ( | T & | result | ) | const |
| result | the front value or unmodified. |
Referenced by eq::net::VersionedSlaveCM::addInstanceDatas().

| bool eq::base::MTQueue< T >::getBack | ( | T & | result | ) | const |
| result | the last value or unmodified. |
Referenced by eq::net::VersionedSlaveCM::addInstanceDatas(), and eq::net::VersionedSlaveCM::getHeadVersion().

| void eq::base::MTQueue< T >::push | ( | const T & | element | ) |
Push a new element to the back of the queue.
Referenced by eq::net::VersionedSlaveCM::addInstanceDatas(), eq::net::RSPConnection::close(), eq::net::RSPConnection::listen(), eq::net::CommandQueue::push(), and eq::net::CommandQueue::wakeup().

| void eq::base::MTQueue< T >::push | ( | const std::vector< T > & | elements | ) |
Push a vector of elements to the back of the queue.
| void eq::base::MTQueue< T >::pushFront | ( | const T & | element | ) |
Push a new element to the front of the queue.
Referenced by eq::net::VersionedSlaveCM::addInstanceDatas(), and eq::net::CommandQueue::pushFront().

0.9.1 by
1.6.1