Implements a thread-safe queue.
More...
#include <threadsafequeue.h>
|
| ThreadSafeQueue (const ThreadSafeQueue &)=delete |
ThreadSafeQueue & | operator= (const ThreadSafeQueue &)=delete |
void | Put (std::unique_ptr< T > &value) |
| Adds a value at the end of the queue.
|
bool | Get (std::unique_ptr< T > &dest, bool block) |
| Fetch the first object from the queue.
|
bool | Empty () const |
| Returns true if the queue is empty.
|
size_t | Size () const |
| Returns number of items in the queue.
|
void | Clear () |
| Clears the queue.
|
void | Start () |
| Restarts the queue.
|
void | Stop () |
| Stops all blocking Get() calls.
|
template<typename T>
class util::log::ThreadSafeQueue< T >
class ThreadSafeQueue threadsafequeue.h "util/threadsafequeue.h"
Implements a thread-safe queue based upon a std::queue. The queue uses stores the objects with smart pointers.
- Template Parameters
-
T | Type of object to store. |
◆ Empty()
Returns true if the queue is empty.
- Returns
- True if list is empty.
◆ Get()
Gets the first object in the queue. The function may block until a value is available. Deleting the queue will unblock the call and returning false.
- Parameters
-
dest | Returning object |
block | True if the function should block until a value is available. |
- Returns
- True if a value was returned.
◆ Put()
Add a value last in the queue.
- Parameters
-
◆ Size()
- Returns
- Number of items in the queue.
The documentation for this class was generated from the following file: