BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
FIFO< _T > Class Template Reference

#include <FIFO.h>

Inheritance diagram for FIFO< _T >:

Public Member Functions

 FIFO (unsigned int depth=0)
 FIFO (const FIFO &f)
bool push (const _T &x)
_T pop ()
_Tfront ()
_Tback ()
const _Tfront () const
const _Tback () 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
 FIFO (unsigned int depth=0)
 FIFO (const FIFO &f)
bool push (const _T &x)
_T pop ()
_Tfront ()
_Tback ()
const _Tfront () const
const _Tback () 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
 FIFO (unsigned int depth=0)
 FIFO (const FIFO &f)
bool push (const _T &x)
_T pop ()
_Tfront ()
_Tback ()
const _Tfront () const
const _Tback () 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

Detailed Description

template<class _T>
class FIFO< _T >

Definition at line 20 of file Calibration/facilities/include/facilities/FIFO.h.

Constructor & Destructor Documentation

◆ FIFO() [1/6]

template<class _T>
FIFO< _T >::FIFO ( unsigned int depth = 0)
inline

Definition at line 23 of file Calibration/facilities/include/facilities/FIFO.h.

23 : vector<_T>(), m_depth( depth ) {
24 if ( depth > 0 ) reserve( depth );
25
26 // if the depth of the fifo is fixed, then reserve enough space to contain it entirely
27 // FIFO operates in two modes: one for a fixed depth,
28 // and another for a non-fixed depth (unlimited)
29 }

Referenced by FIFO().

◆ FIFO() [2/6]

template<class _T>
FIFO< _T >::FIFO ( const FIFO< _T > & f)
inline

Definition at line 31 of file Calibration/facilities/include/facilities/FIFO.h.

31: vector<_T>( f ), m_depth( f.m_depth ) {}

◆ FIFO() [3/6]

template<class _T>
FIFO< _T >::FIFO ( unsigned int depth = 0)
inline

Definition at line 23 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

23 : vector<_T>(), m_depth( depth ) {
24 if ( depth > 0 ) reserve( depth );
25
26 // if the depth of the fifo is fixed, then reserve enough space to contain it entirely
27 // FIFO operates in two modes: one for a fixed depth,
28 // and another for a non-fixed depth (unlimited)
29 }

◆ FIFO() [4/6]

template<class _T>
FIFO< _T >::FIFO ( const FIFO< _T > & f)
inline

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

31: vector<_T>( f ), m_depth( f.m_depth ) {}

◆ FIFO() [5/6]

template<class _T>
FIFO< _T >::FIFO ( unsigned int depth = 0)
inline

Definition at line 23 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

23 : vector<_T>(), m_depth( depth ) {
24 if ( depth > 0 ) reserve( depth );
25
26 // if the depth of the fifo is fixed, then reserve enough space to contain it entirely
27 // FIFO operates in two modes: one for a fixed depth,
28 // and another for a non-fixed depth (unlimited)
29 }

◆ FIFO() [6/6]

template<class _T>
FIFO< _T >::FIFO ( const FIFO< _T > & f)
inline

Definition at line 31 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

31: vector<_T>( f ), m_depth( f.m_depth ) {}

Member Function Documentation

◆ avail() [1/3]

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

Definition at line 86 of file Calibration/facilities/include/facilities/FIFO.h.

86{ return size() < m_depth; }

◆ avail() [2/3]

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

Definition at line 86 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

86{ return size() < m_depth; }

◆ avail() [3/3]

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

Definition at line 86 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

86{ return size() < m_depth; }

◆ back() [1/6]

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

Definition at line 57 of file Calibration/facilities/include/facilities/FIFO.h.

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

◆ back() [2/6]

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

◆ back() [3/6]

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

◆ back() [4/6]

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

Definition at line 60 of file Calibration/facilities/include/facilities/FIFO.h.

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

◆ back() [5/6]

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

◆ back() [6/6]

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

◆ clear() [1/3]

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

◆ clear() [2/3]

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

◆ clear() [3/3]

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

◆ empty() [1/3]

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

Definition at line 62 of file Calibration/facilities/include/facilities/FIFO.h.

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

◆ empty() [2/3]

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

Definition at line 62 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

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

◆ empty() [3/3]

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

Definition at line 62 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

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

◆ front() [1/6]

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

Definition at line 56 of file Calibration/facilities/include/facilities/FIFO.h.

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

◆ front() [2/6]

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

◆ front() [3/6]

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

◆ front() [4/6]

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

Definition at line 59 of file Calibration/facilities/include/facilities/FIFO.h.

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

◆ front() [5/6]

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

◆ front() [6/6]

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

◆ full() [1/3]

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

Definition at line 84 of file Calibration/facilities/include/facilities/FIFO.h.

84{ return size() == m_depth; }

◆ full() [2/3]

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

Definition at line 84 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

84{ return size() == m_depth; }

◆ full() [3/3]

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

Definition at line 84 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

84{ return size() == m_depth; }

◆ maxSize() [1/3]

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

Definition at line 65 of file Calibration/facilities/include/facilities/FIFO.h.

65{ return m_depth; }

◆ maxSize() [2/3]

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

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

65{ return m_depth; }

◆ maxSize() [3/3]

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

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

65{ return m_depth; }

◆ pop() [1/3]

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

Definition at line 46 of file Calibration/facilities/include/facilities/FIFO.h.

46 {
47 assert( size() > 0 );
48 _T value( *begin() );
49 erase( begin() );
50
51 // limited depth mode
52
53 return value;
54 }

◆ pop() [2/3]

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

Definition at line 46 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

46 {
47 assert( size() > 0 );
48 _T value( *begin() );
49 erase( begin() );
50
51 // limited depth mode
52
53 return value;
54 }

◆ pop() [3/3]

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

Definition at line 46 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

46 {
47 assert( size() > 0 );
48 _T value( *begin() );
49 erase( begin() );
50
51 // limited depth mode
52
53 return value;
54 }

◆ printOn() [1/3]

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

Definition at line 73 of file Calibration/facilities/include/facilities/FIFO.h.

73 {
74 short i = 1;
75 for ( vector<_T>::reverse_iterator it = rbegin(); it != rend(); ++it )
76 {
77 out << ( *it )();
78 if ( ( i % 8 ) == 0 ) out << "\n";
79 else out << "\t";
80 i++;
81 }
82 }

◆ printOn() [2/3]

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

Definition at line 73 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

73 {
74 short i = 1;
75 for ( vector<_T>::reverse_iterator it = rbegin(); it != rend(); ++it )
76 {
77 out << ( *it )();
78 if ( ( i % 8 ) == 0 ) out << "\n";
79 else out << "\t";
80 i++;
81 }
82 }

◆ printOn() [3/3]

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

Definition at line 73 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

73 {
74 short i = 1;
75 for ( vector<_T>::reverse_iterator it = rbegin(); it != rend(); ++it )
76 {
77 out << ( *it )();
78 if ( ( i % 8 ) == 0 ) out << "\n";
79 else out << "\t";
80 i++;
81 }
82 }

◆ push() [1/3]

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

Definition at line 35 of file Calibration/facilities/include/facilities/FIFO.h.

35 {
36 if ( ( m_depth != 0 ) && ( size() >= m_depth ) ) return false;
37
38 push_back( x );
39
40 return true;
41 }

◆ push() [2/3]

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

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-dbg/include/facilities/FIFO.h.

35 {
36 if ( ( m_depth != 0 ) && ( size() >= m_depth ) ) return false;
37
38 push_back( x );
39
40 return true;
41 }

◆ push() [3/3]

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

Definition at line 35 of file InstallArea/x86_64-el9-gcc13-opt/include/facilities/FIFO.h.

35 {
36 if ( ( m_depth != 0 ) && ( size() >= m_depth ) ) return false;
37
38 push_back( x );
39
40 return true;
41 }

◆ size() [1/3]

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

Definition at line 68 of file Calibration/facilities/include/facilities/FIFO.h.

68{ return vector<_T>::size(); }

Referenced by avail(), empty(), full(), pop(), and push().

◆ size() [2/3]

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

◆ size() [3/3]

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

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