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-csma.cpp b/examples/ndn-csma.cpp
index cafddd5..71d1cfb 100644
--- a/examples/ndn-csma.cpp
+++ b/examples/ndn-csma.cpp
@@ -48,51 +48,51 @@
* NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-csma
*/
-int
-main (int argc, char *argv[])
+int
+main(int argc, char* argv[])
{
// setting default parameters for PointToPoint links and channels
- Config::SetDefault ("ns3::CsmaChannel::DataRate", StringValue ("1Mbps"));
- Config::SetDefault ("ns3::CsmaChannel::Delay", StringValue ("10ms"));
- Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+ Config::SetDefault("ns3::CsmaChannel::DataRate", StringValue("1Mbps"));
+ Config::SetDefault("ns3::CsmaChannel::Delay", StringValue("10ms"));
+ Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
// Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
CommandLine cmd;
- cmd.Parse (argc, argv);
+ cmd.Parse(argc, argv);
// Creating nodes
NodeContainer nodes;
- nodes.Create (3);
+ nodes.Create(3);
// Connecting nodes using two links
CsmaHelper csma;
- csma.Install (nodes);
+ csma.Install(nodes);
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetDefaultRoutes (true);
- ndnHelper.InstallAll ();
+ ndnHelper.SetDefaultRoutes(true);
+ ndnHelper.InstallAll();
// Installing applications
// Consumer
- ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
+ ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
// Consumer will request /prefix/0, /prefix/1, ...
- consumerHelper.SetPrefix ("/prefix");
- consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
- consumerHelper.Install (nodes.Get (0)); // first node
+ consumerHelper.SetPrefix("/prefix");
+ consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
+ consumerHelper.Install(nodes.Get(0)); // first node
// Producer
- ndn::AppHelper producerHelper ("ns3::ndn::Producer");
+ ndn::AppHelper producerHelper("ns3::ndn::Producer");
// Producer will reply to all requests starting with /prefix
- producerHelper.SetPrefix ("/prefix");
- producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
- producerHelper.Install (nodes.Get (2)); // last node
+ producerHelper.SetPrefix("/prefix");
+ producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
+ producerHelper.Install(nodes.Get(2)); // last node
- Simulator::Stop (Seconds (20.0));
+ Simulator::Stop(Seconds(20.0));
- Simulator::Run ();
- Simulator::Destroy ();
+ Simulator::Run();
+ Simulator::Destroy();
return 0;
}