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-app-delay-tracer.cc b/examples/ndn-tree-app-delay-tracer.cc
index 0fdffd9..b4563a9 100644
--- a/examples/ndn-tree-app-delay-tracer.cc
+++ b/examples/ndn-tree-app-delay-tracer.cc
@@ -24,9 +24,6 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-// for ndn::AppDelayTracer
-#include <ns3/ndnSIM/utils/tracers/ndn-app-delay-tracer.h>
-
using namespace ns3;
/**
@@ -111,8 +108,7 @@
Simulator::Stop (Seconds (20.0));
- boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<ndn::AppDelayTracer> > >
- tracers = ndn::AppDelayTracer::InstallAll ("app-delays-trace.txt");
+ ndn::AppDelayTracer::InstallAll ("app-delays-trace.txt");
Simulator::Run ();
Simulator::Destroy ();
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 ();
diff --git a/examples/ndn-tree-tracers.cc b/examples/ndn-tree-tracers.cc
index b76869a..aeb65f9 100644
--- a/examples/ndn-tree-tracers.cc
+++ b/examples/ndn-tree-tracers.cc
@@ -24,12 +24,6 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-// for ndn::L3AggregateTracer
-#include <ns3/ndnSIM/utils/tracers/ndn-l3-aggregate-tracer.h>
-
-// for ndn::L3RateTracer
-#include <ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.h>
-
using namespace ns3;
/**
@@ -112,11 +106,8 @@
Simulator::Stop (Seconds (20.0));
- boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<ndn::L3AggregateTracer> > >
- aggTracers = ndn::L3AggregateTracer::InstallAll ("aggregate-trace.txt", Seconds (0.5));
-
- boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<ndn::L3RateTracer> > >
- rateTracers = ndn::L3RateTracer::InstallAll ("rate-trace.txt", Seconds (0.5));
+ ndn::L3AggregateTracer::InstallAll ("aggregate-trace.txt", Seconds (0.5));
+ ndn::L3RateTracer::InstallAll ("rate-trace.txt", Seconds (0.5));
Simulator::Run ();
Simulator::Destroy ();
diff --git a/examples/ndn-tree-with-l2tracer.cc b/examples/ndn-tree-with-l2tracer.cc
index d3e262e..19ba3a2 100644
--- a/examples/ndn-tree-with-l2tracer.cc
+++ b/examples/ndn-tree-with-l2tracer.cc
@@ -4,9 +4,6 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-// for ndn::L2RateTracer
-#include <ns3/ndnSIM/utils/tracers/l2-rate-tracer.h>
-
using namespace ns3;
int
@@ -135,8 +132,7 @@
/****************************************************************************/
//Tracer:
- boost::tuple< boost::shared_ptr<std::ostream>, std::list<Ptr<L2RateTracer> > >
- l2tracers = L2RateTracer::InstallAll ("drop-trace.txt", Seconds (0.5));
+ L2RateTracer::InstallAll ("drop-trace.txt", Seconds (0.5));
Simulator::Run ();
Simulator::Destroy ();