21 #ifndef NLSR_NEXTHOP_LIST_HPP
22 #define NLSR_NEXTHOP_LIST_HPP
27 #include <ndn-cxx/face.hpp>
28 #include <ndn-cxx/util/ostream-joiner.hpp>
69 template<
typename T = NextHopComparator>
85 auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
87 if (it == m_nexthopList.end()) {
88 m_nexthopList.insert(nh);
92 m_nexthopList.insert(nh);
104 auto it = std::find_if(m_nexthopList.begin(), m_nexthopList.end(),
106 if (it != m_nexthopList.end()) {
107 m_nexthopList.erase(it);
114 return m_nexthopList.size();
120 m_nexthopList.clear();
123 const std::set<NextHop, T>&
126 return m_nexthopList;
130 typedef typename std::set<NextHop, T>::iterator
iterator;
137 return m_nexthopList.begin();
143 return m_nexthopList.end();
149 return m_nexthopList.begin();
155 return m_nexthopList.end();
161 return m_nexthopList.rbegin();
167 return m_nexthopList.rend();
171 std::set<NextHop, T> m_nexthopList;
187 return !(lhs == rhs);
195 std::copy(nhl.
cbegin(), nhl.
cend(), ndn::make_ostream_joiner(os,
"\n "));
Data abstraction for Nexthop.
const std::string & getConnectingFaceUri() const
double getRouteCost() const
uint64_t getRouteCostAsAdjustedInteger() const
std::set< NextHop, T >::iterator iterator
reverse_iterator rbegin() const
void removeNextHop(const NextHop &nh)
Remove a next hop from the Next Hop list.
const_iterator cend() const
const_iterator cbegin() const
void addNextHop(const NextHop &nh)
Adds a next hop to the list.
reverse_iterator rend() const
const std::set< NextHop, T > & getNextHops() const
std::set< NextHop, T >::const_iterator const_iterator
std::set< NextHop, T >::reverse_iterator reverse_iterator
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
static bool nexthopAddCompare(const NextHop &nh1, const NextHop &nh2)
static bool nexthopRemoveCompare(const NextHop &nh1, const NextHop &nh2)
bool operator!=(const NexthopListT< T > &lhs, const NexthopListT< T > &rhs)
std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
bool operator==(const NamePrefixTableEntry &lhs, const NamePrefixTableEntry &rhs)
bool operator()(const NextHop &nh1, const NextHop &nh2) const
bool operator()(const NextHop &nh1, const NextHop &nh2) const