Marcus Lee / LinearArray

linearArray.h

Committer:
UHSLMarcus
Date:
2017-03-01
Revision:
3:8e9f85814809
Parent:
2:92576523c23e
Child:
4:7743528fb9e5

File content as of revision 3:8e9f85814809:

#ifndef LINEAR_ARRAY_H
#define LINEAR_ARRAY_H

#include "mbed.h"

template <class type>
class LinearArray {
    public:
        LinearArray(int size);
        ~LinearArray();
        int push(type item);
        type pop(int index = 0);
        type& peek(int index = 0);
        int size();
        int elements();
        bool hasSpace();
        bool empty();
    private:
        type* array;
        int elem_count;
        int array_size;

        int elem_decrease();
        int elem_increase();
}; 

#include "linearArray.hpp"

#endif /* LINEAR_ARRAY_H */