Name prefix table entries keep pointers instead of keeping a copy of the object for routing table entries.
refs: #2863
Change-Id: I3271c9f96dfc8721a0ca7c900542c6ddb0b321ac
diff --git a/src/route/nexthop-list.hpp b/src/route/nexthop-list.hpp
index 77bd4e7..2f7c6f4 100644
--- a/src/route/nexthop-list.hpp
+++ b/src/route/nexthop-list.hpp
@@ -60,9 +60,9 @@
/*! \brief Adds a next hop to the list.
\param nh The next hop.
- Add next hop to the Next Hop list If next hop is new it is added
- If next hop already exists in next hop list then updates the route
- cost with new next hop's route cost
+ Adds a next hop to this object. If the next hop is new it is
+ added. If the next hop already exists in the list then that next
+ hop's route cost is updated.
*/
void
addNextHop(const NextHop& nh);
@@ -72,7 +72,6 @@
The next hop gets removed only if both next hop face and route cost are same.
*/
-
void
removeNextHop(const NextHop& nh);
@@ -82,6 +81,12 @@
return m_nexthopList.size();
}
+ size_t
+ getSize() const
+ {
+ return m_nexthopList.size();
+ }
+
void
reset()
{
@@ -128,6 +133,15 @@
std::set<NextHop, NextHopComparator> m_nexthopList;
};
+bool
+operator==(NexthopList& lhs, NexthopList& rhs);
+
+bool
+operator==(const NexthopList& lhs, const NexthopList& rhs);
+
+std::ostream&
+operator<<(std::ostream& os, const NexthopList& nhl);
+
} // namespace nlsr
#endif //NLSR_NEXTHOP_LIST_HPP