// Program Name:  Process Scheduler
// Programmer: Mark Dehus, 42
// Assignment Number: Project #1
// Purpose: To simulate and show the process scheduling
//			system of an operating system.

// Tested and compiled on Minigw (GCC 3.2) with Dev-C++ 4.9.8.0
// there is a couple problems on VC++ because it is outdated
// and no longer meets current ISO C++ - go and update your compiler.

#include "PCB.h"

using namespace std;

PCB::PCB(string procname, int id, int stime, int etime, int iotime)
{
	name = procname;
	state = "new";
 	pid = id;
	start_time = stime;
	exec_time = etime;
	io_break = iotime;
	io_finish_time = 0;
	tot_exec_time = 0;
	running_time = 0;
}

void PCB::dump_vars(int &prid, string &s, int &stime, int &etime, int &ib, int &rt)
{
	prid = pid;
	s = state;
	stime = start_time;
	etime = tot_exec_time;
	ib = io_break;
	rt = running_time;
	
}

string PCB::get_pid()
{
	char buffer[33];	
	itoa(pid, buffer, 10); 
 	return buffer;
}

