An array 3 sized circle buffer
CircleBuffer.h
- Committer:
- oprospero
- Date:
- 2013-10-17
- Revision:
- 1:8c7e5801d763
- Parent:
- 0:410ebbfd5e14
File content as of revision 1:8c7e5801d763:
// Circle Buffer // A circle buffer of fixed size, set by BUFFERSIZE that will remove // the oldest data when new ones are inserted. #ifndef CIRCLEBUFFER_H #define CIRCLEBUFFER_H #define BUFFERSIZE 2 class CircleBuffer { public: CircleBuffer(void); void queue(float value[3]); void read(float rawfilter[3]); private: float buffer[BUFFERSIZE][3]; float buffersum[3]; int index; // Keep track of front queue; }; #endif