ECE 4180 - Final Project Team / Mbed 2 deprecated WalkieTalkie

Dependencies:   mbed 4DGL-uLCD-SE mbed-rtos nRF24L01P

CircularBuf.h

Committer:
Nurchu
Date:
2018-04-20
Revision:
14:4637a9f02919
Child:
16:d0d3bb2fc3ce

File content as of revision 14:4637a9f02919:

template <T>
class CircularBuff {
public:
    CircularBuff(unsigned int size);
    ~CircularBuff();
    
    // Pushes data onto the buffer
    // Arguement:
    //          data, The array of data to push
    //          size, The amount of data in the array
    void push(T* data, unsigned int size);
    
    
    // Pops data from the buffer
    // Arguement:
    //          data, The array of data popped
    //          size, The amount of data to pop
    // Return:
    //          Amount of data actually popped
    unsigned int pop(T* data, unsigned int size);
    
    // Amount of data in the buffer
    unsigned int size();
    
    // Clears the buffer completely
    void clear();
    
private:
    T* _data;
    unsigned int _size;
    unsigned int _start;
    unsigned int _end;
};