SGLockedQueue< T, SGLOCK > Class Template Reference

A simple thread safe queue. More...

#include <SGQueue.hxx>

Inheritance diagram for SGLockedQueue< T, SGLOCK >:
SGQueue< T >

List of all members.

Public Member Functions

 SGLockedQueue ()
 Create a new SGLockedQueue object.
 ~SGLockedQueue ()
 Destroy this object.
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 SGLOCK = OpenThreads::Mutex>
class SGLockedQueue< T, SGLOCK >

A simple thread safe queue.

All access functions are guarded with a mutex.

Definition at line 78 of file SGQueue.hxx.


Member Function Documentation

template<class T , class SGLOCK = OpenThreads::Mutex>
virtual bool SGLockedQueue< T, SGLOCK >::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 97 of file SGQueue.hxx.

template<class T , class SGLOCK = OpenThreads::Mutex>
virtual T SGLockedQueue< T, SGLOCK >::front (  )  [inline, virtual]

View the item from the head of the queue.

Returns:
T next available object.

Implements SGQueue< T >.

Definition at line 117 of file SGQueue.hxx.

template<class T , class SGLOCK = OpenThreads::Mutex>
virtual T SGLockedQueue< T, SGLOCK >::pop (  )  [inline, virtual]

Get an item from the head of the queue.

Returns:
T next available object.

Implements SGQueue< T >.

Definition at line 129 of file SGQueue.hxx.

template<class T , class SGLOCK = OpenThreads::Mutex>
virtual void SGLockedQueue< T, SGLOCK >::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 107 of file SGQueue.hxx.

template<class T , class SGLOCK = OpenThreads::Mutex>
virtual size_t SGLockedQueue< T, SGLOCK >::size (  )  [inline, virtual]

Query the size of the queue.

Returns:
size_t size of queue.

Implements SGQueue< T >.

Definition at line 148 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