implement a circular buffer of type T
More...
#include <RingBuffer.h>
template<class T>
class CRingBuffer< T >
implement a circular buffer of type T
◆ CRingBuffer()
◆ ~CRingBuffer()
◆ get() [1/2]
return the value at the current read index
- Parameters
-
fOffset | read at offset from read index |
- Returns
- float the value from the read index
◆ get() [2/2]
template<class T >
void CRingBuffer< T >::get |
( |
T * |
ptBuff, |
|
|
int |
iLength |
|
) |
| const |
|
inline |
return the values starting at the current read index
- Parameters
-
ptBuff | to where the values will be written |
iLength | number of values |
- Returns
- void
◆ getLength()
returns the length of the internal buffer
- Returns
- int
◆ getNumValuesInBuffer()
returns the number of values currently buffered (note: 0 could also mean the buffer is full!)
- Returns
- int
◆ getPostInc() [1/2]
return the value at the current read index and increment the read pointer
- Returns
- float the value from the read index
◆ getPostInc() [2/2]
template<class T >
void CRingBuffer< T >::getPostInc |
( |
T * |
ptBuff, |
|
|
int |
iLength |
|
) |
| |
|
inline |
return the values starting at the current read index and increment the read pointer
- Parameters
-
ptBuff | pointer to where the values will be written |
iLength | number of values |
- Returns
- void
◆ getReadIdx()
return the current index for reading/get
- Returns
- int
◆ getWriteIdx()
return the current index for writing/put
- Returns
- int
◆ put() [1/2]
template<class T >
void CRingBuffer< T >::put |
( |
const T * |
ptNewBuff, |
|
|
int |
iLength |
|
) |
| |
|
inline |
add new values of type T to write index
- Parameters
-
ptNewBuff | new values |
iLength | number of values |
- Returns
- void
◆ put() [2/2]
add a new value of type T to write index
- Parameters
-
- Returns
- void
◆ putPostInc() [1/2]
template<class T >
void CRingBuffer< T >::putPostInc |
( |
const T * |
ptNewBuff, |
|
|
int |
iLength |
|
) |
| |
|
inline |
add new values of type T to write index and increment write index
- Parameters
-
ptNewBuff | new values |
iLength | number of values |
- Returns
- void
◆ putPostInc() [2/2]
add a new value of type T to write index and increment write index
- Parameters
-
- Returns
- void
◆ reset()
set buffer content and indices to 0
- Returns
- void
◆ setReadIdx()
move the read index to a new position
- Parameters
-
- Returns
- void
◆ setWriteIdx()
move the write index to a new position
- Parameters
-
- Returns
- void
The documentation for this class was generated from the following file: