Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
linearArray.h
- Committer:
- UHSLMarcus
- Date:
- 2017-03-17
- Revision:
- 13:db9ebea23baf
- Parent:
- 12:e4f557b33732
File content as of revision 13:db9ebea23baf:
#ifndef LINEAR_ARRAY_H
#define LINEAR_ARRAY_H
#include "mbed.h"
#include "temp_const.h"
template<class type>
class LinearArray {
public:
LinearArray(int size, char * name, bool forced = false);
~LinearArray();
int push(type item);
type& pop();
bool try_pop(type& item);
type& peek();
type& peek(int idx);
int size();
bool empty();
bool full();
int count();
private:
type* _array;
int _elem_count;
int _array_size;
int _front;
int _rear;
bool _forced;
};
#include "linearArray.hpp"
#endif /* LINEAR_ARRAY_H */