eq::base::LFQueue< T > Class Template Reference

A thread-safe, lock-free queue with non-blocking access. More...

#include <lfQueue.h>

Inheritance diagram for eq::base::LFQueue< T >:
Inheritance graph
[legend]
Collaboration diagram for eq::base::LFQueue< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LFQueue (const int32_t size)
 Construct a new queue.
 ~LFQueue ()
 Destruct this queue.
bool isEmpty () const
void clear ()
 Reset (empty) the queue.
bool pop (T &result)
 Retrieve and pop the front element from the queue.
bool getFront (T &result)
 Retrieve the front element from the queue.
bool push (const T &element)
 Push a new element to the back of the queue.

Detailed Description

template<typename T>
class eq::base::LFQueue< T >

A thread-safe, lock-free queue with non-blocking access.

Typically used for caches and non-blocking communication between two execution threads.

Current implementation constraints:

Definition at line 46 of file lfQueue.h.


Constructor & Destructor Documentation

template<typename T>
eq::base::LFQueue< T >::LFQueue ( const int32_t  size  )  [inline]

Construct a new queue.

Version:
1.0

Definition at line 50 of file lfQueue.h.

template<typename T>
eq::base::LFQueue< T >::~LFQueue (  )  [inline]

Destruct this queue.

Version:
1.0

Definition at line 55 of file lfQueue.h.


Member Function Documentation

template<typename T>
bool eq::base::LFQueue< T >::isEmpty (  )  const [inline]
Returns:
true if the queue is empty, false otherwise.
Version:
1.0

Definition at line 58 of file lfQueue.h.

template<typename T>
void eq::base::LFQueue< T >::clear (  )  [inline]

Reset (empty) the queue.

Version:
1.0

Definition at line 61 of file lfQueue.h.

Referenced by eq::net::RSPConnection::close().

Here is the caller graph for this function:

template<typename T>
bool eq::base::LFQueue< T >::pop ( T &  result  )  [inline]

Retrieve and pop the front element from the queue.

Parameters:
result the front value or unmodified
Returns:
true if an element was placed in result, false if the queue is empty.
Version:
1.0

Definition at line 76 of file lfQueue.h.

template<typename T>
bool eq::base::LFQueue< T >::getFront ( T &  result  )  [inline]

Retrieve the front element from the queue.

Parameters:
result the front value or unmodified
Returns:
true if an element was placed in result, false if the queue is empty.
Version:
1.0

Definition at line 95 of file lfQueue.h.

template<typename T>
bool eq::base::LFQueue< T >::push ( const T &  element  )  [inline]

Push a new element to the back of the queue.

Parameters:
element the element to add.
Returns:
true if the element was placed, false if the queue is full
Version:
1.0

Definition at line 112 of file lfQueue.h.

Referenced by eq::net::RSPConnection::readSync(), and eq::net::RSPConnection::write().

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
Generated on Sat Feb 6 13:07:59 2010 for Equalizer 0.9.1 by  doxygen 1.6.1