?? rlc-timers.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 __rlc_timers_h__#define __rlc_timers_h__class RLC;class RLCTimer : public Handler {public: RLCTimer(RLC* m, double s = 0) : rlc(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: RLC *rlc; int busy_; int paused_; Event intr; double stime; // start time double rtime; // remaining time double slottime;};class rlcTxTimer : public RLCTimer {public: rlcTxTimer(RLC *m) : RLCTimer(m) {} void handle(Event *e);};class rlcackTimer : public RLCTimer {public: rlcackTimer(RLC *m) : RLCTimer(m) {} void handle(Event *e);};#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -