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@1:49758f1e1317, 2016-10-04 (annotated)
- Committer:
- UHSLMarcus
- Date:
- Tue Oct 04 13:38:07 2016 +0000
- Revision:
- 1:49758f1e1317
- Parent:
- 0:23c500341c13
- Child:
- 2:92576523c23e
fixed a few things
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 | 0:23c500341c13 | 6 | template <class type> |
| UHSLMarcus | 0:23c500341c13 | 7 | class LinearArray { |
| UHSLMarcus | 0:23c500341c13 | 8 | public: |
| UHSLMarcus | 0:23c500341c13 | 9 | LinearArray(int size); |
| UHSLMarcus | 0:23c500341c13 | 10 | ~LinearArray(); |
| UHSLMarcus | 0:23c500341c13 | 11 | int add(type item); |
| UHSLMarcus | 0:23c500341c13 | 12 | void remove(int index); |
| UHSLMarcus | 0:23c500341c13 | 13 | int size(); |
| UHSLMarcus | 1:49758f1e1317 | 14 | int elements(); |
| UHSLMarcus | 0:23c500341c13 | 15 | bool hasSpace(); |
| UHSLMarcus | 0:23c500341c13 | 16 | type& operator[](int index); |
| UHSLMarcus | 0:23c500341c13 | 17 | private: |
| UHSLMarcus | 0:23c500341c13 | 18 | type* array; |
| UHSLMarcus | 0:23c500341c13 | 19 | int elem_count; |
| UHSLMarcus | 0:23c500341c13 | 20 | }; |
| UHSLMarcus | 0:23c500341c13 | 21 | |
| UHSLMarcus | 1:49758f1e1317 | 22 | #include "linearArray.hpp" |
| UHSLMarcus | 1:49758f1e1317 | 23 | |
| UHSLMarcus | 0:23c500341c13 | 24 | #endif /* LINEAR_ARRAY_H */ |