simmodel.h

来自「show to use C/C++ do system test.」· C头文件 代码 · 共 33 行

H
33
字号
#ifndef	SIMMODEL_H
#define	SIMMODEL_H


class  SIMMODEL {
	friend class   SIMSYSTEM;
	friend class   PROCESS;
	friend class   RESOURCE;
public:
	static SIMMODEL   *get_simmodel();
	real64   get_simtime();
	uint32   get_prcsnum();
	void     clear();
	int      simulate();
protected:
	SIMMODEL()  { _construct(); }
	virtual ~SIMMODEL()  { _destruct(); }
	template <class T>
	T    *create_process( T* &process )  { process = new T;  _init_process( process );  return process; }
private:
	void   *_data;
	int     _construct();
	int     _destruct();
	int     _init_process( void *process );
	int     _execute_process( uint08 init );
};


#define  SIMTIME   ((SIMMODEL::get_simmodel() == NULL) ? 0 : SIMMODEL::get_simmodel()->get_simtime())


#endif

⌨️ 快捷键说明

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