15 #ifndef ECL_CONTAINERS_FIFO_HPP_
16 #define ECL_CONTAINERS_FIFO_HPP_
89 FiFo(
const unsigned int length = 0 ) :
93 if ( size_fifo > 0 ) {
94 data.resize( size_fifo );
103 FiFo(
const unsigned int length,
const T &value ) :
107 if ( size_fifo > 0 ) {
122 T & operator[] (
int idx) {
123 return data[ ((running_index+idx)%size_fifo) ];
132 const T & operator[] (
int idx)
const {
133 return data[ ((running_index+idx)%size_fifo) ];
143 void push_back(
const T & datum ) {
144 data[ running_index++ ] = datum;
145 running_index %= size_fifo;
152 void fill(
const T & value ) {
153 for(
unsigned int i=0; i<size_fifo; i++ ) data[i] = value;
160 unsigned int get_idx() {
return running_index;}
167 void resize(
unsigned int length ) {
170 data.resize( size_fifo );
175 unsigned int size_fifo;
176 unsigned int running_index;