usedevice.cpp
来自「操作系统 程序实现一个虚拟机模拟多道的运行环境」· C++ 代码 · 共 41 行
CPP
41 行
// UseDevice.cpp: implementation of the CUseDevice class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "UseDevice.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CUseDevice::CUseDevice(){
DeviceType=_T("");
StartTime=-1;
EndTime=-1;
}
CUseDevice::CUseDevice(CUseDevice& ud){
this->DeviceType=ud.DeviceType;
this->LeftTime=ud.LeftTime;
this->RequestTime=ud.RequestTime;
this->StartTime=ud.StartTime;
this->EndTime=ud.EndTime;
this->ProcessName=ud.ProcessName;
}
void CUseDevice::UseDevice(){
if(LeftTime>0)
LeftTime--;
}
void CUseDevice::SetRequestTimeLength(int length){
LeftTime=RequestTime=length;
}
CUseDevice::CUseDevice(CString proName,CString devType){
DeviceType=_T("");
StartTime=-1;
EndTime=-1;
ProcessName=proName;
DeviceType=devType;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?