ns-allinone-2.35/queue/red.cc
Packet* REDQueue::deque()
{
	Packet *p;
	if (summarystats_ && &Scheduler::instance() != NULL) {
		Queue::updateStats(qib_?q_->byteLength():q_->length());
	}
	p = q_->deque();
	if (p != 0) {
		idle_ = 0;
	} else {
		idle_ = 1;
		// deque() may invoked by Queue::reset at init
		// time (before the scheduler is instantiated).
		// deal with this case
		if (&Scheduler::instance() != NULL)
			idletime_ = Scheduler::instance().clock();
		else
			idletime_ = 0.0;
	}
	return (p);
}
/*
 * Return the next packet in the queue for transmission.
 */
Return the next packet in the queue for transmission.
Return the next packet in the queue for transmission .
Packet* REDQueue::deque()
{
	Packet *p;
	if (summarystats_ && &Scheduler::instance() != NULL) {
		Queue::updateStats(qib_?q_->byteLength():q_->length());
	}
	p = q_->deque();
	if (p != 0) {
		idle_ = 0;
	} else {
		idle_ = 1;
		if (&Scheduler::instance() != NULL)
			idletime_ = Scheduler::instance().clock();
		else
			idletime_ = 0.0;
	}
	return (p);
}
Packet * REDQueue :: deque ( ) { Packet * p ; if ( summarystats_ && & Scheduler :: instance ( ) != NULL ) { Queue :: updateStats ( qib_ ? q_ -> byteLength ( ) : q_ -> length ( ) ) ; } p = q_ -> deque ( ) ; if ( p != 0 ) { idle_ = 0 ; } else { idle_ = 1 ; if ( & Scheduler :: instance ( ) != NULL ) idletime_ = Scheduler :: instance ( ) . clock ( ) ; else idletime_ = 0.0 ; } return ( p ) ; }
Return the next packet in the queue for transmission.
Return the next packet in the queue for transmission .
// deque() may invoked by Queue::reset at init // time (before the scheduler is instantiated). // deal with this case