📄 mac-802_16-timers.cc
字号:
/******************************************************************************** * WiMAX module * * Copyright (C) 2008 Juliana Freitag Borin, Flavio Kubota and Nelson L. * S. da Fonseca - wimaxgroup@lrc.ic.unicamp.br * * This program is a free result: you can redistribute it and/or modify * it under the terms of the UOL Public License Version 1 or (at your * option) any later version. The license terms are available at * http://bolsapesquisa.uol.com.br/lpu.jhtm. * * * This file contains c++ methods for implementing various timer classes * * $A1: 4/20/06: (J. Freitag) included timer to downlink QoS scheduling services ******************************************************************************//*! \file mac-802_16-timers.cc This file contains c++ methods for implementing various timer classes */#include "mac-802_16.h"#include "mac-802_16-timers.h"/*************************************************************************Timers*************************************************************************/void Mac802_16Timer :: start(Packet * e, double time){ Scheduler &s = Scheduler::instance(); //assert(busy_ == 0); busy_ = 1; paused_ = 0; stime = s.clock(); rtime = time; assert(rtime >= 0.0); s.schedule(this, e , rtime);}/**************************************************************************************************************************************************/void Mac802_16Timer::stop(Packet * e) { Scheduler &s = Scheduler::instance(); // assert(busy_); if(paused_ == 0) s.cancel((Event *)e); busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0;}/*************************************************************************Receive Timer*************************************************************************//*! Receive Timer */void RxPkt802_16Timer::handle(Event *e) { busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->recvHandler(e);}/*************************************************************************Send Timer*************************************************************************//*! Send Timer */void TxPkt802_16Timer::handle(Event *e) { busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->sendHandler(e);}/*************************************************************************Send Timer*************************************************************************//*! Send Timer */void BsTxPkt802_16Timer::handle(Event *e) { busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsSendHandler(e);}/**************************************************************************************************************************************************/void Map802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsMapHandler(e);}/**************************************************************************************************************************************************/void BsUcd802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsUcdHandler(e);}/**************************************************************************************************************************************************/void BsRng802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsRngHandler(e);}/**************************************************************************************************************************************************/void BsSync802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsSyncHandler(e);}//#ifdef RATE_CONTROL//-----------------------------------------------------/**************************************************************************************************************************************************/void BsToken802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsTokenHandler(e);}//#endif//------------------------------------------------------------------/**************************************************************************************************************************************************/void BsServiceFlowSendTimer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; //printf("Snd timer expired..\n"); mac->BsSndTimerHandler(e);}/**************************************************************************************************************************************************/void SSRng802_16Timer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; //printf("Rng timer expired..\n"); mac->SSRngHandler(e);}/**************************************************************************************************************************************************/void SSServiceFlowSendTimer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; //printf("Snd timer expired..\n"); mac->SSSndTimerHandler(e);}/**************************************************************************************************************************************************/void SSServiceFlowRequestTimer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->SSReqTimerHandler(e);}/**************************************************************************************************************************************************/void BsUplinkSchedWindowTimer::handle(Event *e){ busy_ = 0; paused_ = 0; stime = 0.0; rtime = 0.0; mac->BsWindowTimerHandler(e);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -