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.
Diff: linearArray.h
- Revision:
- 5:0f65cdadb1a4
- Parent:
- 4:7743528fb9e5
- Child:
- 6:314f180362cb
diff -r 7743528fb9e5 -r 0f65cdadb1a4 linearArray.h
--- a/linearArray.h Thu Mar 02 13:10:56 2017 +0000
+++ b/linearArray.h Wed Mar 08 10:48:34 2017 +0000
@@ -3,27 +3,30 @@
#include "mbed.h"
-template <class type>
+template<class type>
class LinearArray {
- public:
- LinearArray(int size);
- ~LinearArray();
- int push(type item);
- type pop();
- type& peek();
- int size();
- bool empty();
- bool full();
- int count();
- private:
- type* array;
- int elem_count;
- int array_size;
- int rear;
- int front;
+ public:
+ LinearArray(int size, bool forced = false);
+ ~LinearArray();
+ int push(type item);
+ type pop();
+ type& pop();
+ type peek();
+ type& peek();
+ int size();
+ bool empty();
+ bool full();
+ int count();
+ private:
+ type* _array;
+ int _elem_count;
+ int _array_size;
+ int _rear;
+ int _front;
+ bool _forced;
-};
+};
-#include "linearArray.hpp"
+#include "LinearArray.hpp"
#endif /* LINEAR_ARRAY_H */