fesa-core
7.0.0
|
#include <ConcurrentQueue.h>
Inherits noncopyable.
Public Member Functions | |
ConcurrentQueue (const std::string &name, std::size_t maxSize) | |
void | push (const T &item) |
T | pop () |
blocking call to retrieve the first item of the queue. This method will block if the queue is empty. More... | |
void | clear () |
Removes every element in the queue. | |
std::size_t | size () const |
This class offers a thread-safe queue. Several consumers can be waiting at the same time on an item; the one with the highest priority will be woken up first.
T | the type of items to store in the queue |
fesa::ConcurrentQueue< T >::ConcurrentQueue | ( | const std::string & | name, |
std::size_t | maxSize | ||
) |
Instantiates a ConcurrentQueue object.
name | a name to identify this queue |
maxSize | maximum size of the queue. Memory is pre-allocated. |
T fesa::ConcurrentQueue< T >::pop | ( | ) |
blocking call to retrieve the first item of the queue. This method will block if the queue is empty.
void fesa::ConcurrentQueue< T >::push | ( | const T & | item | ) |
Adds an item to the end of the queue.
item | the item to add to the queue |
FesaException | with error code FesaErrorQueueFull if the queue is full when trying to add the item |
std::size_t fesa::ConcurrentQueue< T >::size | ( | ) | const |