timer.h

来自「模拟器提供了一个简单易用的平台」· C头文件 代码 · 共 40 行

H
40
字号
/* * File: timer.h * Author: Suman Banerjee <suman@cs.umd.edu> * Date: July 31, 2001 * Terms: GPL * * myns simulator */#ifndef _TIMER_H_#define _TIMER_H_enum TimerType {  NODE_TIMER_PKT_SEND,  NODE_TIMER_POLL};class Timer {   private :     static int timer_id_gen;     int id;     bool is_set;   public :     void *pos; // The pos returned on insertion into the scheduler     Timer(void);     virtual ~Timer (void);     inline int get_id() {return id;};     inline void * get_pos() {return pos;};     void Handler (void); /* The generic handler */     virtual void EventHandler (void) = 0; /* Timer specific handler */     void SetTimer (double rel_time);     void CancelTimer (void);};#endif

⌨️ 快捷键说明

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