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.
Fork of Coursework by
Queue.h@42:4e0a96b52e65, 2017-05-03 (annotated)
- Committer:
- pburtenshaw
- Date:
- Wed May 03 13:30:38 2017 +0000
- Revision:
- 42:4e0a96b52e65
- Child:
- 43:4ddc392dd0cc
queue started
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pburtenshaw | 42:4e0a96b52e65 | 1 | #ifndef Queue_H |
| pburtenshaw | 42:4e0a96b52e65 | 2 | #define Queue_H |
| pburtenshaw | 42:4e0a96b52e65 | 3 | #include "Reading.h" |
| pburtenshaw | 42:4e0a96b52e65 | 4 | |
| pburtenshaw | 42:4e0a96b52e65 | 5 | class Queue{ |
| pburtenshaw | 42:4e0a96b52e65 | 6 | //variables |
| pburtenshaw | 42:4e0a96b52e65 | 7 | const int maxSize = 120; |
| pburtenshaw | 42:4e0a96b52e65 | 8 | int front; |
| pburtenshaw | 42:4e0a96b52e65 | 9 | int back; |
| pburtenshaw | 42:4e0a96b52e65 | 10 | int count; |
| pburtenshaw | 42:4e0a96b52e65 | 11 | Reading storage[maxSize]; |
| pburtenshaw | 42:4e0a96b52e65 | 12 | |
| pburtenshaw | 42:4e0a96b52e65 | 13 | |
| pburtenshaw | 42:4e0a96b52e65 | 14 | //realisticly what we need:: |
| pburtenshaw | 42:4e0a96b52e65 | 15 | //read values taking argument n |
| pburtenshaw | 42:4e0a96b52e65 | 16 | //read values taking no argument |
| pburtenshaw | 42:4e0a96b52e65 | 17 | //take value and put it in the right place |
| pburtenshaw | 42:4e0a96b52e65 | 18 | //delete with argument |
| pburtenshaw | 42:4e0a96b52e65 | 19 | //delete without argument |
| pburtenshaw | 42:4e0a96b52e65 | 20 | public: |
| pburtenshaw | 42:4e0a96b52e65 | 21 | Queue(); |
| pburtenshaw | 42:4e0a96b52e65 | 22 | void read(int nR); // where nR is the number to read, if REAL ALL is typed then the method will be called by something like queue.read(queue.count). |
| pburtenshaw | 42:4e0a96b52e65 | 23 | void deleteRecords(int nD); //as above but nD is number to delete |
| pburtenshaw | 42:4e0a96b52e65 | 24 | void addRecord(Reading r); |
| pburtenshaw | 42:4e0a96b52e65 | 25 | |
| pburtenshaw | 42:4e0a96b52e65 | 26 | |
| pburtenshaw | 42:4e0a96b52e65 | 27 | |
| pburtenshaw | 42:4e0a96b52e65 | 28 | }; |
| pburtenshaw | 42:4e0a96b52e65 | 29 | |
| pburtenshaw | 42:4e0a96b52e65 | 30 | }; |
| pburtenshaw | 42:4e0a96b52e65 | 31 | #endif |
