Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

clReBufferT< TReBuffer_t > Class Template Reference

Template class for splitting data into buffers of different sizes. More...

#include <ReBufferT.hh>

Collaboration diagram for clReBufferT< TReBuffer_t >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 clReBufferT ()
 clReBufferT (const clReBufferT &CopySrc)
 clReBufferT (long lNewSize)
 clReBufferT (const TReBuffer_t *fpSrcData, long lSrcCount)
 ~clReBufferT ()
void Put (const TReBuffer_t *fpSrcData, long lSrcCount)
 Put data into FIFO.

void Put (clReBufferT &Src)
 Put data into fifo from another FIFO.

bool Get (TReBuffer_t *fpDestData, long lDestCount)
 Get data from FIFO.

long GetCount () const
 Get number of samples in FIFO.

long Size () const
void SetSize (long lNewCount)
 Set number of samples in FIFO.

void Resize (long lNewCount)
 Set number of samples in FIFO.

void Clear ()
 Clear FIFO contents and reset buffer size.

clReBufferToperator= (const clReBufferT &Src)
TReBuffer_t & operator[] (long lIndex)

Protected Member Functions

TReBuffer_t * GetPtr ()
void CopyGet (TReBuffer_t *fpDestData, long lDestCount) const

Private Member Functions

void CheckSize (long lDataCount)

Private Attributes

long lSize
long lPutIndex
long lGetIndex
long lCount
clDSPAlloc Buffer

Detailed Description

template<class TReBuffer_t>
class clReBufferT< TReBuffer_t >

Template class for splitting data into buffers of different sizes.

It's implemented using dynamically growing circular FIFO buffer. The ring buffer is linearized when linear access is requested.

Definition at line 54 of file ReBufferT.hh.


Constructor & Destructor Documentation

template<class TReBuffer_t>
clReBufferT< TReBuffer_t >::clReBufferT  )  [inline]
 

Definition at line 131 of file ReBufferT.hh.

template<class TReBuffer_t>
clReBufferT< TReBuffer_t >::clReBufferT const clReBufferT< TReBuffer_t > &  CopySrc  )  [inline]
 

Definition at line 138 of file ReBufferT.hh.

template<class TReBuffer_t>
clReBufferT< TReBuffer_t >::clReBufferT long  lNewSize  )  [inline]
 

Definition at line 146 of file ReBufferT.hh.

template<class TReBuffer_t>
clReBufferT< TReBuffer_t >::clReBufferT const TReBuffer_t *  fpSrcData,
long  lSrcCount
[inline]
 

Definition at line 154 of file ReBufferT.hh.

template<class TReBuffer_t>
clReBufferT< TReBuffer_t >::~clReBufferT  )  [inline]
 

Definition at line 162 of file ReBufferT.hh.


Member Function Documentation

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::CheckSize long  lDataCount  )  [inline, private]
 

Definition at line 62 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::Put(), clReBufferT< TDSPVector_t >::Resize(), and clReBufferT< TDSPVector_t >::SetSize().

template<class TReBuffer_t>
TReBuffer_t* clReBufferT< TReBuffer_t >::GetPtr  )  [inline, protected]
 

Reimplemented in clDSPVector< TDSPVector_t >.

Definition at line 100 of file ReBufferT.hh.

Referenced by clDSPVector< TDSPVector_t >::GetPtr(), and clReBufferT< TDSPVector_t >::Put().

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::CopyGet TReBuffer_t *  fpDestData,
long  lDestCount
const [inline, protected]
 

Definition at line 111 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::operator=().

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::Put const TReBuffer_t *  fpSrcData,
long  lSrcCount
[inline]
 

Put data into FIFO.

Parameters:
fpSrcData Source buffer
lSrcCount Number of samples in source.

Definition at line 170 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::clReBufferT(), clReBufferT< TDSPVector_t >::GetPtr(), and clReBufferT< TDSPVector_t >::Put().

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::Put clReBufferT< TReBuffer_t > &  Src  )  [inline]
 

Put data into fifo from another FIFO.

Parameters:
Src Source FIFO

Definition at line 198 of file ReBufferT.hh.

template<class TReBuffer_t>
bool clReBufferT< TReBuffer_t >::Get TReBuffer_t *  fpDestData,
long  lDestCount
[inline]
 

Get data from FIFO.

Returns false if there's not enough samples in FIFO to fill requested buffer.

Parameters:
fpDestData Destination buffer
lDestCount Number of samples to fetch
Returns:
Data available

Definition at line 211 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::GetPtr().

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::GetCount  )  const [inline]
 

Get number of samples in FIFO.

Returns:
Number of samples

Definition at line 240 of file ReBufferT.hh.

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::Size  )  const [inline]
 

Definition at line 244 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::operator=(), clReBufferT< TDSPVector_t >::Put(), and clDSPVector< TDSPVector_t >::Size().

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::SetSize long  lNewCount  )  [inline]
 

Set number of samples in FIFO.

Note:
This is destructive resize.

Reimplemented in clDSPVector< TDSPVector_t >.

Definition at line 253 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::clReBufferT(), clReBufferT< TDSPVector_t >::operator=(), and clDSPVector< TDSPVector_t >::SetSize().

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::Resize long  lNewCount  )  [inline]
 

Set number of samples in FIFO.

Note:
This is non-destructive resize.

Definition at line 265 of file ReBufferT.hh.

template<class TReBuffer_t>
void clReBufferT< TReBuffer_t >::Clear  )  [inline]
 

Clear FIFO contents and reset buffer size.

Definition at line 275 of file ReBufferT.hh.

Referenced by clReBufferT< TDSPVector_t >::GetPtr(), and clReBufferT< TDSPVector_t >::SetSize().

template<class TReBuffer_t>
clReBufferT& clReBufferT< TReBuffer_t >::operator= const clReBufferT< TReBuffer_t > &  Src  )  [inline]
 

Definition at line 283 of file ReBufferT.hh.

template<class TReBuffer_t>
TReBuffer_t& clReBufferT< TReBuffer_t >::operator[] long  lIndex  )  [inline]
 

Definition at line 291 of file ReBufferT.hh.


Member Data Documentation

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::lSize [private]
 

Definition at line 56 of file ReBufferT.hh.

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::lPutIndex [private]
 

Definition at line 57 of file ReBufferT.hh.

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::lGetIndex [private]
 

Definition at line 58 of file ReBufferT.hh.

template<class TReBuffer_t>
long clReBufferT< TReBuffer_t >::lCount [private]
 

Definition at line 59 of file ReBufferT.hh.

template<class TReBuffer_t>
clDSPAlloc clReBufferT< TReBuffer_t >::Buffer [private]
 

Definition at line 60 of file ReBufferT.hh.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 14:32:32 2004 for libDSP by doxygen 1.3.6