/******************************************************** Server.cpp CMSC-341 Spring 2004 Project 2 Spencer Shimko, Section 001, sshimko1 Created: 02 March 2004 Current: 03 March 2004 Server class (implementation) Server class which will be in 1 of 2 states: BUSY working on a Job object or IDLE. The server will accumulate total idle time. *********************************************************/ #include "Server.h" Server::Server ( ) : sStatus (IDLE), sJob (NULL), sIdle (-1) { } Server::Server ( Job & j ) : sStatus (BUSY), sJob (&j), sIdle (-1) { } Server::~Server ( ) { } void Server::setJob ( Job j ) { sJob = &j; } Job Server::getJob ( ) { return *sJob; } ServerStat Server::getSStat ( ) { return sStatus; } void Server::incSIdle ( ) { sIdle++; } int Server::getSIdle ( ) { return sIdle; } const Server & Server::operator= ( const Server & rhs ) { if ( this != &rhs ){ sStatus = rhs.sStatus; sJob = rhs.sJob; sIdle = rhs.sIdle; } return *this; }