Esta versión v6 pasa a ser el nuevo master. Funciona correctamente

Dependencies:   ADXL345 Display1602 MSCFileSystem SDFileSystem mbed FATFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RingBuffer.h Source File

RingBuffer.h

00001 #ifndef BUFFER_H
00002 #define BUFFER_H
00003  
00004 #include <vector>
00005 #include "mbed.h"
00006  
00007 class Buffer
00008 {
00009 private:
00010     std::vector<float> data;
00011     std::vector<float>::iterator itBeg;
00012     std::vector<float>::iterator itEnd;
00013     std::vector<float>::iterator head;
00014     std::vector<float>::iterator tail;
00015     int windex;
00016     int rindex;
00017     bool full;
00018     bool empty;
00019     int bufSize;
00020 public:
00021     Buffer(int);
00022     void put(float);
00023     const float get();
00024     const int getSize();
00025     const bool isFull();
00026     const bool isEmpty();
00027     const int getWritingIndex();
00028     const int getReadingIndex();
00029     //void printBuffer();
00030     //const int getIndex();
00031 };
00032  
00033 #endif // BUFFER_H
00034