All pastes #1576413 Raw Edit

ps.cpp

public cpp v1 · immutable
#1576413 ·published 2009-09-23 12:02 UTC
rendered paste body
#include "arguments.h"#include <iostream>#include <stdio.h>#include <fstream>#include "fifo.h"//#include "scheduleData.h"//#include "stringPedro.h"#define COMMENT '#'#define MAX_LINE 10000using 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;    }