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();
}