ns-allinone-2.35/nam-1.15/agent.cc
TrafficSource * 
Agent::addTrafficSource(TrafficSource * ts) {
  TrafficSource * run, * last;

  run = traffic_sources_;
  last = NULL;

  // Find last traffic source on list
  while (run) {
    last = run;
    run = run->next_;
  }

  // if it exists then add it to the list
  if (last) {
    last->next_ = ts;
  } else {
    traffic_sources_ = ts;
  }  
  return last;
}
//----------------------------------------------------------------------
// TrafficSource * 
// TrafficSource::addTrafficSource(TrafficSource * ts)
//   - Add traffic source to the trafficsources_ list
//   - Returns the traffic source before the one just added
//----------------------------------------------------------------------
TrafficSource
TrafficSource::addTrafficSource(TrafficSource * ts)
Add traffic source to the trafficsources_ list
Returns the traffic source before the one just added
TrafficSource TrafficSource :: addTrafficSource ( TrafficSource * ts ) Add traffic source to the trafficsources_ list Returns the traffic source before the one just added
TrafficSource * 
Agent::addTrafficSource(TrafficSource * ts) {
  TrafficSource * run, * last;
  run = traffic_sources_;
  last = NULL;
  while (run) {
    last = run;
    run = run->next_;
  }
  if (last) {
    last->next_ = ts;
  } else {
    traffic_sources_ = ts;
  }  
  return last;
}
TrafficSource * Agent :: addTrafficSource ( TrafficSource * ts ) { TrafficSource * run , * last ; run = traffic_sources_ ; last = NULL ; while ( run ) { last = run ; run = run -> next_ ; } if ( last ) { last -> next_ = ts ; } else { traffic_sources_ = ts ; } return last ; }
TrafficSource 
TrafficSource::addTrafficSource(TrafficSource * ts)
 Add traffic source to the trafficsources_ list
 Returns the traffic source before the one just added
TrafficSource TrafficSource :: addTrafficSource ( TrafficSource * ts ) Add traffic source to the trafficsources_ list Returns the traffic source before the one just added
// Find last traffic source on list // if it exists then add it to the list