FIFO< _T > Class Template Reference

#include <FIFO.h>

List of all members.

Public Member Functions

 m_depth (depth)
 m_depth (f.m_depth)
bool push (const _T &x)
_T pop ()
_T & front ()
_T & back ()
const _T & front () const
const _T & back () const
bool empty () const
unsigned int maxSize () const
unsigned int size () const
void clear ()
void printOn (std::ostream &out=cout)
bool full () const
bool avail () const

Public Attributes

 __pad0__: vector<_T>()
 __pad1__: vector<_T>(f)

Private Attributes

unsigned int m_depth


Detailed Description

template<class _T>
class FIFO< _T >

Definition at line 20 of file FIFO.h.


Member Function Documentation

template<class _T>
bool FIFO< _T >::avail (  )  const [inline]

Definition at line 103 of file FIFO.h.

References FIFO< _T >::m_depth, and FIFO< _T >::size().

00103 { return size() < m_depth; }

template<class _T>
const _T& FIFO< _T >::back (  )  const [inline]

Definition at line 68 of file FIFO.h.

00068 { return vector<_T>::back(); }

template<class _T>
_T& FIFO< _T >::back (  )  [inline]

Definition at line 65 of file FIFO.h.

00065 { return vector<_T>::back(); }

template<class _T>
void FIFO< _T >::clear (  )  [inline]

Definition at line 84 of file FIFO.h.

00085       {
00086          vector<_T>::clear();
00087       }

template<class _T>
bool FIFO< _T >::empty (  )  const [inline]

Definition at line 70 of file FIFO.h.

References FIFO< _T >::size().

00070 { return (size() == 0); }

template<class _T>
const _T& FIFO< _T >::front (  )  const [inline]

Definition at line 67 of file FIFO.h.

00067 { return vector<_T>::front(); }

template<class _T>
_T& FIFO< _T >::front (  )  [inline]

Definition at line 64 of file FIFO.h.

00064 { return vector<_T>::front(); }

template<class _T>
bool FIFO< _T >::full (  )  const [inline]

Definition at line 101 of file FIFO.h.

References FIFO< _T >::m_depth, and FIFO< _T >::size().

00101 { return size() == m_depth; }

template<class _T>
FIFO< _T >::m_depth ( f.  m_depth  )  [inline]

Definition at line 34 of file FIFO.h.

00034         : vector<_T>(f), m_depth(f.m_depth)
00035     {
00036     }

template<class _T>
FIFO< _T >::m_depth ( depth   )  [inline]

Definition at line 24 of file FIFO.h.

00024         : vector<_T>(), m_depth(depth)    
00025     {
00026         if (depth > 0)  reserve ( depth );
00027 
00028         // if the depth of the fifo is fixed, then reserve enough space to contain it entirely
00029         // FIFO operates in two modes: one for a fixed depth,
00030         // and another for a non-fixed depth (unlimited)
00031     }

template<class _T>
unsigned int FIFO< _T >::maxSize (  )  const [inline]

Definition at line 73 of file FIFO.h.

References FIFO< _T >::m_depth.

00074       {
00075           return m_depth;
00076       }

template<class _T>
_T FIFO< _T >::pop (  )  [inline]

Definition at line 53 of file FIFO.h.

References _T, and FIFO< _T >::size().

00054       {
00055           assert(size()>0);
00056           _T    value (*begin());
00057           erase(begin());
00058           
00059           // limited depth mode
00060           
00061           return value;
00062       }

template<class _T>
void FIFO< _T >::printOn ( std::ostream out = cout  )  [inline]

Definition at line 90 of file FIFO.h.

References genRecEmupikp::i, rbegin, and rend.

00091       {
00092           short i = 1;
00093           for (vector<_T>::reverse_iterator it = rbegin(); it != rend(); ++it) {
00094               out << (*it)();
00095               if ((i % 8) == 0) out << "\n";
00096               else  out << "\t";
00097               i++;
00098           }
00099       }

template<class _T>
bool FIFO< _T >::push ( const _T &  x  )  [inline]

Definition at line 41 of file FIFO.h.

References FIFO< _T >::m_depth, push_back(), and FIFO< _T >::size().

00042       {
00043           if ((m_depth != 0) && (size() >= m_depth))    return false;
00044 
00045           push_back( x );
00046 
00047           return true;
00048       }

template<class _T>
unsigned int FIFO< _T >::size (  )  const [inline]

Definition at line 79 of file FIFO.h.

References delete_small_size::size.

Referenced by FIFO< _T >::avail(), FIFO< _T >::empty(), FIFO< _T >::full(), FIFO< _T >::pop(), and FIFO< _T >::push().

00080       {
00081           return vector<_T>::size();
00082       }


Member Data Documentation

template<class _T>
FIFO< _T >::__pad0__

Definition at line 24 of file FIFO.h.

template<class _T>
FIFO< _T >::__pad1__

Definition at line 34 of file FIFO.h.

template<class _T>
unsigned int FIFO< _T >::m_depth [private]

Definition at line 108 of file FIFO.h.

Referenced by FIFO< _T >::avail(), FIFO< _T >::full(), FIFO< _T >::maxSize(), and FIFO< _T >::push().


Generated on Tue Nov 29 23:19:35 2016 for BOSS_7.0.2 by  doxygen 1.4.7