Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# RingBuffer< V, n > Class Template Reference

template class for cyclic buffering of the last n values of Type V More...

`#include <RingBuffer.h>`

Collaboration diagram for RingBuffer< V, n >:

[legend]
List of all members.

## Public Member Functions
| RingBuffer ()
| Constructor.
void | init ()
| initializes the Ringbuffer
void | add (const V &v)
| adds an entry to the buffer
V & | getEntry (int i)
| returns an entry
void | updateEntry (const V &v, int i)
| returns an entry
V & | operator[] (int i)
| returns an entry
const V & | operator[] (int i) const
| returns a constant entry.
int | getNumberOfEntries () const
## Private Attributes
int | current
int | numberOfEntries
V | buffer [n]

## Detailed Description

### template<class V, int n>
class RingBuffer< V, n >

template class for cyclic buffering of the last n values of Type V

Definition at line 17 of file RingBuffer.h.

## Constructor & Destructor Documentation

template<class V, int n>
RingBuffer< V, n >::RingBuffer | ( |  | ) | `[inline]`

| Constructor. Definition at line 21 of file RingBuffer.h.

## Member Function Documentation

template<class V, int n>
void RingBuffer< V, n >::init | ( |  | ) | `[inline]`

| initializes the Ringbuffer Definition at line 26 of file RingBuffer.h. Referenced by RingBuffer< Vector3< double >, maxNumberOf3DPoints >::RingBuffer(), VLCImageProcessor::scan(), SlamImageProcessor::scan(), and GT2005ImageProcessor::scan().

template<class V, int n>
void RingBuffer< V, n >::add | ( | const V & | v | ) | `[inline]`

  | adds an entry to the buffer Parameters:
  v | value to be added
Definition at line 32 of file RingBuffer.h. Referenced by UDPHandlerEndpoint::onReceive(), VLCImageProcessor::scan(), SlamImageProcessor::scan(), and GT2005ImageProcessor::scan().

template<class V, int n>
V& RingBuffer< V, n >::getEntry | ( | int | i | ) | `[inline]`

  | returns an entry Parameters:
  i | index of entry counting from last added (last=0,...)
Returns: a reference to the buffer entry Definition at line 45 of file RingBuffer.h. Referenced by RingBuffer< Vector3< double >, maxNumberOf3DPoints >::operator[]().

template<class V, int n>
void RingBuffer< V, n >::updateEntry | ( | const V & | v,
|  | int | i
| ) | `[inline]`

  | returns an entry Parameters:
  v | the value the entry i shall be updated with
  i | index of entry counting from last added (last=0,...)
Definition at line 58 of file RingBuffer.h.

template<class V, int n>
V& RingBuffer< V, n >::operator[] | ( | int | i | ) | `[inline]`

  | returns an entry Parameters:
  i | index of entry counting from last added (last=0,...)
Returns: a reference to the buffer entry Definition at line 71 of file RingBuffer.h.

template<class V, int n>
const V& RingBuffer< V, n >::operator[] | ( | int | i | ) | const`[inline]`

  | returns a constant entry. Parameters:
  i | index of entry counting from last added (last=0,...)
Returns: a reference to the buffer entry Definition at line 81 of file RingBuffer.h.

template<class V, int n>
int RingBuffer< V, n >::getNumberOfEntries | ( |  | ) | const`[inline]`

| Definition at line 86 of file RingBuffer.h. Referenced by UDPHandlerEndpoint::onReceive(), VLCImageProcessor::scan(), SlamImageProcessor::scan(), and GT2005ImageProcessor::scan().

## Member Data Documentation

template<class V, int n>
int RingBuffer< V, n >::current`[private]`

| Definition at line 92 of file RingBuffer.h.

template<class V, int n>
int RingBuffer< V, n >::numberOfEntries`[private]`

| Definition at line 93 of file RingBuffer.h.

template<class V, int n>
V RingBuffer< V, n >::buffer[n]`[private]`

| Definition at line 94 of file RingBuffer.h.

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

- Tools/RingBuffer.h