Sleep_Timer Class Reference

#include <wireless-phy.h>

Inheritance diagram for Sleep_Timer:

TimerHandler Handler Collaboration diagram for Sleep_Timer:

Collaboration graph
[legend]

Detailed Description

Definition at line 56 of file wireless-phy.h.

Public Types

enum  TimerStatus { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING }

Public Member Functions

void cancel ()
void force_cancel ()
void resched (double delay)
void sched (double delay)
 Sleep_Timer (WirelessPhy *a)
int status ()

Protected Member Functions

virtual void expire (Event *e)
virtual void handle (Event *)

Protected Attributes

WirelessPhya_
Event event_
int status_


Member Enumeration Documentation

enum TimerHandler::TimerStatus [inherited]
 

Enumerator:
TIMER_IDLE 
TIMER_PENDING 
TIMER_HANDLING 

Definition at line 94 of file timer-handler.h.


Constructor & Destructor Documentation

Sleep_Timer::Sleep_Timer WirelessPhy a  )  [inline]
 

Definition at line 58 of file wireless-phy.h.

References a, and a_.

00058 : TimerHandler() { a_ = a; }


Member Function Documentation

void TimerHandler::cancel  )  [inherited]
 

Definition at line 56 of file timer-handler.cc.

References TimerHandler::_cancel(), abort(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING.

Referenced by BayFullTcpAgent::cancel_rtx_timeout(), PushbackTimer::cancelStatus(), SmacCsTimer::checkToCancel(), LmsReceiver::delete_nak(), SMAC::handleACK(), SMAC::handleCTS(), SMAC::handleSYNC(), LandmarkAgent::periodic_callback(), MIPMHAgent::recv(), FtpClientAgent::recv(), PushbackTimer::removeEvents(), DelAckSink::reset(), FackTcpAgent::send_much(), TcpSessionAgent::set_rtx_timer(), TcpFsAgent::set_rtx_timer(), TrafficGenerator::stop(), SA_Agent::stop(), RTCPAgent::stop(), RapAgent::stop(), QA::stop(), LandmarkAgent::stop(), Estimator::stop(), NeighborCache::~NeighborCache(), PacketTypeLog::~PacketTypeLog(), QA::~QA(), and TBF::~TBF().

00057 {
00058     if (status_ != TIMER_PENDING) {
00059         fprintf(stderr,
00060           "Attempting to cancel timer at %p which is not scheduled\n",
00061           this);
00062         abort();
00063     }
00064     _cancel();
00065     status_ = TIMER_IDLE;
00066 }

Here is the call graph for this function:

void Sleep_Timer::expire Event e  )  [protected, virtual]
 

Implements TimerHandler.

Definition at line 60 of file wireless-phy.cc.

References a_, and WirelessPhy::UpdateSleepEnergy().

00060                                 {
00061     a_->UpdateSleepEnergy();
00062 }

Here is the call graph for this function:

void TimerHandler::force_cancel  )  [inline, inherited]
 

Definition at line 88 of file timer-handler.h.

References TimerHandler::_cancel(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING.

Referenced by TcpAgent::cancel_rtx_timer(), TcpSessionAgent::cancel_rtx_timer(), TcpFsAgent::cancel_rtx_timer(), AbsTcpAgent::cancel_timer(), TcpAgent::cancel_timers(), TcpSessionAgent::cancel_timers(), FullTcpAgent::cancel_timers(), TcpFsAgent::cancel_timers(), SctpAgent::Close(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), SctpAgent::ProcessChunk(), SctpAgent::ProcessCookieAckChunk(), GAFAgent::processDiscoveryMsg(), SctpAgent::ProcessHeartbeatAckChunk(), SctpAgent::ProcessInitAckChunk(), RTPAgent::rate_change(), SctpAgent::Reset(), TfrcAgent::stop(), RTPAgent::stop(), SinkAgent::stop(), SctpAgent::StopT3RtxTimer(), SctpAgent::Timeout(), MfrHbAfterRtoSctpAgent::Timeout(), and HbAfterRtoSctpAgent::Timeout().

00088                                {    // cancel!
00089         if (status_ == TIMER_PENDING) {
00090             _cancel();
00091             status_ = TIMER_IDLE;
00092         }
00093     }

Here is the call graph for this function:

void TimerHandler::handle Event  )  [protected, virtual, inherited]
 

Implements Handler.

Reimplemented in EmpFtpTrafSession, EmpWebPage, EmpWebTrafSession, HBTimer, WebPage, and WebTrafSession.

Definition at line 94 of file timer-handler.cc.

References abort(), TimerHandler::expire(), TimerHandler::status_, TimerHandler::TIMER_HANDLING, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING.

Referenced by WebTrafSession::handle(), WebPage::handle(), HBTimer::handle(), EmpWebTrafSession::handle(), EmpWebPage::handle(), and EmpFtpTrafSession::handle().

00095 {
00096     if (status_ != TIMER_PENDING)   // sanity check
00097         abort();
00098     status_ = TIMER_HANDLING;
00099     expire(e);
00100     // if it wasn't rescheduled, it's done
00101     if (status_ == TIMER_HANDLING)
00102         status_ = TIMER_IDLE;
00103 }

Here is the call graph for this function:

void TimerHandler::resched double  delay  )  [inherited]
 

Reimplemented in SmacRecvTimer.

Definition at line 85 of file timer-handler.cc.

References TimerHandler::_cancel(), TimerHandler::_sched(), TimerHandler::status_, and TimerHandler::TIMER_PENDING.

Referenced by UnslottedAlohaMac::backoff(), SinkAgent::bcast_interest(), PIQueue::calculate_p(), MIPMHAgent::command(), MIPBSAgent::command(), GAFAgent::command(), SinkAgent::command(), LmsReceiver::create_nak(), SctpAgent::CwndDegradeTimerExpiration(), GAFAgent::duty_timeout(), XCPQueue::everyRTT(), PacketTypeLog::expire(), QSTimer::expire(), OmniMcastSendBufTimer::expire(), OmniMcastArpBufferTimer::expire(), QATimer::expire(), PromotionTimer::expire(), SendBufferTimer::expire(), SendBufTimer::expire(), ArpBufferTimer::expire(), SpikeTimer::expire(), SMAC::handleGeneTimer(), SctpAgent::HeartbeatGenTimerExpiration(), RapAgent::IpgTimeout(), RapAgent::LossHandler(), TfrcAgent::nextpkt(), TfrcSinkAgent::nextpkt(), RBPRenoTcpAgent::paced_send_one(), RBPVegasTcpAgent::paced_send_one(), QSNewRenoTcpAgent::paced_send_one(), LandmarkAgent::periodic_callback(), SctpAgent::ProcessChunk(), SctpAgent::ProcessHeartbeatAckChunk(), TPM::processLog(), LogWebTrafPool::processLog(), PushbackQueue::PushbackQueue(), QSAgent::QSAgent(), RTPAgent::rate_change(), TfrcAgent::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), AbsDelAckSink::recv(), FtpClientAgent::recv(), Delayer::recv(), TfrcAgent::reduce_rate_on_no_feedback(), MIPMHAgent::reg(), SinkAgent::report(), SmacRecvTimer::resched(), LivenessTimer::resched(), HBTimer::resched(), RapAgent::RttTimeout(), SmacCounterTimer::sched(), PushbackTimer::schedule(), WebServer::schedule_next_job(), GAFAgent::schedule_wakeup(), TcpFsAgent::send_helper(), TcpAsymAgent::send_helper(), TcpAgent::send_much(), TcpSessionAgent::send_much(), Sack1TcpAgent::send_much(), SackRHTcpAgent::send_much(), IntTcpAgent::send_much(), FullTcpAgent::send_much(), BayFullTcpAgent::send_much(), FackTcpAgent::send_much(), UnslottedAlohaMac::sendDown(), SctpAgent::SendHeartbeat(), SctpAgent::SendMuch(), SctpAgent::SendPacket(), UnslottedAlohaMac::sendUp(), TcpAgent::set_rtx_timer(), TcpSessionAgent::set_rtx_timer(), TcpFsAgent::set_rtx_timer(), AbsTcpAgent::set_timer(), REMQueue::set_update_timer(), XCPQueue::setEffectiveRtt(), TrafficGenerator::start(), TfrcAgent::start(), RTPAgent::start(), RTCPAgent::start(), FtpClientAgent::start(), Estimator::start(), SinkAgent::start(), DiffusionRate::Start(), DiffusionProb::Start(), SctpAgent::StartT3RtxTimer(), SctpAgent::T1CookieTimerExpiration(), AnWormApp::timeout(), DnhWormApp::timeout(), TrafficGenerator::timeout(), TrafficTrace::timeout(), TelnetApp::timeout(), FullTcpAgent::timeout(), BayFullTcpAgent::timeout(), SctpApp1::timeout(), SA_Agent::timeout(), RTPAgent::timeout(), RTCPAgent::timeout(), PushbackQueue::timeout(), MIPMHAgent::timeout(), MIPBSAgent::timeout(), LmsReceiver::timeout(), GAFAgent::timeout(), EXPOO_Traffic::timeout(), Estimator::timeout(), SinkAgent::timeout(), CBR_PP_Traffic::timeout(), XCPQueue::Tq_timeout(), TwoStateErrorModel::transitionState(), AnWormApp::update(), SMAC::updateNav(), SMAC::updateNeighNav(), WirelessPhy::UpdateSleepEnergy(), and WirelessPhy::WirelessPhy().

00086 {
00087     if (status_ == TIMER_PENDING)
00088         _cancel();
00089     _sched(delay);
00090     status_ = TIMER_PENDING;
00091 }

Here is the call graph for this function:

void TimerHandler::sched double  delay  )  [inherited]
 

Reimplemented in SmacRecvTimer, SmacNeighNavTimer, and SmacCounterTimer.

Definition at line 74 of file timer-handler.cc.

References TimerHandler::_sched(), abort(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING.

Referenced by SMAC::checkToSend(), EmpFtpTrafPool::command(), DSRAgent::command(), Delayer::command(), EmpWebPage::doneObject(), WebTrafSession::handle(), WebPage::handle(), EmpWebTrafSession::handle(), EmpWebPage::handle(), EmpFtpTrafSession::handle(), SMAC::handleCounterTimer(), SMAC::handleRTS(), DnhWormApp::probe(), SmacCounterTimer::sched(), SmacNeighNavTimer::sched(), SmacRecvTimer::sched(), LivenessTimer::sched(), PushTimer::sched(), HBTimer::sched(), SctpAgent::SendPacket(), SMAC::sentDATA(), SMAC::sentRTS(), XCPQueue::setupTimers(), AnWormApp::start(), TelnetApp::start(), SctpApp1::start(), OmniMcastAgent::Start(), DiffusionAgent::Start(), LandmarkAgent::startUp(), TwoStateErrorModel::transitionState(), and SMAC::transmit().

00075 {
00076     if (status_ != TIMER_IDLE) {
00077         fprintf(stderr,"Couldn't schedule timer");
00078         abort();
00079     }
00080     _sched(delay);
00081     status_ = TIMER_PENDING;
00082 }

Here is the call graph for this function:

int TimerHandler::status  )  [inline, inherited]
 

Definition at line 95 of file timer-handler.h.

References TimerHandler::status_.

Referenced by TcpSessionAgent::add_pkts(), BayFullTcpAgent::cancel_rtx_timeout(), HttpMInvalCache::command(), FullTcpAgent::foutput(), XcpAgent::output(), TcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), BayFullTcpAgent::output(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), AbsDelAckSink::recv(), MIPMHAgent::recv(), DelAckSink::reset(), TcpAgent::send_much(), TcpSessionAgent::send_much(), Sack1TcpAgent::send_much(), SackRHTcpAgent::send_much(), IntTcpAgent::send_much(), FullTcpAgent::send_much(), BayFullTcpAgent::send_much(), FackTcpAgent::send_much(), SctpAgent::SendPacket(), TcpSessionAgent::set_rtx_timer(), TcpFsAgent::set_rtx_timer(), RapAgent::stop(), QA::stop(), and QA::~QA().

00095 { return status_; };


Field Documentation

WirelessPhy* Sleep_Timer::a_ [protected]
 

Definition at line 61 of file wireless-phy.h.

Referenced by expire(), and Sleep_Timer().

Event TimerHandler::event_ [protected, inherited]
 

Definition at line 103 of file timer-handler.h.

Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), WebPage::start(), and EmpWebPage::start().

int TimerHandler::status_ [protected, inherited]
 

Definition at line 102 of file timer-handler.h.

Referenced by SmacTimer::busy(), TimerHandler::cancel(), SmacCsTimer::checkToCancel(), TimerHandler::force_cancel(), TimerHandler::handle(), TimerHandler::resched(), TimerHandler::sched(), SmacCounterTimer::sched(), WebPage::start(), EmpWebPage::start(), TimerHandler::status(), EmpFtpTrafSession::~EmpFtpTrafSession(), EmpWebTrafSession::~EmpWebTrafSession(), and WebTrafSession::~WebTrafSession().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:30:52 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6