SGBlockingQueue< T > Class Template Reference

A guarded queue blocks threads trying to retrieve items when none are available. More...

#include <SGQueue.hxx>

Inheritance diagram for SGBlockingQueue< T >:
SGQueue< T >

List of all members.

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.

Detailed Description

template<class T>
class SGBlockingQueue< T >

A guarded queue blocks threads trying to retrieve items when none are available.

Definition at line 171 of file SGQueue.hxx.


Member Function Documentation

template<class T >
virtual bool SGBlockingQueue< T >::empty (  )  [inline, virtual]

Returns whether this queue is empty (contains no elements).

Returns:
bool True if queue is empty, otherwisr false.

Implements SGQueue< T >.

Definition at line 187 of file SGQueue.hxx.

template<class T >
virtual T SGBlockingQueue< T >::front (  )  [inline, virtual]

View the item from the head of the queue.

Calling thread is not suspended

Returns:
T next available object.

Implements SGQueue< T >.

Definition at line 209 of file SGQueue.hxx.

template<class T >
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

Returns:
T next available object.

Implements SGQueue< T >.

Definition at line 225 of file SGQueue.hxx.

template<class T >
virtual void SGBlockingQueue< T >::push ( const T &  item  )  [inline, virtual]

Add an item to the end of the queue.

Parameters:
T object to add.

Implements SGQueue< T >.

Definition at line 197 of file SGQueue.hxx.

template<class T >
virtual size_t SGBlockingQueue< T >::size (  )  [inline, virtual]

Query the size of the queue.

Returns:
size_t size of queue.

Implements SGQueue< T >.

Definition at line 244 of file SGQueue.hxx.


The documentation for this class was generated from the following file:

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1