📄 oamrunner.h
字号:
#ifndef OAMRUNNER_H_
#define OAMRUNNER_H_
#include <pthread.h>
class OamRunner;
class OamThreadRunner
{
public:
// the definition of the thread status
enum
{
RUN,
PEND,
STOP
};
OamThreadRunner();
virtual ~OamThreadRunner();
bool stop();
bool start(OamRunner * runner);
bool suspend();
bool resume();
bool wait();
bool isRunning();
pthread_t self();
private:
static void * threadFunc(void * args);
// the thread id
pthread_t tid_m;
// the status of the thread
int status_m;
};
class OamRunner
{
friend class OamThreadRunner;
public:
OamRunner();
virtual ~OamRunner();
virtual bool stop();
virtual bool start();
virtual bool suspend();
virtual bool resume();
virtual bool wait();
virtual bool isRunning();
pthread_t self();
protected:
virtual int run();
private:
// the object of the runner helper.
OamThreadRunner runner_m;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -