This class implements a thread safe queue. More...
|typedef std::deque< T >::size_type||size_type|
|typedef std::deque< T >|
|Default Constructor. |
|Returns the next element. |
|std::pair< value_type, bool >||tryGet ()|
|Returns the next element if the queue is not empty. |
|void||put (const_reference element, bool force=false)|
|Adds a element to the queue. |
|bool||empty () const|
|Returns true, if the queue is empty. |
|size_type||size () const|
|Returns the number of elements currently in queue. |
|void||maxSize (size_type m)|
|sets the maximum size of the queue. |
|size_type||maxSize () const|
|returns the maximum size of the queue. |
|size_type||numWaiting () const|
|returns the number of threads blocked in the get method. |
class cxxtools::Queue< T >
This class implements a thread safe queue.
A queue is a container where the elements put into the queue are fetched in the same order (first-in-first-out, fifo). The class has a optional maximum size. If the size is set to 0 the queue has no limit. Otherwise putting a element to the queue may block until another thread fetches a element or increases the limit.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
Returns true, if the queue is empty.
Returns the next element.
This method returns the next element. If the queue is empty, the thread will be locked until a element is available.
sets the maximum size of the queue.
Setting the maximum size of the queue may wake up another thread, if it is waiting for space to get available and the limit is increased.
returns the maximum size of the queue.
returns the number of threads blocked in the get method.
Adds a element to the queue.
This method adds a element to the queue. If the queue has reached his maximum size, the method blocks until there is space available.
Returns the number of elements currently in queue.
|std::pair< typename Queue< T >::value_type, bool > cxxtools::Queue< T >::tryGet||(||)|
Returns the next element if the queue is not empty.
If the queue is empty, a default constructed value_type is returned. The returned flag is set to false, if the queue was empty.
The documentation for this class was generated from the following file: