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/examples/ndn-tree-cs-tracers.cc b/examples/ndn-tree-cs-tracers.cc
index 496b9d5..eaa5bf9 100644
--- a/examples/ndn-tree-cs-tracers.cc
+++ b/examples/ndn-tree-cs-tracers.cc
@@ -24,9 +24,6 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-// for ndn::CsTracer
-#include <ns3/ndnSIM/utils/tracers/ndn-cs-tracer.h>
-
using namespace ns3;
/**
@@ -74,7 +71,7 @@
// Install CCNx stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
- ndnHelper.SetContentStore ("ns3::ndn::cs::Stats::Lru", "MaxSize", "100"); // default ContentStore parameters
+ ndnHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "100"); // default ContentStore parameters
ndnHelper.InstallAll ();
// Installing global routing interface on all nodes
@@ -111,8 +108,7 @@
Simulator::Stop (Seconds (20.0));
- boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<ndn::CsTracer> > >
- aggTracers = ndn::CsTracer::InstallAll ("cs-trace.txt", Seconds (1));
+ ndn::CsTracer::InstallAll ("cs-trace.txt", Seconds (1));
Simulator::Run ();
Simulator::Destroy ();