Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FIFO< _T > Class Template Reference

#include <FIFO.h>

List of all members.

Public Member Functions

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

Public Attributes

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

Private Attributes

unsigned int m_depth

template<class _T>
class FIFO< _T >


Member Function Documentation

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

00103 { return size() < m_depth; }

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

00103 { return size() < m_depth; }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

00101 { return size() == m_depth; }

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

00101 { return size() == m_depth; }

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

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

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

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>
FIFO< _T >::m_depth f.  m_depth  )  [inline]
 

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

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

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]
 

00074       {
00075           return m_depth;
00076       }

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

00074       {
00075           return m_depth;
00076       }

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

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>
_T FIFO< _T >::pop  )  [inline]
 

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]
 

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>
void FIFO< _T >::printOn std::ostream out = cout  )  [inline]
 

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]
 

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

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

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 void   )  const [inline]
 

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

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

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


Member Data Documentation

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

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

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


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:15:11 2011 for BOSS6.5.5 by  doxygen 1.3.9.1