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

#include <circular_buffer.hh>

Public Member Functions

 circular_buffer (int size=0)
 
 ~circular_buffer ()
 
void resize (int size)
 
void clear ()
 
read ()
 
void write (const T &)
 
bool is_empty () const
 
bool is_full () const
 
int size () const
 
int used () const
 
int free () const
 
const T & read_data () const
 
const T & peek_data (int i) const
 
T & poke_data (int i)
 
void debug () const
 

Private Member Functions

void increment_write_pos (int i=1)
 
void increment_read_pos (int i=1)
 
void init ()
 
 circular_buffer (const circular_buffer< T > &b)
 
circular_buffer< T > & operator= (const circular_buffer< T > &)
 
void * buf_alloc (int size)
 
void buf_free (void *&buf)
 
void buf_write (void *buf, int n, const T &t)
 
T & buf_read (void *buf, int n) const
 
void buf_clear (void *buf, int n)
 

Private Attributes

int m_size
 
void * m_buf
 
int m_free
 
int m_used
 
int m_ri
 
int m_wi
 

Detailed Description

template<typename T>
class tlm::circular_buffer< T >

Definition at line 29 of file circular_buffer.hh.

Constructor & Destructor Documentation

◆ circular_buffer() [1/2]

template<typename T >
tlm::circular_buffer< T >::circular_buffer ( int size = 0)
explicit

Definition at line 112 of file circular_buffer.hh.

References tlm::circular_buffer< T >::init().

◆ ~circular_buffer()

template<typename T >
tlm::circular_buffer< T >::~circular_buffer ( )

Definition at line 129 of file circular_buffer.hh.

◆ circular_buffer() [2/2]

template<typename T >
tlm::circular_buffer< T >::circular_buffer ( const circular_buffer< T > & b)
private

Member Function Documentation

◆ buf_alloc()

template<typename T >
void * tlm::circular_buffer< T >::buf_alloc ( int size)
inlineprivate

Definition at line 213 of file circular_buffer.hh.

◆ buf_clear()

template<typename T >
void tlm::circular_buffer< T >::buf_clear ( void * buf,
int n )
inlineprivate

Definition at line 244 of file circular_buffer.hh.

◆ buf_free()

template<typename T >
void tlm::circular_buffer< T >::buf_free ( void *& buf)
inlineprivate

Definition at line 220 of file circular_buffer.hh.

◆ buf_read()

template<typename T >
T & tlm::circular_buffer< T >::buf_read ( void * buf,
int n ) const
inlineprivate

◆ buf_write()

template<typename T >
void tlm::circular_buffer< T >::buf_write ( void * buf,
int n,
const T & t )
inlineprivate

Definition at line 228 of file circular_buffer.hh.

◆ clear()

template<typename T >
void tlm::circular_buffer< T >::clear ( )

Definition at line 119 of file circular_buffer.hh.

◆ debug()

template<typename T >
void tlm::circular_buffer< T >::debug ( ) const

Definition at line 90 of file circular_buffer.hh.

◆ free()

template<typename T >
int tlm::circular_buffer< T >::free ( ) const
inline

Definition at line 46 of file circular_buffer.hh.

References tlm::circular_buffer< T >::m_free.

Referenced by tlm::circular_buffer< T >::is_full().

◆ increment_read_pos()

template<typename T >
void tlm::circular_buffer< T >::increment_read_pos ( int i = 1)
private

Definition at line 204 of file circular_buffer.hh.

◆ increment_write_pos()

template<typename T >
void tlm::circular_buffer< T >::increment_write_pos ( int i = 1)
private

Definition at line 195 of file circular_buffer.hh.

◆ init()

template<typename T >
void tlm::circular_buffer< T >::init ( )
private

Definition at line 161 of file circular_buffer.hh.

Referenced by tlm::circular_buffer< T >::circular_buffer().

◆ is_empty()

template<typename T >
bool tlm::circular_buffer< T >::is_empty ( ) const
inline

Definition at line 41 of file circular_buffer.hh.

References tlm::circular_buffer< T >::used().

◆ is_full()

template<typename T >
bool tlm::circular_buffer< T >::is_full ( ) const
inline

Definition at line 42 of file circular_buffer.hh.

References tlm::circular_buffer< T >::free().

◆ operator=()

template<typename T >
circular_buffer< T > & tlm::circular_buffer< T >::operator= ( const circular_buffer< T > & )
private

◆ peek_data()

template<typename T >
const T & tlm::circular_buffer< T >::peek_data ( int i) const
inline

◆ poke_data()

◆ read()

template<typename T >
T tlm::circular_buffer< T >::read ( )

Definition at line 175 of file circular_buffer.hh.

◆ read_data()

template<typename T >
const T & tlm::circular_buffer< T >::read_data ( ) const
inline

◆ resize()

template<typename T >
void tlm::circular_buffer< T >::resize ( int size)

Definition at line 137 of file circular_buffer.hh.

◆ size()

template<typename T >
int tlm::circular_buffer< T >::size ( ) const
inline

◆ used()

template<typename T >
int tlm::circular_buffer< T >::used ( ) const
inline

Definition at line 45 of file circular_buffer.hh.

References tlm::circular_buffer< T >::m_used.

Referenced by tlm::circular_buffer< T >::is_empty().

◆ write()

template<typename T >
void tlm::circular_buffer< T >::write ( const T & t)

Definition at line 187 of file circular_buffer.hh.

Member Data Documentation

◆ m_buf

template<typename T >
void* tlm::circular_buffer< T >::m_buf
private

◆ m_free

template<typename T >
int tlm::circular_buffer< T >::m_free
private

Definition at line 82 of file circular_buffer.hh.

Referenced by tlm::circular_buffer< T >::free().

◆ m_ri

template<typename T >
int tlm::circular_buffer< T >::m_ri
private

◆ m_size

template<typename T >
int tlm::circular_buffer< T >::m_size
private

Definition at line 80 of file circular_buffer.hh.

Referenced by tlm::circular_buffer< T >::size().

◆ m_used

template<typename T >
int tlm::circular_buffer< T >::m_used
private

Definition at line 83 of file circular_buffer.hh.

Referenced by tlm::circular_buffer< T >::used().

◆ m_wi

template<typename T >
int tlm::circular_buffer< T >::m_wi
private

Definition at line 85 of file circular_buffer.hh.

Referenced by tlm::circular_buffer< T >::poke_data().


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

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