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

A lock-based queue implementation to enqueue or dequeue a pointer of type T. More...

#include <rtt/internal/LockedQueue.hpp>

Public Types

typedef T value_t
 
typedef unsigned int size_type
 

Public Member Functions

 LockedQueue (unsigned int lsize)
 Create a lock-based queue wich can store lsize elements. More...
 
 ~LockedQueue ()
 
size_type capacity () const
 
size_type size () const
 
bool isEmpty () const
 Inspect if the Queue is empty. More...
 
bool isFull () const
 Inspect if the Queue is full. More...
 
void clear ()
 
bool enqueue (const T &value)
 Enqueue an item. More...
 
bool dequeue (T &result)
 Dequeue an item. More...
 
value_t front () const
 Returns the first element of the queue. More...
 
value_t back () const
 Returns the last element of the queue. More...
 

Detailed Description

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

A lock-based queue implementation to enqueue or dequeue a pointer of type T.

No memory allocation is done during read or write.

Parameters
TThe pointer type to be stored in the queue. Example : LockedQueue<A*> is a queue which holds values of type A.

Definition at line 58 of file LockedQueue.hpp.

Member Typedef Documentation

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

Definition at line 71 of file LockedQueue.hpp.

template<class T >
typedef T RTT::internal::LockedQueue< T >::value_t

Definition at line 61 of file LockedQueue.hpp.

Constructor & Destructor Documentation

template<class T >
RTT::internal::LockedQueue< T >::LockedQueue ( unsigned int  lsize)
inline

Create a lock-based queue wich can store lsize elements.

Parameters
lsizethe capacity of the queue. '

Definition at line 77 of file LockedQueue.hpp.

template<class T >
RTT::internal::LockedQueue< T >::~LockedQueue ( )
inline

Definition at line 84 of file LockedQueue.hpp.

Member Function Documentation

template<class T >
value_t RTT::internal::LockedQueue< T >::back ( ) const
inline

Returns the last element of the queue.

Definition at line 172 of file LockedQueue.hpp.

template<class T >
size_type RTT::internal::LockedQueue< T >::capacity ( ) const
inline

Definition at line 87 of file LockedQueue.hpp.

template<class T >
void RTT::internal::LockedQueue< T >::clear ( )
inline

Definition at line 118 of file LockedQueue.hpp.

template<class T >
bool RTT::internal::LockedQueue< T >::dequeue ( T &  result)
inline

Dequeue an item.

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

Definition at line 145 of file LockedQueue.hpp.

template<class T >
bool RTT::internal::LockedQueue< T >::enqueue ( const T &  value)
inline

Enqueue an item.

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

Definition at line 129 of file LockedQueue.hpp.

template<class T >
value_t RTT::internal::LockedQueue< T >::front ( ) const
inline

Returns the first element of the queue.

Definition at line 160 of file LockedQueue.hpp.

template<class T >
bool RTT::internal::LockedQueue< T >::isEmpty ( ) const
inline

Inspect if the Queue is empty.

Returns
true if empty, false otherwise.

Definition at line 102 of file LockedQueue.hpp.

template<class T >
bool RTT::internal::LockedQueue< T >::isFull ( ) const
inline

Inspect if the Queue is full.

Returns
true if full, false otherwise.

Definition at line 112 of file LockedQueue.hpp.

template<class T >
size_type RTT::internal::LockedQueue< T >::size ( ) const
inline

Definition at line 92 of file LockedQueue.hpp.


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