tlm::circular_buffer< T > Class Template Reference

#include <circular_buffer.h>

Collaboration diagram for tlm::circular_buffer< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 circular_buffer (int size)
circular_buffer< T > & operator= (const circular_buffer< T > &)
 ~circular_buffer ()
void resize (int size)
const T & read ()
void write (const T &)
bool is_empty () const
bool is_full () const
int size () const
int used () const
int free () const
T & write_data ()
const T & read_data () const
const T & peek_data (int i) const
T & poke_data (int i)
void increment_write_pos (int i=1)
void increment_read_pos (int i=1)
void init ()
void debug () const

Private Member Functions

 circular_buffer (const circular_buffer< T > &b)
void copy (const circular_buffer< T > &b)

Private Attributes

int m_size
T * 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 30 of file circular_buffer.h.


Constructor & Destructor Documentation

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

Definition at line 112 of file circular_buffer.h.

References tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::m_buf, and tlm::circular_buffer< T >::m_size.

Here is the call graph for this function:

template<typename T>
tlm::circular_buffer< T >::~circular_buffer (  )  [inline]

Definition at line 37 of file circular_buffer.h.

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

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


Member Function Documentation

template<typename T>
circular_buffer< T > & tlm::circular_buffer< T >::operator= ( const circular_buffer< T > &  b  )  [inline]

Definition at line 123 of file circular_buffer.h.

References tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::peek_data(), tlm::circular_buffer< T >::size(), tlm::circular_buffer< T >::used(), and tlm::circular_buffer< T >::write().

Here is the call graph for this function:

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

Definition at line 139 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, tlm::circular_buffer< T >::m_free, tlm::circular_buffer< T >::m_ri, tlm::circular_buffer< T >::m_size, tlm::circular_buffer< T >::m_used, tlm::circular_buffer< T >::m_wi, tlm::circular_buffer< T >::peek_data(), and tlm::circular_buffer< T >::used().

Here is the call graph for this function:

template<typename T>
const T & tlm::circular_buffer< T >::read (  )  [inline]

Definition at line 191 of file circular_buffer.h.

References tlm::circular_buffer< T >::increment_read_pos(), and tlm::circular_buffer< T >::read_data().

Here is the call graph for this function:

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

Definition at line 204 of file circular_buffer.h.

References tlm::circular_buffer< T >::increment_write_pos(), and tlm::circular_buffer< T >::write_data().

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

Here is the call graph for this function:

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

Definition at line 44 of file circular_buffer.h.

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

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

Here is the call graph for this function:

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

Definition at line 45 of file circular_buffer.h.

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

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

Here is the call graph for this function:

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

Definition at line 47 of file circular_buffer.h.

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

Referenced by tlm::circular_buffer< T >::debug(), tlm::circular_buffer< T >::operator=(), tlm::circular_buffer< T >::peek_data(), and tlm::circular_buffer< T >::poke_data().

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

Definition at line 48 of file circular_buffer.h.

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

Referenced by tlm::circular_buffer< T >::debug(), tlm::circular_buffer< T >::is_empty(), tlm::circular_buffer< T >::operator=(), and tlm::circular_buffer< T >::resize().

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

Definition at line 49 of file circular_buffer.h.

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

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

template<typename T>
T& tlm::circular_buffer< T >::write_data (  )  [inline]

Definition at line 51 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, and tlm::circular_buffer< T >::m_wi.

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

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

Definition at line 52 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, and tlm::circular_buffer< T >::m_ri.

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

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

Definition at line 54 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, tlm::circular_buffer< T >::m_ri, and tlm::circular_buffer< T >::size().

Referenced by tlm::circular_buffer< T >::debug(), tlm::circular_buffer< T >::operator=(), and tlm::circular_buffer< T >::resize().

Here is the call graph for this function:

template<typename T>
T& tlm::circular_buffer< T >::poke_data ( int  i  )  [inline]

Definition at line 55 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, tlm::circular_buffer< T >::m_ri, and tlm::circular_buffer< T >::size().

Here is the call graph for this function:

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

Definition at line 215 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_free, tlm::circular_buffer< T >::m_size, tlm::circular_buffer< T >::m_used, and tlm::circular_buffer< T >::m_wi.

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

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

Definition at line 225 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_free, tlm::circular_buffer< T >::m_ri, tlm::circular_buffer< T >::m_size, and tlm::circular_buffer< T >::m_used.

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

template<typename T>
void tlm::circular_buffer< T >::init (  )  [inline]

Definition at line 166 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_free, tlm::circular_buffer< T >::m_ri, tlm::circular_buffer< T >::m_size, tlm::circular_buffer< T >::m_used, and tlm::circular_buffer< T >::m_wi.

Referenced by tlm::circular_buffer< T >::circular_buffer(), and tlm::circular_buffer< T >::operator=().

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

Definition at line 80 of file circular_buffer.h.

References tlm::circular_buffer< T >::free(), tlm::circular_buffer< T >::is_empty(), tlm::circular_buffer< T >::is_full(), tlm::circular_buffer< T >::m_ri, tlm::circular_buffer< T >::m_wi, tlm::circular_buffer< T >::peek_data(), tlm::circular_buffer< T >::size(), and tlm::circular_buffer< T >::used().

Here is the call graph for this function:

template<typename T>
void tlm::circular_buffer< T >::copy ( const circular_buffer< T > &  b  )  [inline, private]

Definition at line 177 of file circular_buffer.h.

References tlm::circular_buffer< T >::m_buf, tlm::circular_buffer< T >::m_free, tlm::circular_buffer< T >::m_ri, tlm::circular_buffer< T >::m_size, tlm::circular_buffer< T >::m_used, and tlm::circular_buffer< T >::m_wi.


Member Data Documentation

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

Definition at line 69 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::circular_buffer(), tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::increment_read_pos(), tlm::circular_buffer< T >::increment_write_pos(), tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::resize(), and tlm::circular_buffer< T >::size().

template<typename T>
T* tlm::circular_buffer< T >::m_buf [private]

Definition at line 70 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::circular_buffer(), tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::peek_data(), tlm::circular_buffer< T >::poke_data(), tlm::circular_buffer< T >::read_data(), tlm::circular_buffer< T >::resize(), tlm::circular_buffer< T >::write_data(), and tlm::circular_buffer< T >::~circular_buffer().

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

Definition at line 71 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::free(), tlm::circular_buffer< T >::increment_read_pos(), tlm::circular_buffer< T >::increment_write_pos(), tlm::circular_buffer< T >::init(), and tlm::circular_buffer< T >::resize().

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

Definition at line 72 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::increment_read_pos(), tlm::circular_buffer< T >::increment_write_pos(), tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::resize(), and tlm::circular_buffer< T >::used().

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

Definition at line 73 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::debug(), tlm::circular_buffer< T >::increment_read_pos(), tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::peek_data(), tlm::circular_buffer< T >::poke_data(), tlm::circular_buffer< T >::read_data(), and tlm::circular_buffer< T >::resize().

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

Definition at line 74 of file circular_buffer.h.

Referenced by tlm::circular_buffer< T >::copy(), tlm::circular_buffer< T >::debug(), tlm::circular_buffer< T >::increment_write_pos(), tlm::circular_buffer< T >::init(), tlm::circular_buffer< T >::resize(), and tlm::circular_buffer< T >::write_data().


The documentation for this class was generated from the following file:
Generated on Thu Jun 5 17:44:04 2008 for TLM 2 by  doxygen 1.5.3