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

📄 device.h

📁 操作系统实验
💻 H
字号:
// device.h: interface for the device class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DEVICE_H__82D39F22_6DB7_460D_A350_BEC66C7CC5D3__INCLUDED_)
#define AFX_DEVICE_H__82D39F22_6DB7_460D_A350_BEC66C7CC5D3__INCLUDED_

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

typedef struct pcb
{
    int id;
	int devnum;
	int need;
	char state[8];
	char name[20];
	char deviceid[22];
	struct neicun *nstart;//指向分配的内存
	struct pcb *next;
};

struct chct
{
    int channelid;
	int state;
	int coctnum;
	struct coct *coct;
    struct pcb* pcbhead;
	struct pcb* pcbtail;
};

struct coct
{
    int controllerid;
	int state;
	struct chct *chct_;
    struct pcb* pcbhead;
	struct pcb* pcbtail;
};

struct dct
{
    char type[20];
	int id;
    int waite;
	int busy;
	struct coct *co;
	int retrytimes;
	struct pcb* pcbhead;
};

struct sdt
{
    char type[20];
    char deviceid[22];
	struct dct *dct_;
	int address;
	struct sdt *next;
};

struct dev
{
    int id;
	char name[20];
	bool exist;
};

struct exe
{
    char pcbname[10];
	char deviceid[22];
	int state;
};

class device  
{
public:
	void exedev();
	void run();
	bool existdev(int n);
	void outs(bool tf);
	void back();
	int add();
	int dele();
	int ask();
	void init();
	device();
	virtual ~device();
protected:
	struct chct ch[2];
    struct coct co[3];
    struct sdt *in;
	struct sdt *out;
    int inid;
	int outid;
	int pcbid;
	struct dev indev[4];
	struct dev outdev[4];
	int cod[3];
	struct exe exe[8];
};

#endif // !defined(AFX_DEVICE_H__82D39F22_6DB7_460D_A350_BEC66C7CC5D3__INCLUDED_)

⌨️ 快捷键说明

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