ns-allinone-2.35/nam-1.15/trafficsource.cc
bool
TimeList::isOn(double time) {
	TimeElement * element;
	bool on = false;

	for (element = head(); element; element = element->next_) {
		if (time < element->time_) {
				break;
		}

		if (on) {
			on = false;
		} else {
			on = true;
		}
	}
	return on;
}
//----------------------------------------------------------------------
// bool
// TimeList::isOn(double time)
//   - checks the timelist to see if time falls between a
//     start-stop period or a stop-start period
//   - if it is start-stop the object should be on so it will return
//     true.  Otherwise the object is off and will return false.
//----------------------------------------------------------------------
bool
TimeList::isOn(double time)
checks the timelist to see if time falls between a
start-stop period or a stop-start period
if it is start-stop the object should be on so it will return
true.  Otherwise the object is off and will return false.
bool TimeList :: isOn ( double time ) checks the timelist to see if time falls between a start - stop period or a stop - start period if it is start - stop the object should be on so it will return true . Otherwise the object is off and will return false .
bool
TimeList::isOn(double time) {
	TimeElement * element;
	bool on = false;
	for (element = head(); element; element = element->next_) {
		if (time < element->time_) {
				break;
		}
		if (on) {
			on = false;
		} else {
			on = true;
		}
	}
	return on;
}
bool TimeList :: isOn ( double time ) { TimeElement * element ; bool on = false ; for ( element = head ( ) ; element ; element = element -> next_ ) { if ( time < element -> time_ ) { break ; } if ( on ) { on = false ; } else { on = true ; } } return on ; }
bool
TimeList::isOn(double time)
 checks the timelist to see if time falls between a
start-stop period or a stop-start period
 if it is start-stop the object should be on so it will return
true.
bool TimeList :: isOn ( double time ) checks the timelist to see if time falls between a start - stop period or a stop - start period if it is start - stop the object should be on so it will return true .