45 std::list<Adjacent>::iterator it = find(adjacent.
getName());
46 if (it != m_adjList.end()) {
49 m_adjList.push_back(adjacent);
56 for (std::list<Adjacent>::iterator it = adl.
getAdjList().begin();
66 std::list<Adjacent>::iterator it = find(adjName);
67 if (it != m_adjList.end()) {
76 if (m_adjList.size() != adl.
getAdjList().size()) {
80 std::set<Adjacent> ourList(m_adjList.cbegin(), m_adjList.cend());
83 return ourList == theirList;
89 std::list<Adjacent>::const_iterator it = find(adjName);
90 if (it == m_adjList.end())
100 std::list<Adjacent>::iterator it = find(neighbor);
101 if (it == m_adjList.end()) {
104 (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo() + 1);
111 std::list<Adjacent>::iterator it = find(neighbor);
112 if (it != m_adjList.end()) {
113 (*it).setInterestTimedOutNo(count);
120 std::list<Adjacent>::const_iterator it = find(neighbor);
121 if (it == m_adjList.end()) {
124 return (*it).getInterestTimedOutNo();
130 std::list<Adjacent>::const_iterator it = find(neighbor);
132 if (it == m_adjList.end()) {
136 return it->getStatus();
143 std::list<Adjacent>::iterator it = find(neighbor);
144 if (it != m_adjList.end()) {
145 it->setStatus(status);
155 const std::list<Adjacent>&
164 uint32_t nTimedOutNeighbors = 0;
166 for (
const Adjacent& adjacency : m_adjList) {
171 else if (adjacency.getInterestTimedOutNo() >= interestRetryNo) {
172 nTimedOutNeighbors++;
176 if (nTimedOutNeighbors == m_adjList.size()) {
187 int32_t actNbrCount = 0;
188 for (std::list<Adjacent>::const_iterator it = m_adjList.begin(); it != m_adjList.end(); it++) {
197 std::list<Adjacent>::iterator
198 AdjacencyList::find(
const ndn::Name& adjName)
200 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
203 _1, std::cref(adjName)));
207 std::list<Adjacent>::const_iterator
208 AdjacencyList::find(
const ndn::Name& adjName)
const 210 std::list<Adjacent>::const_iterator it = std::find_if(m_adjList.cbegin(),
213 _1, std::cref(adjName)));
221 return std::find_if(m_adjList.begin(),
224 _1, std::cref(adjName)));
230 return std::find_if(m_adjList.begin(),
239 return std::find_if(m_adjList.begin(),
248 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
252 if (it != m_adjList.end()) {
253 return it->getFaceId();
263 for (std::list<Adjacent>::iterator it = m_adjList.begin();
264 it != m_adjList.end(); it++) {
void setTimedOutInterestCount(const ndn::Name &neighbor, uint32_t count)
bool operator==(const AdjacencyList &adl) const
bool isNeighbor(const ndn::Name &adjName) const
#define NLSR_LOG_DEBUG(x)
bool compare(const ndn::Name &adjacencyName) const
Adjacent::Status getStatusOfNeighbor(const ndn::Name &neighbor) const
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
bool isAdjLsaBuildable(const uint32_t interestRetryNo) const
Determines whether this list can be used to build an adj. LSA.
Adjacent getAdjacent(const ndn::Name &adjName)
#define INIT_LOGGER(name)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
bool compareFaceUri(const ndn::FaceUri &faceUri) const
const ndn::Name & getName() const
int32_t getTimedOutInterestCount(const ndn::Name &neighbor) const
int32_t insert(Adjacent &adjacent)
Inserts an adjacency into the list.
A neighbor reachable over a Face.
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
AdjacencyList::iterator findAdjacent(const ndn::Name &adjName)
int32_t getNumOfActiveNeighbor() const
bool compareFaceId(const uint64_t faceId) const
void addAdjacents(AdjacencyList &adl)
Copies the adjacencies in a list to this one.
std::list< Adjacent >::iterator iterator
void incrementTimedOutInterestCount(const ndn::Name &neighbor)
uint64_t getFaceId(const ndn::FaceUri &faceUri)
std::list< Adjacent > & getAdjList()
void setStatusOfNeighbor(const ndn::Name &neighbor, Adjacent::Status status)