utils/tracers: Modifying (simplifying) interface for ndnSIM tracers
Now most of the tracers internally keep created instances in a global
variable. From now on, to start tracing, one needs just install a
necessary tracer, like this:
ndn::L3RateTracer::InstallAll ("rate-trace.txt", Seconds (0.5));
Because of the change, it became possible to use the same tracers inside
python scripts.
Also, this commits contains corresponding documentation updates.
diff --git a/utils/tracers/ndn-l3-aggregate-tracer.h b/utils/tracers/ndn-l3-aggregate-tracer.h
index ca6b35a..b7d4ce7 100644
--- a/utils/tracers/ndn-l3-aggregate-tracer.h
+++ b/utils/tracers/ndn-l3-aggregate-tracer.h
@@ -43,6 +43,47 @@
{
public:
/**
+ * @brief Helper method to install tracers on all simulation nodes
+ *
+ * @param file File to which traces will be written. If filename is -, then std::out is used
+ * @param averagingPeriod How often data will be written into the trace file (default, every half second)
+ *
+ * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
+ * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
+ *
+ */
+ static void
+ InstallAll (const std::string &file, Time averagingPeriod = Seconds (0.5));
+
+ /**
+ * @brief Helper method to install tracers on the selected simulation nodes
+ *
+ * @param nodes Nodes on which to install tracer
+ * @param file File to which traces will be written. If filename is -, then std::out is used
+ * @param averagingPeriod How often data will be written into the trace file (default, every half second)
+ *
+ * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
+ * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
+ *
+ */
+ static void
+ Install (const NodeContainer &nodes, const std::string &file, Time averagingPeriod = Seconds (0.5));
+
+ /**
+ * @brief Helper method to install tracers on a specific simulation node
+ *
+ * @param nodes Nodes on which to install tracer
+ * @param file File to which traces will be written. If filename is -, then std::out is used
+ * @param averagingPeriod How often data will be written into the trace file (default, every half second)
+ *
+ * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
+ * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
+ *
+ */
+ static void
+ Install (Ptr<Node> node, const std::string &file, Time averagingPeriod = Seconds (0.5));
+
+ /**
* @brief Trace constructor that attaches to the node using node pointer
* @param os reference to the output stream
* @param node pointer to the node
@@ -62,47 +103,6 @@
virtual ~L3AggregateTracer ();
/**
- * @brief Helper method to install tracers on all simulation nodes
- *
- * @param file File to which traces will be written. If filename is -, then std::out is used
- * @param averagingPeriod How often data will be written into the trace file (default, every half second)
- *
- * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
- * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
- *
- */
- static boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer> > >
- InstallAll (const std::string &file, Time averagingPeriod = Seconds (0.5));
-
- /**
- * @brief Helper method to install tracers on the selected simulation nodes
- *
- * @param nodes Nodes on which to install tracer
- * @param file File to which traces will be written. If filename is -, then std::out is used
- * @param averagingPeriod How often data will be written into the trace file (default, every half second)
- *
- * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
- * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
- *
- */
- static boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer> > >
- Install (const NodeContainer &nodes, const std::string &file, Time averagingPeriod = Seconds (0.5));
-
- /**
- * @brief Helper method to install tracers on a specific simulation node
- *
- * @param nodes Nodes on which to install tracer
- * @param file File to which traces will be written. If filename is -, then std::out is used
- * @param averagingPeriod How often data will be written into the trace file (default, every half second)
- *
- * @returns a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved
- * for the lifetime of simulation, otherwise SEGFAULTs are inevitable
- *
- */
- static boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer> > >
- Install (Ptr<Node> node, const std::string &file, Time averagingPeriod = Seconds (0.5));
-
- /**
* @brief Helper method to install tracers on a specific simulation node
*
* @param nodes Nodes on which to install tracer