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@6:314f180362cb, 2017-03-08 (annotated)
- Committer:
- UHSLMarcus
- Date:
- Wed Mar 08 10:57:36 2017 +0000
- Revision:
- 6:314f180362cb
- Parent:
- 5:0f65cdadb1a4
- Child:
- 11:1e27a6f0b0cf
fixed member rename
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| UHSLMarcus | 0:23c500341c13 | 1 | #ifndef LINEAR_ARRAY_H |
| UHSLMarcus | 0:23c500341c13 | 2 | #define LINEAR_ARRAY_H |
| UHSLMarcus | 0:23c500341c13 | 3 | |
| UHSLMarcus | 0:23c500341c13 | 4 | #include "mbed.h" |
| UHSLMarcus | 0:23c500341c13 | 5 | |
| UHSLMarcus | 5:0f65cdadb1a4 | 6 | template<class type> |
| UHSLMarcus | 0:23c500341c13 | 7 | class LinearArray { |
| UHSLMarcus | 5:0f65cdadb1a4 | 8 | public: |
| UHSLMarcus | 5:0f65cdadb1a4 | 9 | LinearArray(int size, bool forced = false); |
| UHSLMarcus | 5:0f65cdadb1a4 | 10 | ~LinearArray(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 11 | int push(type item); |
| UHSLMarcus | 5:0f65cdadb1a4 | 12 | type& pop(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 13 | type& peek(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 14 | int size(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 15 | bool empty(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 16 | bool full(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 17 | int count(); |
| UHSLMarcus | 5:0f65cdadb1a4 | 18 | private: |
| UHSLMarcus | 5:0f65cdadb1a4 | 19 | type* _array; |
| UHSLMarcus | 5:0f65cdadb1a4 | 20 | int _elem_count; |
| UHSLMarcus | 5:0f65cdadb1a4 | 21 | int _array_size; |
| UHSLMarcus | 5:0f65cdadb1a4 | 22 | int _rear; |
| UHSLMarcus | 5:0f65cdadb1a4 | 23 | int _front; |
| UHSLMarcus | 5:0f65cdadb1a4 | 24 | bool _forced; |
| UHSLMarcus | 3:8e9f85814809 | 25 | |
| UHSLMarcus | 5:0f65cdadb1a4 | 26 | }; |
| UHSLMarcus | 0:23c500341c13 | 27 | |
| UHSLMarcus | 5:0f65cdadb1a4 | 28 | #include "LinearArray.hpp" |
| UHSLMarcus | 1:49758f1e1317 | 29 | |
| UHSLMarcus | 3:8e9f85814809 | 30 | #endif /* LINEAR_ARRAY_H */ |