#include "arguments.h" #include #include #include #include "fifo.h" //#include "scheduleData.h" //#include "stringPedro.h" #define COMMENT '#' #define MAX_LINE 10000 using namespace std; /* * Summary: * * Parameters: * */ int main(int argc, char** argv) { StringPedro argvString; if(argv[1]) { argvString.set(argv[1]); } else { cout << "no argument string provided, can not continue" << endl; exit(1); } //Arguments arguments("filename=myCoke.txt;scheduling=fifo;quantum=3;size=35;"); Arguments arguments(argvString); cout << "this is my argument quantum: " << arguments.getQuantum() << endl; arguments.getFilename().output(); cout << "this is my argument size: " << arguments.getSize() << endl; arguments.getScheduling().output(); int queueSize = 3; int second = 0; int queue = 1; char line[MAX_LINE]; /* Prepare file input */ FILE * pFile; pFile = fopen("input.txt", "r"); // Create queueSize + 1 classes Fifo * queueArray = new Fifo[queueSize+1]; while( fgets(line, MAX_LINE, pFile) != NULL ) { //StringPedro lineString(line); //ScheduleData data(line); // check if line is a comment //if(lineString.data[0] == COMMENT) // continue; //lineString.output(); //while(second <= 5) { // Fifo myRecord01(2,8,7); // Append // Fifo::append(&queueArray[0], &myRecord01, queueSize); // if(!queueArray[queue].getOccupied()) // queue++; // second++; //} // end time loop } // read input file loop delete [] queueArray; queueArray = NULL; }