active.h
来自「频谱分析仪Frequency Analyzer」· C头文件 代码 · 共 40 行
H
40 行
#if !defined ACTIVE_H
#define ACTIVE_H
//------------------------------------
// active.h
// Active object framework
// (c) Bartosz Milewski, 1996
//------------------------------------
#include "thread.h"
#include <windows.h>
class ActiveObject
{
public:
ActiveObject ();
virtual ~ActiveObject () {}
void Kill ();
void Resume () { _thread.Resume (); }
protected:
virtual void InitThread () = 0;
virtual void Run () = 0;
virtual void FlushThread () = 0;
int _isDying;
static DWORD WINAPI ThreadEntry (void *pArg);
Thread _thread;
};
// Last thing in the constructor of a class derived from
// ActiveObject you must call
// _thread.Resume ();
// Inside the loop the Run method you must keep checking _isDying
// if (_isDying)
// return;
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?