Minor fixes

Dependencies:   LPS25H hts221

Fork of Coursework by Group PAG

MyQueue.cpp

Committer:
noutram
Date:
2017-05-04
Revision:
44:2b23c7407547

File content as of revision 44:2b23c7407547:

#include "MyQueue.h"


MyQueue::MyQueue(){
    maxSize = 120;
    front = 0;
    back = 0;
    isFull = false;
    storage = new Reading[maxSize];
}
    
void MyQueue::push(Reading r){
    //if it is full then the front must move. if front is max then it must become 0
    if (isFull == true){
        if (front == maxSize-1){
            front = 0;
            }
        else{
            front = front +1; 
            }
        back = back +1;
        storage[back] = r;        
    }

    //otherwise the MyQueue is full
    else {
        
    }
}
void MyQueue::read(int nR){// where nR is the number to read, if REAL ALL is typed then the method will be called by something like MyQueue.read(MyQueue.count).
        if (front>back){
          for( int a = back; a >=0; a = a - 1 ) {
          //print or cout? do until end of loop - think about how to loop over
           }
        }
        for( int a = maxSize-1; a >front; a = a + 1 ) {
          //print or cout? do until end of loop - think about how to loop over
        }
}

void MyQueue::deleteRecords(int nD){ //as above but nD is number to delete
    
    
}