gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::Fifo< T > Class Template Reference

Simple FIFO implementation backed by a circular buffer. More...

#include <circlebuf.hh>

Public Types

typedef T value_type
 

Public Member Functions

 Fifo (size_t size)
 
bool empty () const
 
size_t size () const
 
size_t capacity () const
 
void flush ()
 
template<class OutputIterator >
void peek (OutputIterator out, size_t len) const
 
template<class OutputIterator >
void read (OutputIterator out, size_t len)
 
template<class InputIterator >
void write (InputIterator in, size_t len)
 

Private Attributes

CircleBuf< value_typebuf
 

Detailed Description

template<typename T>
class gem5::Fifo< T >

Simple FIFO implementation backed by a circular buffer.

This class provides the same basic functionallity as the circular buffer with the folling differences:

  • Writes are checked to ensure that overflows can't happen.
  • Unserialization ensures that the data in the checkpoint fits in the buffer.

Definition at line 213 of file circlebuf.hh.

Member Typedef Documentation

◆ value_type

template<typename T >
typedef T gem5::Fifo< T >::value_type

Definition at line 216 of file circlebuf.hh.

Constructor & Destructor Documentation

◆ Fifo()

template<typename T >
gem5::Fifo< T >::Fifo ( size_t size)
inline

Definition at line 219 of file circlebuf.hh.

Member Function Documentation

◆ capacity()

template<typename T >
size_t gem5::Fifo< T >::capacity ( ) const
inline

◆ empty()

template<typename T >
bool gem5::Fifo< T >::empty ( ) const
inline

Definition at line 221 of file circlebuf.hh.

References gem5::Fifo< T >::buf, and gem5::CircleBuf< T >::empty().

◆ flush()

template<typename T >
void gem5::Fifo< T >::flush ( )
inline

◆ peek()

template<typename T >
template<class OutputIterator >
void gem5::Fifo< T >::peek ( OutputIterator out,
size_t len ) const
inline

Definition at line 228 of file circlebuf.hh.

References gem5::Fifo< T >::buf, gem5::ArmISA::len, and gem5::CircleBuf< T >::peek().

Referenced by gem5::arrayParamOut().

◆ read()

template<typename T >
template<class OutputIterator >
void gem5::Fifo< T >::read ( OutputIterator out,
size_t len )
inline

◆ size()

◆ write()

template<typename T >
template<class InputIterator >
void gem5::Fifo< T >::write ( InputIterator in,
size_t len )
inline

Member Data Documentation

◆ buf


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

Generated on Tue Jun 18 2024 16:24:11 for gem5 by doxygen 1.11.0