Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

HBTimer Class Reference

#include <http-aux.h>

Inheritance diagram for HBTimer:

Inheritance graph
[legend]
Collaboration diagram for HBTimer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TimerStatus { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING }

Public Member Functions

 HBTimer (HttpMInvalCache *a, double interval)
void set_interval (double interval)
double get_interval () const
double next_interval ()
void sched ()
void resched ()
void sched (double delay)
void resched (double delay)
void cancel ()
void force_cancel ()
int status ()

Protected Member Functions

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

Protected Attributes

HttpMInvalCachea_
double interval_
int status_
Event event_

Member Enumeration Documentation

enum TimerHandler::TimerStatus [inherited]
 

Enumeration values:
TIMER_IDLE 
TIMER_PENDING 
TIMER_HANDLING 

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


Constructor & Destructor Documentation

HBTimer::HBTimer HttpMInvalCache a,
double  interval
[inline]
 

Definition at line 94 of file http-aux.h.

References a_, and interval_.

00094                                                      : TimerHandler() { 
00095                 a_ = a, interval_ = interval; 
00096         }


Member Function Documentation

void TimerHandler::cancel  )  [inherited]
 

Definition at line 31 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(), QA::get_data(), SMAC::handleACK(), SMAC::handleCTS(), SMAC::handleSYNC(), LandmarkAgent::periodic_callback(), LandmarkAgent::ProcessHierUpdate(), DelAckSink::recv(), TcpAsymSink::recv(), AbsDelAckSink::recv(), 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().

00032 {
00033         if (status_ != TIMER_PENDING) {
00034                 fprintf(stderr,
00035                   "Attempting to cancel timer at %p which is not scheduled\n",
00036                   this);
00037                 abort();
00038         }
00039         _cancel();
00040         status_ = TIMER_IDLE;
00041 }

Here is the call graph for this function:

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

Implements TimerHandler.

Definition at line 30 of file http-aux.cc.

References a_, HTTP_INVALIDATION, and HttpMInvalCache::timeout().

00031 {
00032         a_->timeout(HTTP_INVALIDATION);
00033 }

Here is the call graph for this function:

void TimerHandler::force_cancel  )  [inline, inherited]
 

Definition at line 60 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(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), GAFAgent::processDiscoveryMsg(), RTPAgent::rate_change(), TfrcAgent::stop(), RTPAgent::stop(), and SinkAgent::stop().

00060                                    {    // cancel!
00061                 if (status_ == TIMER_PENDING) {
00062                         _cancel();
00063                         status_ = TIMER_IDLE;
00064                 }
00065         }

Here is the call graph for this function:

double HBTimer::get_interval  )  const [inline]
 

Definition at line 98 of file http-aux.h.

References interval_.

00098 { return interval_; }

virtual void HBTimer::handle Event e  )  [inline, protected, virtual]
 

Reimplemented from TimerHandler.

Definition at line 108 of file http-aux.h.

References TimerHandler::handle(), and resched().

00108                                       {
00109                 TimerHandler::handle(e);
00110                 resched();
00111         }

Here is the call graph for this function:

double HBTimer::next_interval  )  [inline]
 

Definition at line 99 of file http-aux.h.

References interval_, and Random::uniform().

Referenced by resched().

00099                                {
00100                 return interval_ * (1 + Random::uniform(-0.1,0.1));
00101         }

Here is the call graph for this function:

void TimerHandler::resched double  delay  )  [inherited]
 

Definition at line 60 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(), SMAC::collision(), MIPMHAgent::command(), MIPBSAgent::command(), GAFAgent::command(), SinkAgent::command(), LmsReceiver::create_nak(), GAFAgent::duty_timeout(), PacketTypeLog::expire(), QSTimer::expire(), OmniMcastSendBufTimer::expire(), OmniMcastArpBufferTimer::expire(), QATimer::expire(), PromotionTimer::expire(), SendBufferTimer::expire(), SendBufTimer::expire(), ArpBufferTimer::expire(), EnergyTimer::expire(), DiffusionRate::GradientTimeOut(), SatLinkHandoffMgr::handoff(), TermLinkHandoffMgr::handoff(), RapAgent::IpgTimeout(), RapAgent::LossHandler(), DiffusionRate::NegReinfTimeOut(), TfrcAgent::nextpkt(), TfrcSinkAgent::nextpkt(), RBPRenoTcpAgent::paced_send_one(), RBPVegasTcpAgent::paced_send_one(), QSNewRenoTcpAgent::paced_send_one(), PacketTypeLog::PacketTypeLog(), LandmarkAgent::periodic_callback(), LandmarkAgent::ProcessHierUpdate(), LogWebTrafPool::processLog(), PushbackQueue::PushbackQueue(), QSAgent::QSAgent(), RTPAgent::rate_change(), TfrcAgent::recv(), DelAckSink::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), TcpAsymSink::recv(), AbsDelAckSink::recv(), TBF::recv(), SMAC::recv(), SA_Agent::recv(), FtpClientAgent::recv(), TfrcAgent::reduce_rate_on_no_feedback(), MIPMHAgent::reg(), SinkAgent::report(), LivenessTimer::resched(), 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(), UnslottedAlohaMac::sendUp(), TcpAgent::set_rtx_timer(), TcpSessionAgent::set_rtx_timer(), TcpFsAgent::set_rtx_timer(), AbsTcpAgent::set_timer(), REMQueue::set_update_timer(), TrafficGenerator::start(), TfrcAgent::start(), RTPAgent::start(), RTCPAgent::start(), FtpClientAgent::start(), Estimator::start(), SinkAgent::start(), DiffusionRate::Start(), DiffusionProb::Start(), TrafficGenerator::timeout(), TrafficTrace::timeout(), TelnetApp::timeout(), FullTcpAgent::timeout(), BayFullTcpAgent::timeout(), TBF::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(), WirelessPhy::UpdateIdleEnergy(), SMAC::updateNav(), SMAC::updateNeighNav(), and WirelessPhy::WirelessPhy().

00061 {
00062         if (status_ == TIMER_PENDING)
00063                 _cancel();
00064         _sched(delay);
00065         status_ = TIMER_PENDING;
00066 }

Here is the call graph for this function:

void HBTimer::resched  )  [inline]
 

Definition at line 103 of file http-aux.h.

References next_interval(), and TimerHandler::resched().

Referenced by handle().

00103                        {
00104                 TimerHandler::resched(next_interval());
00105         }

Here is the call graph for this function:

void TimerHandler::sched double  delay  )  [inherited]
 

Reimplemented in SmacRecvTimer, SmacNeighNavTimer, and SmacCounterTimer.

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

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

Referenced by SMAC::checkToSend(), WebTrafPool::command(), EmpWebTrafPool::command(), EmpFtpTrafPool::command(), DSRAgent::command(), EmpWebPage::doneObject(), WebTrafSession::donePage(), EmpWebTrafSession::donePage(), QA::get_data(), WebTrafSession::handle(), WebPage::handle(), EmpWebTrafSession::handle(), EmpWebPage::handle(), EmpFtpTrafSession::handle(), SMAC::handleCounterTimer(), LandmarkAgent::ProcessHierUpdate(), SmacCounterTimer::sched(), SmacNeighNavTimer::sched(), SmacRecvTimer::sched(), LivenessTimer::sched(), PushTimer::sched(), sched(), SMAC::sentDATA(), SMAC::sentRTS(), SMAC::SMAC(), TelnetApp::start(), OmniMcastAgent::Start(), DiffusionAgent::Start(), LandmarkAgent::startUp(), and SMAC::transmit().

00050 {
00051         if (status_ != TIMER_IDLE) {
00052                 fprintf(stderr,"Couldn't schedule timer");
00053                 abort();
00054         }
00055         _sched(delay);
00056         status_ = TIMER_PENDING;
00057 }

Here is the call graph for this function:

void HBTimer::sched  )  [inline]
 

Definition at line 102 of file http-aux.h.

References interval_, and TimerHandler::sched().

Referenced by HttpMInvalCache::command().

00102 { TimerHandler::sched(interval_); }

Here is the call graph for this function:

void HBTimer::set_interval double  interval  )  [inline]
 

Definition at line 97 of file http-aux.h.

References interval_.

Referenced by HttpMInvalCache::HttpMInvalCache().

00097 { interval_ = interval; }

int TimerHandler::status  )  [inline, inherited]
 

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

References TimerHandler::status_.

Referenced by TcpSessionAgent::add_pkts(), BayFullTcpAgent::cancel_rtx_timeout(), HttpMInvalCache::command(), FullTcpAgent::foutput(), QA::get_data(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), BayFullTcpAgent::output(), DelAckSink::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), TcpAsymSink::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(), TcpSessionAgent::set_rtx_timer(), TcpFsAgent::set_rtx_timer(), RapAgent::stop(), QA::stop(), and QA::~QA().

00067 { return status_; };


Member Data Documentation

HttpMInvalCache* HBTimer::a_ [protected]
 

Definition at line 112 of file http-aux.h.

Referenced by expire(), and HBTimer().

Event TimerHandler::event_ [protected, inherited]
 

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

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

double HBTimer::interval_ [protected]
 

Definition at line 113 of file http-aux.h.

Referenced by get_interval(), HBTimer(), next_interval(), sched(), and set_interval().

int TimerHandler::status_ [protected, inherited]
 

Definition at line 74 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(), TimerHandler::TimerHandler(), EmpFtpTrafSession::~EmpFtpTrafSession(), EmpWebTrafSession::~EmpWebTrafSession(), and WebTrafSession::~WebTrafSession().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:50:24 2004 for NS2.26SourcesOriginal by doxygen 1.3.3