style: made container APIs more consistent.

Change-Id: Ib4feedfc4c9fb497dfcd67e7e6a33ee03db58d7f
refs: #4337
diff --git a/src/adjacency-list.cpp b/src/adjacency-list.cpp
index eead545..4ceaa82 100644
--- a/src/adjacency-list.cpp
+++ b/src/adjacency-list.cpp
@@ -87,7 +87,7 @@
 bool
 AdjacencyList::operator==(AdjacencyList& adl) const
 {
-  if (m_adjList.size() != adl.getSize()) {
+  if (size() != adl.size()) {
     return false;
   }
 
diff --git a/src/adjacency-list.hpp b/src/adjacency-list.hpp
index 5ed5012..6b8ea64 100644
--- a/src/adjacency-list.hpp
+++ b/src/adjacency-list.hpp
@@ -129,7 +129,7 @@
   operator==(AdjacencyList& adl) const;
 
   size_t
-  getSize()
+  size() const
   {
     return m_adjList.size();
   }
diff --git a/src/lsa.cpp b/src/lsa.cpp
index 440c2ba..ec27a35 100644
--- a/src/lsa.cpp
+++ b/src/lsa.cpp
@@ -68,7 +68,7 @@
 {
   std::ostringstream os;
   os << m_origRouter << "|" << NameLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
-     << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_npl.getSize();
+     << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_npl.size();
   for (const auto& name : m_npl.getNames()) {
     os << "|" << name;
   }
@@ -269,7 +269,7 @@
 {
   std::ostringstream os;
   os << m_origRouter << "|" << AdjLsa::TYPE_STRING << "|" << m_lsSeqNo << "|"
-     << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_adl.getSize();
+     << ndn::time::toIsoString(m_expirationTimePoint) << "|" << m_adl.size();
   for (const auto& adjacent : m_adl.getAdjList()) {
     os << "|" << adjacent.getName() << "|" << adjacent.getFaceUri()
        << "|" << adjacent.getLinkCost();
diff --git a/src/name-prefix-list.hpp b/src/name-prefix-list.hpp
index 5ec94ef..8351b3b 100644
--- a/src/name-prefix-list.hpp
+++ b/src/name-prefix-list.hpp
@@ -60,7 +60,7 @@
   sort();
 
   size_t
-  getSize()
+  size() const
   {
     return m_names.size();
   }
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 7e19100..752b15a 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -96,7 +96,7 @@
   std::map<ndn::Name, FibEntry>::iterator entryIt = m_table.find(name);
 
   // New FIB entry that has nextHops
-  if (entryIt == m_table.end() && hopsToAdd.getSize() != 0) {
+  if (entryIt == m_table.end() && hopsToAdd.size() != 0) {
     _LOG_DEBUG("New FIB Entry");
 
     FibEntry entry(name);
@@ -113,7 +113,7 @@
     _LOG_DEBUG("Existing FIB Entry");
 
     // Remove empty FIB entry
-    if (hopsToAdd.getSize() == 0) {
+    if (hopsToAdd.size() == 0) {
       remove(name);
       return;
     }
diff --git a/src/route/name-prefix-table.cpp b/src/route/name-prefix-table.cpp
index 4f9d91d..52271ef 100644
--- a/src/route/name-prefix-table.cpp
+++ b/src/route/name-prefix-table.cpp
@@ -106,7 +106,7 @@
     npte->generateNhlfromRteList();
     m_table.push_back(npte);
     // If this entry has next hops, we need to inform the FIB
-    if (npte->getNexthopList().getSize() > 0) {
+    if (npte->getNexthopList().size() > 0) {
       _LOG_TRACE("Updating FIB with next hops for " << npte);
       m_nlsr.getFib().update(name, npte->getNexthopList());
     }
@@ -128,7 +128,7 @@
     (*nameItr)->addRoutingTableEntry(rtpePtr);
     (*nameItr)->generateNhlfromRteList();
 
-    if ((*nameItr)->getNexthopList().getSize() > 0) {
+    if ((*nameItr)->getNexthopList().size() > 0) {
       _LOG_TRACE("Updating FIB with next hops for " << (*nameItr));
       m_nlsr.getFib().update(name, (*nameItr)->getNexthopList());
     }
diff --git a/src/route/nexthop-list.cpp b/src/route/nexthop-list.cpp
index 903ca48..65f6782 100644
--- a/src/route/nexthop-list.cpp
+++ b/src/route/nexthop-list.cpp
@@ -44,7 +44,7 @@
 bool
 operator==(const NexthopList& lhs, const NexthopList& rhs)
 {
-  if (lhs.getSize() != rhs.getSize()) {
+  if (lhs.size() != rhs.size()) {
     return false;
   }
 
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index 1c35079..9ba0772 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -76,13 +76,7 @@
   removeNextHop(const NextHop& nh);
 
   size_t
-  getSize()
-  {
-    return m_nexthopList.size();
-  }
-
-  size_t
-  getSize() const
+  size() const
   {
     return m_nexthopList.size();
   }
diff --git a/tests/test-adjacency-list.cpp b/tests/test-adjacency-list.cpp
index 465fd9a..1488daa 100644
--- a/tests/test-adjacency-list.cpp
+++ b/tests/test-adjacency-list.cpp
@@ -19,9 +19,8 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "common.hpp"
-
 #include "adjacency-list.hpp"
+#include "common.hpp"
 #include "adjacent.hpp"
 #include "conf-parameter.hpp"
 
@@ -50,7 +49,7 @@
   adjacentList1.insert(adjacent1);
   adjacentList2.insert(adjacent2);
 
-  BOOST_CHECK_EQUAL(adjacentList1.getSize(), (uint32_t)1);
+  BOOST_CHECK_EQUAL(adjacentList1.size(), (uint32_t)1);
   BOOST_CHECK_EQUAL(adjacentList1 == adjacentList2, false);
 
   BOOST_CHECK(adjacentList1.isNeighbor("testname"));
diff --git a/tests/test-conf-file-processor.cpp b/tests/test-conf-file-processor.cpp
index df347f1..abcaefb 100644
--- a/tests/test-conf-file-processor.cpp
+++ b/tests/test-conf-file-processor.cpp
@@ -19,17 +19,15 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
+#include "conf-file-processor.hpp"
 #include "test-common.hpp"
 #include "logger.hpp"
-
-#include <fstream>
-#include "conf-file-processor.hpp"
 #include "nlsr.hpp"
 
+#include <fstream>
 #include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace nlsr {
@@ -271,7 +269,7 @@
   BOOST_CHECK_EQUAL(conf.getRoutingCalcInterval(), 9);
 
   // Advertising
-  BOOST_CHECK_EQUAL(nlsr.getNamePrefixList().getSize(), 2);
+  BOOST_CHECK_EQUAL(nlsr.getNamePrefixList().size(), 2);
 }
 
 BOOST_AUTO_TEST_CASE(Log4cxxFileExists)
diff --git a/tests/test-lsa.cpp b/tests/test-lsa.cpp
index e501c59..2750bb4 100644
--- a/tests/test-lsa.cpp
+++ b/tests/test-lsa.cpp
@@ -19,14 +19,12 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "test-common.hpp"
-
-#include "adjacent.hpp"
 #include "lsa.hpp"
+#include "test-common.hpp"
+#include "adjacent.hpp"
 #include "name-prefix-list.hpp"
 
 #include <ndn-cxx/util/time.hpp>
-
 #include <sstream>
 
 namespace nlsr {
@@ -70,8 +68,8 @@
   activeAdjacencies.insert(activeAdjacency);
 
   AdjLsa alsa1(routerName, seqNo, testTimePoint,
-               activeAdjacencies.getSize(), activeAdjacencies);
-  BOOST_CHECK_EQUAL(alsa1.getAdl().getSize(), 1);
+               activeAdjacencies.size(), activeAdjacencies);
+  BOOST_CHECK_EQUAL(alsa1.getAdl().size(), 1);
   BOOST_CHECK_EQUAL(alsa1.getLsType(), AdjLsa::TYPE_STRING);
   BOOST_CHECK_EQUAL(alsa1.getLsSeqNo(), seqNo);
   BOOST_CHECK_EQUAL(alsa1.getExpirationTimePoint(), testTimePoint);
@@ -85,15 +83,15 @@
   inactiveAdjacencies.insert(inactiveAdjacency);
 
   AdjLsa alsa2(routerName, seqNo, testTimePoint,
-               inactiveAdjacencies.getSize(), inactiveAdjacencies);
-  BOOST_CHECK_EQUAL(alsa2.getAdl().getSize(), 0);
+               inactiveAdjacencies.size(), inactiveAdjacencies);
+  BOOST_CHECK_EQUAL(alsa2.getAdl().size(), 0);
 
   // Thus, the two LSAs should not have equal content
   BOOST_CHECK_EQUAL(alsa1.isEqualContent(alsa2), false);
 
   // Create a duplicate of alsa1 which should have equal content
   AdjLsa alsa3(routerName, seqNo, testTimePoint,
-               activeAdjacencies.getSize(), activeAdjacencies);
+               activeAdjacencies.size(), activeAdjacencies);
   BOOST_CHECK(alsa1.isEqualContent(alsa3));
 }
 
@@ -132,7 +130,7 @@
 
   const std::string TEST_TIME_POINT_STRING = ss.str();
 
-  AdjLsa lsa("router1", 12, testTimePoint, adjList.getSize(), adjList);
+  AdjLsa lsa("router1", 12, testTimePoint, adjList.size(), adjList);
 
   std::string EXPECTED_OUTPUT =
    "Adj Lsa:\n"
@@ -178,7 +176,7 @@
 
   ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
 
-  AdjLsa adjlsa1("router1", 1, testTimePoint, adjList.getSize(), adjList);
+  AdjLsa adjlsa1("router1", 1, testTimePoint, adjList.size(), adjList);
   AdjLsa adjlsa2;
 
   BOOST_CHECK(adjlsa2.initializeFromContent(adjlsa1.getData()));
diff --git a/tests/test-name-prefix-list.cpp b/tests/test-name-prefix-list.cpp
index eef0c18..080b259 100644
--- a/tests/test-name-prefix-list.cpp
+++ b/tests/test-name-prefix-list.cpp
@@ -39,11 +39,11 @@
   npl1.insert(a);
   npl1.insert(b);
 
-  BOOST_CHECK_EQUAL(npl1.getSize(), 2);
+  BOOST_CHECK_EQUAL(npl1.size(), 2);
 
   npl1.remove(b);
 
-  BOOST_CHECK_EQUAL(npl1.getSize(), 1);
+  BOOST_CHECK_EQUAL(npl1.size(), 1);
 }
 
 /*
diff --git a/tests/test-name-prefix-table.cpp b/tests/test-name-prefix-table.cpp
index 197cd98..474585c 100644
--- a/tests/test-name-prefix-table.cpp
+++ b/tests/test-name-prefix-table.cpp
@@ -298,7 +298,7 @@
   auto iterator = namePrefixTable.m_rtpool.find(destination);
   BOOST_REQUIRE(iterator != namePrefixTable.m_rtpool.end());
   auto nextHops = (iterator->second)->getNexthopList();
-  BOOST_CHECK_EQUAL(nextHops.getSize(), 2);
+  BOOST_CHECK_EQUAL(nextHops.size(), 2);
 
   // Add the other NextHop
   routingTable.addNextHop(destination, hop3);
@@ -313,7 +313,7 @@
   iterator = namePrefixTable.m_rtpool.find(destination);
   BOOST_REQUIRE(iterator != namePrefixTable.m_rtpool.end());
   nextHops = (iterator->second)->getNexthopList();
-  BOOST_CHECK_EQUAL(nextHops.getSize(), 3);
+  BOOST_CHECK_EQUAL(nextHops.size(), 3);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/test-nexthop-list.cpp b/tests/test-nexthop-list.cpp
index ce042c7..7d0c16d 100644
--- a/tests/test-nexthop-list.cpp
+++ b/tests/test-nexthop-list.cpp
@@ -36,10 +36,10 @@
   NexthopList nhl1;
 
   nhl1.addNextHop(np1);
-  BOOST_CHECK_EQUAL(nhl1.getSize(), (uint32_t)1);
+  BOOST_CHECK_EQUAL(nhl1.size(), (uint32_t)1);
 
   nhl1.removeNextHop(np1);
-  BOOST_CHECK_EQUAL(nhl1.getSize(), (uint32_t)0);
+  BOOST_CHECK_EQUAL(nhl1.size(), (uint32_t)0);
 }
 
 BOOST_AUTO_TEST_CASE(LinkStateRemoveNextHop)
@@ -53,13 +53,13 @@
   NextHop hop2;
   hop2.setRouteCost(13.01);
 
-  BOOST_REQUIRE_EQUAL(hopList.getSize(), 1);
+  BOOST_REQUIRE_EQUAL(hopList.size(), 1);
 
   hopList.removeNextHop(hop2);
-  BOOST_CHECK_EQUAL(hopList.getSize(), 1);
+  BOOST_CHECK_EQUAL(hopList.size(), 1);
 
   hopList.removeNextHop(hop1);
-  BOOST_CHECK_EQUAL(hopList.getSize(), 0);
+  BOOST_CHECK_EQUAL(hopList.size(), 0);
 }
 
 BOOST_AUTO_TEST_CASE(HyperbolicRemoveNextHop)
@@ -75,13 +75,13 @@
   hop2.setHyperbolic(true);
   hop2.setRouteCost(12.35);
 
-  BOOST_REQUIRE_EQUAL(hopList.getSize(), 1);
+  BOOST_REQUIRE_EQUAL(hopList.size(), 1);
 
   hopList.removeNextHop(hop2);
-  BOOST_CHECK_EQUAL(hopList.getSize(), 1);
+  BOOST_CHECK_EQUAL(hopList.size(), 1);
 
   hopList.removeNextHop(hop1);
-  BOOST_CHECK_EQUAL(hopList.getSize(), 0);
+  BOOST_CHECK_EQUAL(hopList.size(), 0);
 }
 
 BOOST_AUTO_TEST_CASE(TieBreaker)
@@ -139,7 +139,7 @@
   list.addNextHop(hopB);
   list.addNextHop(hopC);
 
-  BOOST_REQUIRE_EQUAL(list.getSize(), 3);
+  BOOST_REQUIRE_EQUAL(list.size(), 3);
 
   double lastCost = 0;
   for (const auto& hop : list) {
@@ -150,7 +150,7 @@
   // removing a hop keep the list sorted
   list.removeNextHop(hopA);
 
-  BOOST_REQUIRE_EQUAL(list.getSize(), 2);
+  BOOST_REQUIRE_EQUAL(list.size(), 2);
 
   lastCost = 0;
   for (const auto& hop : list) {
@@ -174,7 +174,7 @@
   list.addNextHop(hopA);
   list.addNextHop(hopB);
 
-  BOOST_REQUIRE_EQUAL(list.getSize(), 1);
+  BOOST_REQUIRE_EQUAL(list.size(), 1);
 
   for (const auto& hop : list) {
     BOOST_CHECK_EQUAL(hop, hopB);
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index 0159cf4..48cd7bf 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -283,7 +283,7 @@
   // Make sure the routing table was calculated
   RoutingTableEntry* rtEntry = nlsr.getRoutingTable().findRoutingTableEntry(failNeighbor.getName());
   BOOST_REQUIRE(rtEntry != nullptr);
-  BOOST_REQUIRE_EQUAL(rtEntry->getNexthopList().getSize(), 1);
+  BOOST_REQUIRE_EQUAL(rtEntry->getNexthopList().size(), 1);
 
   // Receive FaceEventDestroyed notification
   ndn::nfd::FaceEventNotification event;
@@ -394,7 +394,7 @@
   // Adjacency LSA should be built even though other router is INACTIVE
   AdjLsa* lsa = lsdb.findAdjLsa(lsaKey);
   BOOST_REQUIRE(lsa != nullptr);
-  BOOST_CHECK_EQUAL(lsa->getAdl().getSize(), 1);
+  BOOST_CHECK_EQUAL(lsa->getAdl().size(), 1);
 
   // Receive HELLO response from Router B
   receiveHelloData(neighborBName, conf.getRouterPrefix());
@@ -420,7 +420,7 @@
   // Adjacency LSA should be built
   lsa = lsdb.findAdjLsa(lsaKey);
   BOOST_REQUIRE(lsa != nullptr);
-  BOOST_CHECK_EQUAL(lsa->getAdl().getSize(), 2);
+  BOOST_CHECK_EQUAL(lsa->getAdl().size(), 2);
 }
 
 BOOST_AUTO_TEST_CASE(CanonizeUris)
diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp
index 42d9fa0..8fb4c27 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -252,7 +252,7 @@
 
   NamePrefixList& namePrefixList = nlsr.getNamePrefixList();
 
-  BOOST_REQUIRE_EQUAL(namePrefixList.getSize(), 1);
+  BOOST_REQUIRE_EQUAL(namePrefixList.size(), 1);
   BOOST_CHECK_EQUAL(namePrefixList.getNames().front(), parameters.getName());
 
   BOOST_CHECK(wasRoutingUpdatePublished());
@@ -271,7 +271,7 @@
   face.receive(*withdrawInterest);
   this->advanceClocks(ndn::time::milliseconds(10));
 
-  BOOST_CHECK_EQUAL(namePrefixList.getSize(), 0);
+  BOOST_CHECK_EQUAL(namePrefixList.size(), 0);
 
   BOOST_CHECK(wasRoutingUpdatePublished());
   BOOST_CHECK(nameLsaSeqNoBeforeInterest < nlsr.getLsdb().getSequencingManager().getNameLsaSeq());