Orocos Real-Time Toolkit  2.8.3
Public Types | Public Member Functions | List of all members
RTT::internal::Queue< T > Class Template Reference

This object represents the default Multi-Writer/Multi-Reader queue implementation used by Orocos objects. More...

#include <rtt/internal/Queue.hpp>

Inheritance diagram for RTT::internal::Queue< T >:
RTT::internal::AtomicQueue< T >

Public Types

typedef unsigned int size_type
 

Public Member Functions

 Queue (int qsize)
 Create a mw/sr queue of fixed size. More...
 
bool isFull () const
 Inspect if the Queue is full. More...
 
bool isEmpty () const
 Inspect if the Queue is empty. More...
 
size_type capacity () const
 Return the maximum number of items this queue can contain. More...
 
size_type size () const
 Return the exact number of elements in the queue. More...
 
bool enqueue (const T &value)
 Enqueue an item. More...
 
bool dequeue (T &result)
 Dequeue an item. More...
 
const T front () const
 Return the next to be read value. More...
 
void clear ()
 Clear all contents of the Queue and thus make it empty. More...
 

Detailed Description

template<class T>
class RTT::internal::Queue< T >

This object represents the default Multi-Writer/Multi-Reader queue implementation used by Orocos objects.

Definition at line 65 of file Queue.hpp.

Member Typedef Documentation

template<class T >
typedef unsigned int RTT::internal::AtomicQueue< T >::size_type
inherited

Definition at line 184 of file AtomicQueue.hpp.

Constructor & Destructor Documentation

template<class T >
RTT::internal::Queue< T >::Queue ( int  qsize)
inline

Create a mw/sr queue of fixed size.

Definition at line 76 of file Queue.hpp.

Member Function Documentation

template<class T >
size_type RTT::internal::AtomicQueue< T >::capacity ( ) const
inlineinherited

Return the maximum number of items this queue can contain.

Definition at line 231 of file AtomicQueue.hpp.

template<class T >
void RTT::internal::AtomicQueue< T >::clear ( )
inlineinherited

Clear all contents of the Queue and thus make it empty.

Definition at line 304 of file AtomicQueue.hpp.

Referenced by RTT::internal::AtomicQueue< T >::AtomicQueue().

template<class T >
bool RTT::internal::AtomicQueue< T >::dequeue ( T &  result)
inlineinherited

Dequeue an item.

Parameters
valueThe value dequeued.
Returns
false if queue is empty, true if dequeued.

Definition at line 278 of file AtomicQueue.hpp.

References RTT::os::CAS().

template<class T >
bool RTT::internal::AtomicQueue< T >::enqueue ( const T &  value)
inlineinherited

Enqueue an item.

Parameters
valueThe value to enqueue, not zero.
Returns
false if queue is full or value is zero, true if queued.

Definition at line 258 of file AtomicQueue.hpp.

References RTT::os::CAS().

template<class T >
const T RTT::internal::AtomicQueue< T >::front ( ) const
inlineinherited

Return the next to be read value.

Definition at line 296 of file AtomicQueue.hpp.

template<class T >
bool RTT::internal::AtomicQueue< T >::isEmpty ( ) const
inlineinherited

Inspect if the Queue is empty.

Returns
true if empty, false otherwise.

Definition at line 220 of file AtomicQueue.hpp.

template<class T >
bool RTT::internal::AtomicQueue< T >::isFull ( ) const
inlineinherited

Inspect if the Queue is full.

Returns
true if full, false otherwise.

Definition at line 206 of file AtomicQueue.hpp.

template<class T >
size_type RTT::internal::AtomicQueue< T >::size ( ) const
inlineinherited

Return the exact number of elements in the queue.

This is slow because it scans the whole queue.

Definition at line 241 of file AtomicQueue.hpp.


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