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 42 of file ReBufferT.hh.


Constructor & Destructor Documentation

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

Definition at line 119 of file ReBufferT.hh.

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

Definition at line 126 of file ReBufferT.hh.

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

Definition at line 134 of file ReBufferT.hh.

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

Definition at line 142 of file ReBufferT.hh.

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

Definition at line 150 of file ReBufferT.hh.


Member Function Documentation

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

Definition at line 50 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]
 

Definition at line 88 of file ReBufferT.hh.

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

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

Definition at line 99 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 158 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 186 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 199 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 228 of file ReBufferT.hh.

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

Definition at line 232 of file ReBufferT.hh.

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

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

Set number of samples in FIFO.

Note:
This is destructive resize.

Definition at line 241 of file ReBufferT.hh.

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

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 253 of file ReBufferT.hh.

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

Clear FIFO contents and reset buffer size.

Definition at line 263 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 271 of file ReBufferT.hh.

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

Definition at line 279 of file ReBufferT.hh.


Member Data Documentation

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

Definition at line 44 of file ReBufferT.hh.

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

Definition at line 45 of file ReBufferT.hh.

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

Definition at line 46 of file ReBufferT.hh.

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

Definition at line 47 of file ReBufferT.hh.

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

Definition at line 48 of file ReBufferT.hh.


The documentation for this class was generated from the following file:
Generated on Tue Mar 2 19:47:12 2004 for libDSP by doxygen 1.3.6