
3rd Repo, trying to figure this out.
Fork of SOFT253_Template_Weather_OS_54 by
CircularArray/CircularArray.h@65:3723d2729b68, 2017-04-09 (annotated)
- Committer:
- Netaphous
- Date:
- Sun Apr 09 23:41:45 2017 +0000
- Branch:
- feature/listOptimisation
- Revision:
- 65:3723d2729b68
- Parent:
- 64:8ada3e0b2048
- Child:
- 80:959151952153
Implemented CircularArray in the place of the linked list in the main code;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Netaphous | 64:8ada3e0b2048 | 1 | #include "Measure.h" |
Netaphous | 64:8ada3e0b2048 | 2 | class CircularArray |
Netaphous | 64:8ada3e0b2048 | 3 | { |
Netaphous | 64:8ada3e0b2048 | 4 | public: |
Netaphous | 64:8ada3e0b2048 | 5 | |
Netaphous | 64:8ada3e0b2048 | 6 | // constructor |
Netaphous | 64:8ada3e0b2048 | 7 | CircularArray(int limit); |
Netaphous | 64:8ada3e0b2048 | 8 | |
Netaphous | 64:8ada3e0b2048 | 9 | // public methods: |
Netaphous | 64:8ada3e0b2048 | 10 | void pushValue(Measure _measure); |
Netaphous | 65:3723d2729b68 | 11 | void readX(int x); |
Netaphous | 65:3723d2729b68 | 12 | void readAll(); |
Netaphous | 64:8ada3e0b2048 | 13 | void deleteX(int x); |
Netaphous | 64:8ada3e0b2048 | 14 | void deleteAll(); |
Netaphous | 64:8ada3e0b2048 | 15 | int getSize(); |
Netaphous | 64:8ada3e0b2048 | 16 | |
Netaphous | 64:8ada3e0b2048 | 17 | private: |
Netaphous | 64:8ada3e0b2048 | 18 | int firstValue, currentSize, maxSize; |
Netaphous | 64:8ada3e0b2048 | 19 | int nextSpace(); |
Netaphous | 64:8ada3e0b2048 | 20 | Measure *array; |
Netaphous | 64:8ada3e0b2048 | 21 | }; |