A class to adress a circulat bufer of a fixed size. More...
#include <mia/core/index.hh>
Public Member Functions | |
CCircularIndex (unsigned int size, unsigned int start) | |
unsigned int | fill () const |
void | insert_one () |
void | new_start (unsigned int start) |
unsigned int | next () const |
unsigned int | value (unsigned int i) const |
A class to adress a circulat bufer of a fixed size.
This class provides the structure for the translation of a linear index to a circular buffer. An example for its use can be found in mia/3d/translate/spline.cc: on_grid (BLAS_VERSION)
CCircularIndex::CCircularIndex | ( | unsigned int | size, |
unsigned int | start | ||
) |
Construct the buffer
size | size of the buffer |
start | start index |
unsigned int CCircularIndex::fill | ( | ) | const |
void CCircularIndex::insert_one | ( | ) |
Insert one index
void CCircularIndex::new_start | ( | unsigned int | start | ) |
reset the start index
unsigned int CCircularIndex::next | ( | ) | const |
get the next index
unsigned int CCircularIndex::value | ( | unsigned int | i | ) | const |
Translate the linear index i to the index in the circular buffer
i |