xsens::FifoQueueBasic< T > Class Template Reference

A FIFO queue with limited length (cyclic). More...

#include <Robots/SeaBeeIII/IMUDataServer/xsens_fifoqueue.h>

List of all members.

Public Types

typedef T value_type
 The type of the value stored in this queue.
typedef size_t size_type
 The type of a 'size' value.

Public Member Functions

 FifoQueueBasic (size_type size=16)
 Create an empty queue with capacity 'size'.
 FifoQueueBasic (const FifoQueueBasic< T > &q)
 The copy constructor.
void eraseAndClear (void)
 ~FifoQueueBasic ()
 The destructor.
FifoQueueBasic< T > & operator= (const FifoQueueBasic< T > &q)
 The assignment operator.
void resize (const size_t size)
 Resize the queue, note that this function clears the queue.
bool empty () const
 Return true if the queue is empty.
size_type size () const
 Return the maximum number of elements in the queue.
size_type length () const
 Return the number of elements currently in the queue.
value_typefront ()
 Return the oldest element in the queue.
const value_typefront () const
 Return the oldest element in the queue.
value_typeback ()
 Return the newest element in the queue.
const value_typeback () const
 Return the newest element in the queue.
void push (const value_type &x)
 Insert x at the back of the queue.
void push_front (const value_type &x)
 Insert x at the front of the queue (LIFO operation).
void pop (void)
 Remove the element at the front of the queue.
void popBack (void)
 Remove the element at the back of the queue.
const value_typeoperator[] (size_t index) const
 Return the index'th oldest item from the queue.
value_typeoperator[] (size_t index)
 Return the index'th oldest item from the queue.
void clear (void)
void remove (size_t index)

Protected Attributes

size_t m_maxCount
size_t m_currentCount
size_t m_first
T * m_list

Detailed Description

template<class T>
class xsens::FifoQueueBasic< T >

A FIFO queue with limited length (cyclic).

The class is based on the STL queue class, but has a limited size. If more items are inserted than would fit, the oldest item is overwritten. The class can only handle non-pointer types.

Definition at line 250 of file xsens_fifoqueue.h.


Member Typedef Documentation

template<class T>
typedef size_t xsens::FifoQueueBasic< T >::size_type

The type of a 'size' value.

Definition at line 259 of file xsens_fifoqueue.h.

template<class T>
typedef T xsens::FifoQueueBasic< T >::value_type

The type of the value stored in this queue.

Definition at line 258 of file xsens_fifoqueue.h.


Constructor & Destructor Documentation

template<class T>
xsens::FifoQueueBasic< T >::FifoQueueBasic ( size_type  size = 16  )  [inline]

Create an empty queue with capacity 'size'.

Definition at line 262 of file xsens_fifoqueue.h.

References xsens::FifoQueueBasic< T >::size().

template<class T>
xsens::FifoQueueBasic< T >::FifoQueueBasic ( const FifoQueueBasic< T > &  q  )  [inline]

The copy constructor.

Definition at line 274 of file xsens_fifoqueue.h.

template<class T>
xsens::FifoQueueBasic< T >::~FifoQueueBasic (  )  [inline]

The destructor.

Definition at line 293 of file xsens_fifoqueue.h.


Member Function Documentation

template<class T>
const value_type& xsens::FifoQueueBasic< T >::back (  )  const [inline]

Return the newest element in the queue.

Definition at line 366 of file xsens_fifoqueue.h.

template<class T>
value_type& xsens::FifoQueueBasic< T >::back (  )  [inline]

Return the newest element in the queue.

Definition at line 360 of file xsens_fifoqueue.h.

template<class T>
bool xsens::FifoQueueBasic< T >::empty (  )  const [inline]

Return true if the queue is empty.

Definition at line 330 of file xsens_fifoqueue.h.

template<class T>
const value_type& xsens::FifoQueueBasic< T >::front (  )  const [inline]

Return the oldest element in the queue.

Definition at line 354 of file xsens_fifoqueue.h.

template<class T>
value_type& xsens::FifoQueueBasic< T >::front (  )  [inline]

Return the oldest element in the queue.

Definition at line 348 of file xsens_fifoqueue.h.

template<class T>
size_type xsens::FifoQueueBasic< T >::length (  )  const [inline]

Return the number of elements currently in the queue.

Definition at line 342 of file xsens_fifoqueue.h.

template<class T>
FifoQueueBasic<T>& xsens::FifoQueueBasic< T >::operator= ( const FifoQueueBasic< T > &  q  )  [inline]

The assignment operator.

Definition at line 300 of file xsens_fifoqueue.h.

template<class T>
value_type& xsens::FifoQueueBasic< T >::operator[] ( size_t  index  )  [inline]

Return the index'th oldest item from the queue.

Definition at line 423 of file xsens_fifoqueue.h.

template<class T>
const value_type& xsens::FifoQueueBasic< T >::operator[] ( size_t  index  )  const [inline]

Return the index'th oldest item from the queue.

Definition at line 414 of file xsens_fifoqueue.h.

template<class T>
void xsens::FifoQueueBasic< T >::pop ( void   )  [inline]

Remove the element at the front of the queue.

Definition at line 397 of file xsens_fifoqueue.h.

template<class T>
void xsens::FifoQueueBasic< T >::popBack ( void   )  [inline]

Remove the element at the back of the queue.

Definition at line 407 of file xsens_fifoqueue.h.

template<class T>
void xsens::FifoQueueBasic< T >::push ( const value_type x  )  [inline]

Insert x at the back of the queue.

Definition at line 372 of file xsens_fifoqueue.h.

template<class T>
void xsens::FifoQueueBasic< T >::push_front ( const value_type x  )  [inline]

Insert x at the front of the queue (LIFO operation).

Definition at line 386 of file xsens_fifoqueue.h.

template<class T>
void xsens::FifoQueueBasic< T >::resize ( const size_t  size  )  [inline]

Resize the queue, note that this function clears the queue.

Definition at line 317 of file xsens_fifoqueue.h.

template<class T>
size_type xsens::FifoQueueBasic< T >::size (  )  const [inline]

Return the maximum number of elements in the queue.

Definition at line 336 of file xsens_fifoqueue.h.

Referenced by xsens::FifoQueueBasic< T >::FifoQueueBasic().


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:44:46 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3