A thread-safe queue with a blocking read access.
More...
#include <mtQueue.h>
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.
|
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.
|
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
Construct a new queue.
- Version:
- 1.0
Definition at line 41 of file mtQueue.h.
Construct a copy of a queue.
- Version:
- 1.0
Definition at line 44 of file mtQueue.h.
Destruct this Queue.
- Version:
- 1.0
Definition at line 47 of file mtQueue.h.
Member Function Documentation
Reset (empty) the queue.
- Version:
- 1.0
Definition at line 66 of file mtQueue.h.
- Parameters:
-
result | the 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.
- Parameters:
-
result | the 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.
Assign the values of another queue.
- Version:
- 1.0
Definition at line 50 of file mtQueue.h.
Retrieve and pop the front element from the queue, may block.
- Version:
- 1.0
Definition at line 77 of file mtQueue.h.
Push a vector of elements to the back of the queue.
- Version:
- 1.0
Definition at line 163 of file mtQueue.h.
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.
Retrieve and pop the front element from the queue if it is not empty.
- Parameters:
-
result | the 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: