nlsr: removed references to ndn-cxx/common aliases and improved namespacing
Change-Id: I65e4691305b0157f334fc68d96998c119ef8b03b
refs: #3406
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
index ccbb887..91eb422 100644
--- a/src/route/fib-entry.cpp
+++ b/src/route/fib-entry.cpp
@@ -25,8 +25,6 @@
INIT_LOGGER("FibEntry");
-using namespace std;
-
void
FibEntry::writeLog()
{
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index de73310..592b2bd 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -35,9 +35,6 @@
const uint64_t Fib::GRACE_PERIOD = 10;
-using namespace std;
-using namespace ndn;
-
void
Fib::remove(const ndn::Name& name)
{
diff --git a/src/route/map.cpp b/src/route/map.cpp
index 544976e..5596a05 100644
--- a/src/route/map.cpp
+++ b/src/route/map.cpp
@@ -23,7 +23,6 @@
#include "adjacent.hpp"
#include "lsa.hpp"
#include "lsdb.hpp"
-
#include "logger.hpp"
#include <iostream>
@@ -33,8 +32,6 @@
INIT_LOGGER("Map");
-using namespace std;
-
static bool
mapEntryCompareByRouter(MapEntry& mpe1, const ndn::Name& rtrName)
{
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index c2e5fa6..97a89b0 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -18,9 +18,8 @@
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
**/
-
-#include "common.hpp"
#include "nexthop-list.hpp"
+#include "common.hpp"
#include "nexthop.hpp"
#include "logger.hpp"
@@ -28,8 +27,6 @@
INIT_LOGGER("NexthopList");
-using namespace std;
-
static bool
nexthopAddCompare(const NextHop& nh1, const NextHop& nh2)
{
diff --git a/src/route/routing-table-calculator.cpp b/src/route/routing-table-calculator.cpp
index 7aa6f48..f4442f5 100644
--- a/src/route/routing-table-calculator.cpp
+++ b/src/route/routing-table-calculator.cpp
@@ -18,23 +18,21 @@
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
**/
-
-#include <iostream>
-#include <cmath>
-#include "lsdb.hpp"
#include "routing-table-calculator.hpp"
+#include "lsdb.hpp"
#include "map.hpp"
#include "lsa.hpp"
#include "nexthop.hpp"
#include "nlsr.hpp"
#include "logger.hpp"
+#include <iostream>
#include <boost/math/constants/constants.hpp>
+#include <cmath>
namespace nlsr {
INIT_LOGGER("RoutingTableCalculator");
-using namespace std;
void
RoutingTableCalculator::allocateAdjMatrix()
@@ -120,7 +118,7 @@
RoutingTableCalculator::writeAdjMatrixLog()
{
for (size_t i = 0; i < m_nRouters; i++) {
- string line="";
+ std::string line="";
for (size_t j = 0; j < m_nRouters; j++) {
line += boost::lexical_cast<std::string>(adjMatrix[i][j]);
line += " ";
@@ -252,7 +250,7 @@
int v, u;
int* Q = new int[m_nRouters]; // Each cell represents the router with that mapping no.
int head = 0;
- // Initiate the Parent
+ // Initiate the parent
for (i = 0 ; i < static_cast<int>(m_nRouters); i++) {
m_parent[i] = EMPTY_PARENT;
// Array where the ith element is the distance to the router with mapping no i.
diff --git a/src/route/routing-table.cpp b/src/route/routing-table.cpp
index 708e3dd..238852a 100644
--- a/src/route/routing-table.cpp
+++ b/src/route/routing-table.cpp
@@ -17,7 +17,6 @@
* You should have received a copy of the GNU General Public License along with
* NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
**/
-
#include "routing-table.hpp"
#include "nlsr.hpp"
#include "map.hpp"
@@ -28,15 +27,13 @@
#include "logger.hpp"
#include <iostream>
-#include <string>
#include <list>
+#include <string>
namespace nlsr {
INIT_LOGGER("RoutingTable");
-using namespace std;
-
void
RoutingTable::calculate(Nlsr& pnlsr)
{