ns-allinone-2.35/olsr/OLSR_printer.cc
void
OLSR_printer::print_topologyset(Trace* out, topologyset_t& topologyset) {
	sprintf(out->pt_->buffer(), "P\tdest\tlast\tseq\ttime");
	printf("P\tdest\tlast\tseq\ttime\n");
	out->pt_->dump();
	for (topologyset_t::iterator it = topologyset.begin(); it != topologyset.end(); it++) {
		OLSR_topology_tuple* topology_tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d\t%f",
			OLSR::node_id(topology_tuple->dest_addr()),
			OLSR::node_id(topology_tuple->last_addr()),
			topology_tuple->seq(),
			topology_tuple->time());
		printf("P\t%d\t%d\t%d\t%f\n",
			OLSR::node_id(topology_tuple->dest_addr()),
			OLSR::node_id(topology_tuple->last_addr()),
			topology_tuple->seq(),
			topology_tuple->time());
		out->pt_->dump();
	}
}
///
/// \brief Prints a given Topology Set into a given trace file.
///
/// \param out		Trace where the Topology Set is going to be written.
/// \param topologyset	Topology Set to be written.
///
\brief Prints a given Topology Set into a given trace file.
\param out             Trace where the Topology Set is going to be written.
\param topologyset     Topology Set to be written.
\ brief Prints a given Topology Set into a given trace file . \ param out Trace where the Topology Set is going to be written . \ param topologyset Topology Set to be written .
void
OLSR_printer::print_topologyset(Trace* out, topologyset_t& topologyset) {
	sprintf(out->pt_->buffer(), "P\tdest\tlast\tseq\ttime");
	printf("P\tdest\tlast\tseq\ttime\n");
	out->pt_->dump();
	for (topologyset_t::iterator it = topologyset.begin(); it != topologyset.end(); it++) {
		OLSR_topology_tuple* topology_tuple = *it;
		sprintf(out->pt_->buffer(), "P\t%d\t%d\t%d\t%f",
			OLSR::node_id(topology_tuple->dest_addr()),
			OLSR::node_id(topology_tuple->last_addr()),
			topology_tuple->seq(),
			topology_tuple->time());
		printf("P\t%d\t%d\t%d\t%f\n",
			OLSR::node_id(topology_tuple->dest_addr()),
			OLSR::node_id(topology_tuple->last_addr()),
			topology_tuple->seq(),
			topology_tuple->time());
		out->pt_->dump();
	}
}
void OLSR_printer :: print_topologyset ( Trace * out , topologyset_t & topologyset ) { sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t " ) ; printf ( " \t \t \t \t \n " ) ; out -> pt_ -> dump ( ) ; for ( topologyset_t :: iterator it = topologyset . begin ( ) ; it != topologyset . end ( ) ; it ++ ) { OLSR_topology_tuple * topology_tuple = * it ; sprintf ( out -> pt_ -> buffer ( ) , " \t \t \t \t " , OLSR :: node_id ( topology_tuple -> dest_addr ( ) ) , OLSR :: node_id ( topology_tuple -> last_addr ( ) ) , topology_tuple -> seq ( ) , topology_tuple -> time ( ) ) ; printf ( " \t \t \t \t \n " , OLSR :: node_id ( topology_tuple -> dest_addr ( ) ) , OLSR :: node_id ( topology_tuple -> last_addr ( ) ) , topology_tuple -> seq ( ) , topology_tuple -> time ( ) ) ; out -> pt_ -> dump ( ) ; } }
\brief Prints a given Topology Set into a given trace file.
\ brief Prints a given Topology Set into a given trace file .