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

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...
 
virtual bool isFull () const =0
 Inspect if the Queue is full. More...
 
virtual bool isEmpty () const =0
 Inspect if the Queue is empty. More...
 
virtual size_type capacity () const =0
 Return the maximum number of items this queue can contain. More...
 
virtual size_type size () const =0
 Return the exact number of elements in the queue. More...
 
virtual bool enqueue (const T &value)=0
 Enqueue an item. More...
 
virtual bool dequeue (T &result)=0
 Dequeue an item. More...
 
virtual const T front () const =0
 Return the next to be read value. More...
 
virtual void clear ()=0
 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 60 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>
virtual size_type RTT::internal::AtomicQueue< T >::capacity ( ) const
pure virtualinherited
template<class T>
virtual void RTT::internal::AtomicQueue< T >::clear ( )
pure virtualinherited

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

Implemented in RTT::internal::AtomicMWMRQueue< T >, and RTT::internal::AtomicMWSRQueue< T >.

Referenced by RTT::internal::AtomicQueue< Item * >::~AtomicQueue().

template<class T>
virtual bool RTT::internal::AtomicQueue< T >::dequeue ( T &  result)
pure virtualinherited
template<class T>
virtual bool RTT::internal::AtomicQueue< T >::enqueue ( const T &  value)
pure virtualinherited

Enqueue an item.

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

Implemented in RTT::internal::AtomicMWMRQueue< T >, and RTT::internal::AtomicMWSRQueue< T >.

Referenced by RTT::base::BufferLockFree< T >::Push(), and RTT::internal::AtomicQueue< Item * >::~AtomicQueue().

template<class T>
virtual const T RTT::internal::AtomicQueue< T >::front ( ) const
pure virtualinherited
template<class T>
virtual bool RTT::internal::AtomicQueue< T >::isEmpty ( ) const
pure virtualinherited

Inspect if the Queue is empty.

Returns
true if empty, false otherwise.

Implemented in RTT::internal::AtomicMWMRQueue< T >, and RTT::internal::AtomicMWSRQueue< T >.

Referenced by RTT::base::BufferLockFree< T >::empty(), and RTT::internal::AtomicQueue< Item * >::~AtomicQueue().

template<class T>
virtual bool RTT::internal::AtomicQueue< T >::isFull ( ) const
pure virtualinherited
template<class T>
virtual size_type RTT::internal::AtomicQueue< T >::size ( ) const
pure virtualinherited

Return the exact number of elements in the queue.

This is slow because it scans the whole queue.

Implemented in RTT::internal::AtomicMWMRQueue< T >, and RTT::internal::AtomicMWSRQueue< T >.

Referenced by RTT::base::BufferLockFree< T >::Push(), RTT::base::BufferLockFree< T >::size(), and RTT::internal::AtomicQueue< Item * >::~AtomicQueue().


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