A guarded queue blocks threads trying to retrieve items when none are available. More...
#include <SGQueue.hxx>
Public Member Functions | |
SGBlockingQueue () | |
Create a new SGBlockingQueue. | |
~SGBlockingQueue () | |
Destroy this queue. | |
virtual bool | empty () |
Returns whether this queue is empty (contains no elements). | |
virtual void | push (const T &item) |
Add an item to the end of the queue. | |
virtual T | front () |
View the item from the head of the queue. | |
virtual T | pop () |
Get an item from the head of the queue. | |
virtual size_t | size () |
Query the size of the queue. |
A guarded queue blocks threads trying to retrieve items when none are available.
Definition at line 171 of file SGQueue.hxx.
virtual bool SGBlockingQueue< T >::empty | ( | ) | [inline, virtual] |
Returns whether this queue is empty (contains no elements).
Implements SGQueue< T >.
Definition at line 187 of file SGQueue.hxx.
virtual T SGBlockingQueue< T >::front | ( | ) | [inline, virtual] |
View the item from the head of the queue.
Calling thread is not suspended
Implements SGQueue< T >.
Definition at line 209 of file SGQueue.hxx.
virtual T SGBlockingQueue< T >::pop | ( | ) | [inline, virtual] |
Get an item from the head of the queue.
If no items are available then the calling thread is suspended
Implements SGQueue< T >.
Definition at line 225 of file SGQueue.hxx.
virtual void SGBlockingQueue< T >::push | ( | const T & | item | ) | [inline, virtual] |
Add an item to the end of the queue.
T | object to add. |
Implements SGQueue< T >.
Definition at line 197 of file SGQueue.hxx.
virtual size_t SGBlockingQueue< T >::size | ( | ) | [inline, virtual] |
Query the size of the queue.
Implements SGQueue< T >.
Definition at line 244 of file SGQueue.hxx.