⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 device.h

📁 操作系统 程序实现一个虚拟机模拟多道的运行环境
💻 H
字号:
// Device.h: interface for the CDevice class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DEVICE_H__42C25F5B_067E_4069_BBD2_5FF7DC783DF2__INCLUDED_)
#define AFX_DEVICE_H__42C25F5B_067E_4069_BBD2_5FF7DC783DF2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Process.h"
/************************************************/
/************************************************************************/
/*																		*/
/*描述:		定义一个虚拟设备类,以模拟多道系统中各个设备的运行情况		*/
/*																		*/
/************************************************************************/

class CDevice {
private:
	CUseDevice* DeviceStepInfo;	//设备运行当前任务的信息
	CProcess* CurrentProcess;	//设备中当前运行的进程指针
	CString DeviceType;			//设备的类型
	int DeviceStatus;			//设备当前的状态,状态有两种:busy(繁忙),idlesse(空闲)
	CPtrArray Queue;			//设备要处理的任务的队列
	CPtrArray UseHistory;		//设备运行历史
	enum{busy,idlesse};
protected:
	void SetStatus(int status){DeviceStatus=status;}	//设置设备的当前状态
public:
	void CheckIdlesse();
	CString GetDeviceType(){return DeviceType;}	//取得设备的类型
	CPtrArray* GetHistory(){return &UseHistory;}	//取得设备的使用记录
	void Wait(CProcess* Process){Queue.Add(Process);}		//任务排队
	void Run();				//模拟运行设备
	int GetStatus(){return DeviceStatus;}		//取得设备的状态信息
	CDevice(CString);
	virtual ~CDevice(){}
private:
	CDevice(){}
friend class CProcess;
};

#endif // !defined(AFX_DEVICE_H__42C25F5B_067E_4069_BBD2_5FF7DC783DF2__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -