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

# TRingBufferWithSum< C, n > Class Template Reference

`#include <TRingBufferWithSum.h>`

Collaboration diagram for TRingBufferWithSum< C, n >:

[legend]
List of all members.

## Public Member Functions
| TRingBufferWithSum ()
| Constructor.
void | init ()
| initializes the RingBufferWithSum
void | add (C value)
| adds an entry to the buffer
C | getEntry (int i)
| returns an entry
C | getSum ()
C | getMinimum ()
C | operator[] (int i)
| returns an entry
C | operator[] (int i) const
| returns a constant entry.
int | getNumberOfEntries () const
## Private Attributes
int | current
int | numberOfEntries
C | buffer [n]
C | sum

### template<class C, int n>
class TRingBufferWithSum< C, n >

## Constructor & Destructor Documentation

template<class C, int n>
TRingBufferWithSum< C, n >::TRingBufferWithSum | ( |  | ) | `[inline]`

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

## Member Function Documentation

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

| initializes the RingBufferWithSum Definition at line 26 of file TRingBufferWithSum.h. Referenced by TRingBufferWithSum< long, 25 >::TRingBufferWithSum().

template<class C, int n>
void TRingBufferWithSum< C, n >::add | ( | C | value | ) | `[inline]`

  | adds an entry to the buffer Parameters:
  value | value to be added
Definition at line 32 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, 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 47 of file TRingBufferWithSum.h. Referenced by TRingBufferWithSum< long, 25 >::add(), and TRingBufferWithSum< long, 25 >::operator[]().

template<class C, int n>
C TRingBufferWithSum< C, n >::getSum | ( |  | ) | `[inline]`

| Definition at line 55 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, n >::getMinimum | ( |  | ) | `[inline]`

| Definition at line 60 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, 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 75 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, 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 85 of file TRingBufferWithSum.h.

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

| Definition at line 90 of file TRingBufferWithSum.h.

## Member Data Documentation

template<class C, int n>
int TRingBufferWithSum< C, n >::current`[private]`

| Definition at line 96 of file TRingBufferWithSum.h.

template<class C, int n>
int TRingBufferWithSum< C, n >::numberOfEntries`[private]`

| Definition at line 97 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, n >::buffer[n]`[private]`

| Definition at line 98 of file TRingBufferWithSum.h.

template<class C, int n>
C TRingBufferWithSum< C, n >::sum`[private]`

| Definition at line 100 of file TRingBufferWithSum.h.

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

- Tools/TRingBufferWithSum.h