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

Dependencies:   ADXL345 Display1602 MSCFileSystem SDFileSystem mbed FATFileSystem

RingBuffer.h

Committer:
JuanManuelAmador
Date:
2014-06-06
Revision:
2:cc4a43d806e2
Parent:
0:a5367bd4e404

File content as of revision 2:cc4a43d806e2:

#ifndef BUFFER_H
#define BUFFER_H
 
#include <vector>
#include "mbed.h"
 
class Buffer
{
private:
    std::vector<float> data;
    std::vector<float>::iterator itBeg;
    std::vector<float>::iterator itEnd;
    std::vector<float>::iterator head;
    std::vector<float>::iterator tail;
    int windex;
    int rindex;
    bool full;
    bool empty;
    int bufSize;
public:
    Buffer(int);
    void put(float);
    const float get();
    const int getSize();
    const bool isFull();
    const bool isEmpty();
    const int getWritingIndex();
    const int getReadingIndex();
    //void printBuffer();
    //const int getIndex();
};
 
#endif // BUFFER_H