15 #ifndef ECL_CONTAINERS_FIFO_HPP_ 16 #define ECL_CONTAINERS_FIFO_HPP_ 23 #include <ecl/config/macros.hpp> 24 #include <ecl/errors/compile_time_assert.hpp> 25 #include <ecl/exceptions/standard_exception.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;}
170 data.resize( size_fifo );
175 unsigned int size_fifo;
176 unsigned int running_index;
ecl_geometry_PUBLIC void resize(Trajectory2D &trajectory, const int &size)
#define LOC
Stringify the line of code you are at.
#define ecl_assert_throw(expression, exception)
Debug mode throw with a logical condition check.
#define ecl_assert_throw_decl(exception)
Assure throw exception declaration.
static ConstantArray< Type, Size > Constant(const Type &value)
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)