ns-allinone-2.35/pushback/logging-data-struct.cc
int 
LoggingDataStruct::consolidateStatus() {

  double rate = 0;
  int all = 1;
  LoggingDataStructNode * node = first_;
  while (node != NULL) {
    if (!node->gotStatus_) {
      if (node->statusArrivalRate_<0) {
	//condition 1 above.
	printf("LGDS: Error: This should never happen now\n");
	exit(-1);
	//return -1;
      }
      else {
	all = 0;
      }
    }
    rate += node->statusArrivalRate_;
    node = node->next_;
  }

  gotStatusAll_ = all;
  statusArrivalRateAll_=rate;

  return all;
}
//return -1 if not received status from a neighbor even once.
//return 0 if not received status from a neighbor in this round.
//return 1 o/w.  
1 if not received status from a neighbor even once.
return 0 if not received status from a neighbor in this round.
return 1 o/w.
1 if not received status from a neighbor even once . return 0 if not received status from a neighbor in this round . return 1 o / w .
int 
LoggingDataStruct::consolidateStatus() {
  double rate = 0;
  int all = 1;
  LoggingDataStructNode * node = first_;
  while (node != NULL) {
    if (!node->gotStatus_) {
      if (node->statusArrivalRate_<0) {
	printf("LGDS: Error: This should never happen now\n");
	exit(-1);
      }
      else {
	all = 0;
      }
    }
    rate += node->statusArrivalRate_;
    node = node->next_;
  }
  gotStatusAll_ = all;
  statusArrivalRateAll_=rate;
  return all;
}
int LoggingDataStruct :: consolidateStatus ( ) { double rate = 0 ; int all = 1 ; LoggingDataStructNode * node = first_ ; while ( node != NULL ) { if ( ! node -> gotStatus_ ) { if ( node -> statusArrivalRate_ < 0 ) { printf ( " \n " ) ; exit ( -1 ) ; } else { all = 0 ; } } rate += node -> statusArrivalRate_ ; node = node -> next_ ; } gotStatusAll_ = all ; statusArrivalRateAll_ = rate ; return all ; }
return -1 if not received status from a neighbor even once.
return - 1 if not received status from a neighbor even once .
//condition 1 above. //return -1;