ns-allinone-2.35/olsr/OLSR_printer.cc
void
OLSR_printer::print_nb2hopset(Trace* out, nb2hopset_t& nb2hopset) {
	sprintf(out->pt_->buffer(), "P\tnb\tnb2hop\ttime");
	printf("P\tnb\tnb2hop\ttime\n");
	out->pt_->dump();
	for (nb2hopset_t::iterator it = nb2hopset.begin(); it != nb2hopset.end(); it++) {
		OLSR_nb2hop_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%f",
			OLSR::node_id(tuple->nb_main_addr()),
			OLSR::node_id(tuple->nb2hop_addr()),
			tuple->time());
		printf("P\t%d\t%d\t%f\n",
			OLSR::node_id(tuple->nb_main_addr()),
			OLSR::node_id(tuple->nb2hop_addr()),
			tuple->time());
		out->pt_->dump();
	}
}
///
/// \brief Prints a given 2-hop Neighbor Set into a given trace file.
///
/// \param out		Trace where the 2-hop Neighbor Set is going to be written.
/// \param nb2hopset	2-hop Neighbor Set to be written.
///
\brief Prints a given 2-hop Neighbor Set into a given trace file.
\param out             Trace where the 2-hop Neighbor Set is going to be written.
\param nb2hopset       2-hop Neighbor Set to be written.
\ brief Prints a given 2 - hop Neighbor Set into a given trace file . \ param out Trace where the 2 - hop Neighbor Set is going to be written . \ param nb2hopset 2 - hop Neighbor Set to be written .
void
OLSR_printer::print_nb2hopset(Trace* out, nb2hopset_t& nb2hopset) {
	sprintf(out->pt_->buffer(), "P\tnb\tnb2hop\ttime");
	printf("P\tnb\tnb2hop\ttime\n");
	out->pt_->dump();
	for (nb2hopset_t::iterator it = nb2hopset.begin(); it != nb2hopset.end(); it++) {
		OLSR_nb2hop_tuple* tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%f",
			OLSR::node_id(tuple->nb_main_addr()),
			OLSR::node_id(tuple->nb2hop_addr()),
			tuple->time());
		printf("P\t%d\t%d\t%f\n",
			OLSR::node_id(tuple->nb_main_addr()),
			OLSR::node_id(tuple->nb2hop_addr()),
			tuple->time());
		out->pt_->dump();
	}
}
void OLSR_printer :: print_nb2hopset ( Trace * out , nb2hopset_t & nb2hopset ) { sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t " ) ; printf ( " \t \t \t \n " ) ; out -> pt_ -> dump ( ) ; for ( nb2hopset_t :: iterator it = nb2hopset . begin ( ) ; it != nb2hopset . end ( ) ; it ++ ) { OLSR_nb2hop_tuple * tuple = * it ; sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t " , OLSR :: node_id ( tuple -> nb_main_addr ( ) ) , OLSR :: node_id ( tuple -> nb2hop_addr ( ) ) , tuple -> time ( ) ) ; printf ( " \t \t \t \n " , OLSR :: node_id ( tuple -> nb_main_addr ( ) ) , OLSR :: node_id ( tuple -> nb2hop_addr ( ) ) , tuple -> time ( ) ) ; out -> pt_ -> dump ( ) ; } }
\brief Prints a given 2-hop Neighbor Set into a given trace file.
\ brief Prints a given 2 - hop Neighbor Set into a given trace file .