RTT::Queue< T, ReadPolicy, WritePolicy > Class Template Reference

This object represents the default queue implementation used by Orocos objects. More...

#include <rtt/Queue.hpp>

Inheritance diagram for RTT::Queue< T, ReadPolicy, WritePolicy >:
RTT::AtomicQueue< T, ReadPolicy, WritePolicy >

List of all members.

Public Types

typedef T value_t
typedef unsigned int size_type

Public Member Functions

 Queue (int qsize, int t=ORONUM_OS_MAX_THREADS)
 Create a queue of fixed size.
size_type capacity () const
size_type size () const
bool isEmpty () const
 Inspect if the Queue is empty.
bool isFull () const
 Inspect if the Queue is full.
void clear ()
bool enqueue (const T &value)
 Enqueue an item.
int enqueueCounted (const T &value)
 Enqueue an item and return its 'ticket' number.
bool dequeue (T &result)
 Dequeue an item.
int dequeueCounted (T &result)
 Dequeue an item and return the same 'ticket' number when it was queued.
template<class MPoolType >
lockfront (MPoolType &mp) const
 Return the next to be read value and lock it in a MemoryPool, such that it is not freed.
value_t front () const
 Returns the first element of the queue.
value_t back () const
 Returns the last element of the queue.

Public Attributes

const unsigned int MAX_THREADS
 The maximum number of threads.

Detailed Description

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
class RTT::Queue< T, ReadPolicy, WritePolicy >

This object represents the default queue implementation used by Orocos objects.

Definition at line 25 of file Queue.hpp.


Constructor & Destructor Documentation

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
RTT::Queue< T, ReadPolicy, WritePolicy >::Queue ( int  qsize,
int  t = ORONUM_OS_MAX_THREADS 
) [inline]

Create a queue of fixed size.

Optionally, add the number of threads that may concurrently access this queue.

Definition at line 38 of file Queue.hpp.


Member Function Documentation

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
bool RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::dequeue ( T &  result  )  [inline, inherited]

Dequeue an item.

Parameters:
result The value dequeued.
Returns:
false if queue is empty, true if dequeued.

Definition at line 256 of file AtomicQueue.hpp.

Referenced by RTT::FixedSizeMemoryPool< Item >::allocate(), RTT::BufferLockFree< T, ReadPolicy, WritePolicy >::clear(), and RTT::BufferLockFree< T, ReadPolicy, WritePolicy >::Pop().

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
int RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::dequeueCounted ( T &  result  )  [inline, inherited]

Dequeue an item and return the same 'ticket' number when it was queued.

Parameters:
value The value dequeued.
Returns:
zero if the queue is empty, the 'ticket' number otherwise.
Deprecated:
Do not use this function

Definition at line 291 of file AtomicQueue.hpp.

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
bool RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::enqueue ( const T &  value  )  [inline, inherited]

Enqueue an item.

Parameters:
value The value to enqueue.
Returns:
false if queue is full, true if queued.

Definition at line 210 of file AtomicQueue.hpp.

Referenced by RTT::FixedSizeMemoryPool< Item >::deallocate(), RTT::AtomicQueue< CommandInterface *, NonBlockingPolicy, NonBlockingPolicy >::dequeue(), and RTT::FixedSizeMemoryPool< Item >::make_pool().

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
int RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::enqueueCounted ( const T &  value  )  [inline, inherited]

Enqueue an item and return its 'ticket' number.

Parameters:
value The value to enqueue.
Returns:
zero if the queue is full, the 'ticket' number otherwise.
Deprecated:
Do not use this function

Definition at line 242 of file AtomicQueue.hpp.

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
bool RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::isEmpty (  )  const [inline, inherited]

Inspect if the Queue is empty.

Returns:
true if empty, false otherwise.

Definition at line 163 of file AtomicQueue.hpp.

Referenced by RTT::BufferLockFree< T, ReadPolicy, WritePolicy >::empty().

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
bool RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::isFull (  )  const [inline, inherited]

Inspect if the Queue is full.

Returns:
true if full, false otherwise.

Definition at line 176 of file AtomicQueue.hpp.

Referenced by RTT::BufferLockFree< T, ReadPolicy, WritePolicy >::full().

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
template<class MPoolType >
T RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::lockfront ( MPoolType &  mp  )  const [inline, inherited]

Return the next to be read value and lock it in a MemoryPool, such that it is not freed.

The returned pointer must be unlock()'ed by the user's code.

Definition at line 307 of file AtomicQueue.hpp.

Referenced by RTT::BufferLockFree< T, ReadPolicy, WritePolicy >::front().


Member Data Documentation

template<class T, class ReadPolicy = NonBlockingPolicy, class WritePolicy = NonBlockingPolicy>
const unsigned int RTT::AtomicQueue< T, ReadPolicy, WritePolicy >::MAX_THREADS [inherited]

The maximum number of threads.

The number of threads which may concurrently access this buffer.

Definition at line 53 of file AtomicQueue.hpp.

Referenced by RTT::AtomicQueue< CommandInterface *, NonBlockingPolicy, NonBlockingPolicy >::AtomicQueue().


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:44 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3