src: Updating code style to conform (more or less) to ndn-cxx style
Also, adding .clang-format that describes the applied style. Note that
this style requires a slightly customized version of clang-format.
diff --git a/examples/ndn-tree-cs-tracers.cpp b/examples/ndn-tree-cs-tracers.cpp
index eaa5bf9..ce27888 100644
--- a/examples/ndn-tree-cs-tracers.cpp
+++ b/examples/ndn-tree-cs-tracers.cpp
@@ -32,21 +32,21 @@
* /------\ /------\ /------\ /------\
* |leaf-1| |leaf-2| |leaf-3| |leaf-4|
* \------/ \------/ \------/ \------/
- * ^ ^ ^ ^
+ * ^ ^ ^ ^
* | | | |
- * \ / \ /
+ * \ / \ /
* \ / \ / 10Mbps / 1ms
* \ / \ /
- * | | | |
- * v v v v
+ * | | | |
+ * v v v v
* /-------\ /-------\
* | rtr-1 | | rtr-2 |
* \-------/ \-------/
- * ^ ^
+ * ^ ^
* | |
- * \ / 10 Mpbs / 1ms
- * +--------+ +--------+
- * | |
+ * \ / 10 Mpbs / 1ms
+ * +--------+ +--------+
+ * | |
* v v
* /--------\
* | root |
@@ -59,59 +59,59 @@
*/
int
-main (int argc, char *argv[])
+main(int argc, char* argv[])
{
CommandLine cmd;
- cmd.Parse (argc, argv);
+ cmd.Parse(argc, argv);
- AnnotatedTopologyReader topologyReader ("", 1);
- topologyReader.SetFileName ("src/ndnSIM/examples/topologies/topo-tree.txt");
- topologyReader.Read ();
+ AnnotatedTopologyReader topologyReader("", 1);
+ topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree.txt");
+ topologyReader.Read();
// Install CCNx stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
- ndnHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "100"); // default ContentStore parameters
- ndnHelper.InstallAll ();
+ ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+ ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize",
+ "100"); // default ContentStore parameters
+ ndnHelper.InstallAll();
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll ();
+ ccnxGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
- Ptr<Node> consumers[4] = { Names::Find<Node> ("leaf-1"), Names::Find<Node> ("leaf-2"),
- Names::Find<Node> ("leaf-3"), Names::Find<Node> ("leaf-4") };
- Ptr<Node> producer = Names::Find<Node> ("root");
+ Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
+ Names::Find<Node>("leaf-3"), Names::Find<Node>("leaf-4")};
+ Ptr<Node> producer = Names::Find<Node>("root");
- for (int i = 0; i < 4; i++)
- {
- ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
- consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 100 interests a second
+ for (int i = 0; i < 4; i++) {
+ ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
+ consumerHelper.SetAttribute("Frequency", StringValue("10")); // 100 interests a second
- // Each consumer will express the same data /root/<seq-no>
- consumerHelper.SetPrefix ("/root");
- ApplicationContainer app = consumerHelper.Install (consumers[i]);
- app.Start (Seconds (0.01 * i));
- }
-
- ndn::AppHelper producerHelper ("ns3::ndn::Producer");
- producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
+ // Each consumer will express the same data /root/<seq-no>
+ consumerHelper.SetPrefix("/root");
+ ApplicationContainer app = consumerHelper.Install(consumers[i]);
+ app.Start(Seconds(0.01 * i));
+ }
+
+ ndn::AppHelper producerHelper("ns3::ndn::Producer");
+ producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /root prefix with global routing controller and
// install producer that will satisfy Interests in /root namespace
- ccnxGlobalRoutingHelper.AddOrigins ("/root", producer);
- producerHelper.SetPrefix ("/root");
- producerHelper.Install (producer);
+ ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+ producerHelper.SetPrefix("/root");
+ producerHelper.Install(producer);
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes ();
+ ccnxGlobalRoutingHelper.CalculateRoutes();
- Simulator::Stop (Seconds (20.0));
+ Simulator::Stop(Seconds(20.0));
- ndn::CsTracer::InstallAll ("cs-trace.txt", Seconds (1));
-
- Simulator::Run ();
- Simulator::Destroy ();
+ ndn::CsTracer::InstallAll("cs-trace.txt", Seconds(1));
+
+ Simulator::Run();
+ Simulator::Destroy();
return 0;
}