⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ll-timers.h

📁 一个很好的LINUX底下的GPRS协议栈
💻 H
字号:
/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- *//* By Sandeep Kumar, Kopparapu Suman and Richa Jain,  * Indian Institute of Technology, Bombay. * June, 2001.*/ /* Copyright (c) 2001 Indian Insitute of Technology, Bombay.   * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: *  * 1. Redistributions of source code and binary code must contain * the above copyright notice, this list of conditions and the following  * disclaimer. *  * 2. All advertising materials mentioning features or use of this software * must display the following acknowledgement:  * This product includes software developed at Indian Insitute of * Technology, Bombay.  * * 3. The name of the Institute may not be used to endorse or promote  * products derived from this software without specific prior written  * permission. * INDIAN INSTITUTE OF TECHNOLOGY, BOMBAY, MAKES NO REPRESENTATIONS  * CONCERNING EITHER THE MERCHANTABILITY OF THIS SOFTWARE OR THE  * SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE.  The software  * is provided "as is" without express or implied warranty of any kind.*/#ifndef __ll_timers_h__#define __ll_timers_h__class LL;class LLTimer : public Handler {public:	LLTimer(LL* m, double s = 0) : ll(m), slottime(s) {		busy_ = paused_ = 0; stime = rtime = 0.0;	}	virtual void handle(Event *e) = 0;	virtual void start(double time);	virtual void stop(void);	virtual void pause(void) { assert(0); }	virtual void resume(void) { assert(0); }	inline int busy(void) { return busy_; }	inline int paused(void) { return paused_; }	inline double expire(void) {		return ((stime + rtime) - Scheduler::instance().clock());	}protected:	LL	*ll;	int		busy_;	int		paused_;	Event		intr;	double		stime;	// start time	double		rtime;	// remaining time	double		slottime;};class llTxTimer : public LLTimer {public:	llTxTimer(LL *m) : LLTimer(m) {}	void	handle(Event *e);};class llackTimer : public LLTimer {public:	llackTimer(LL *m) : LLTimer(m) {}	void	handle(Event *e);};#endif

⌨️ 快捷键说明

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