📄 timeblock.h
字号:
//TimeBlock.h
//class TimeBlock defination
//used for simulating the TimeBlock
//refer to CPU.H , RelationShip between CPU and
//TimeBlock
//design target:
//can provide different time cycle
//can be easily adjusted
//use MultiMedia Timer implementing this function
//NOTE: the timer function is
//Declared in mmsystem.h
//and you also be required import Library: winmm.lib
#include <mmsystem.h>
//function declare:
void timeKillEvent(UINT uTimerID);
void CALLBACK TimePro(
UINT uID,
UINT uMsg,
DWORD dwUser,
DWORD dw1,
DWORD dw2
);
MMRESULT timeSetEvent(
UINT uDelay,
UINT uResolution,
LPTIMECALLBACK lpTimeProc,
DWORD dwUser,
UINT fuEvent
);
//declare the classes that will be used in the class
//TimeBlock
class TimeBlock
{
private:
UINT m_uTimeID;//the timerID
CPU* _cpu;//the CPU that the TimeBlock Attach to
UINT m_uInterval;//the Interval of the time cycle
public:
//construction/destruction
TimeBlock();
TimeBlock(CPU* lpCPU, UINT uInterval);
~TimeBlock();
//attribute
void SetInterval(UINT& uInterval);
void GetInterval(UINT& uInterval);
void AttachToCPU(CPU* lpCPU);
//operation
void Start();
void Stop();
void End();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -