34 auto it = find(adjacent.
getName());
35 if (it != m_adjList.end()) {
38 m_adjList.push_back(adjacent);
46 auto it = find(adjName);
47 if (it != m_adjList.end()) {
57 if (m_adjList.size() != theirList.size()) {
61 std::set<Adjacent> ourSet(m_adjList.cbegin(), m_adjList.cend());
62 std::set<Adjacent> theirSet(theirList.cbegin(), theirList.cend());
63 return ourSet == theirSet;
69 return find(adjName) != m_adjList.end();
75 auto it = find(neighbor);
76 if (it != m_adjList.end()) {
77 it->setInterestTimedOutNo(it->getInterestTimedOutNo() + 1);
84 auto it = find(neighbor);
85 if (it != m_adjList.end()) {
86 it->setInterestTimedOutNo(count);
93 auto it = find(neighbor);
94 if (it == m_adjList.end()) {
97 return it->getInterestTimedOutNo();
103 auto it = find(neighbor);
104 if (it == m_adjList.end()) {
108 return it->getStatus();
115 auto it = find(neighbor);
116 if (it != m_adjList.end()) {
117 it->setStatus(status);
127 const std::list<Adjacent>&
136 uint32_t nTimedOutNeighbors = 0;
138 for (
const auto& adjacency : m_adjList) {
142 else if (adjacency.getInterestTimedOutNo() >= interestRetryNo) {
143 nTimedOutNeighbors++;
147 return nTimedOutNeighbors == m_adjList.size();
153 int32_t actNbrCount = 0;
154 for (
const auto& adjacent: m_adjList) {
162 std::list<Adjacent>::iterator
163 AdjacencyList::find(
const ndn::Name& adjName)
165 return std::find_if(m_adjList.begin(), m_adjList.end(),
169 std::list<Adjacent>::const_iterator
170 AdjacencyList::find(
const ndn::Name& adjName)
const
172 return std::find_if(m_adjList.cbegin(), m_adjList.cend(),
179 return std::find_if(m_adjList.begin(), m_adjList.end(),
186 return std::find_if(m_adjList.begin(), m_adjList.end(),
193 return std::find_if(m_adjList.begin(), m_adjList.end(),
200 auto it = std::find_if(m_adjList.begin(), m_adjList.end(),
202 return it != m_adjList.end() ? it->getFaceId() : 0;
209 for (
const auto& adjacent : m_adjList) {
int32_t getNumOfActiveNeighbor() const
int32_t getTimedOutInterestCount(const ndn::Name &neighbor) const
void incrementTimedOutInterestCount(const ndn::Name &neighbor)
void setTimedOutInterestCount(const ndn::Name &neighbor, uint32_t count)
bool operator==(const AdjacencyList &adl) const
std::list< Adjacent >::iterator iterator
uint64_t getFaceId(const ndn::FaceUri &faceUri)
bool isAdjLsaBuildable(const uint32_t interestRetryNo) const
Determines whether this list can be used to build an adj. LSA.
bool insert(const Adjacent &adjacent)
std::list< Adjacent > & getAdjList()
Adjacent::Status getStatusOfNeighbor(const ndn::Name &neighbor) const
bool isNeighbor(const ndn::Name &adjName) const
Adjacent getAdjacent(const ndn::Name &adjName) const
void setStatusOfNeighbor(const ndn::Name &neighbor, Adjacent::Status status)
AdjacencyList::iterator findAdjacent(const ndn::Name &adjName)
A neighbor reachable over a Face.
bool compareFaceUri(const ndn::FaceUri &faceUri) const
bool compare(const ndn::Name &adjacencyName) const
bool compareFaceId(const uint64_t faceId) const
const ndn::Name & getName() const
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California.
#define NLSR_LOG_DEBUG(x)
#define INIT_LOGGER(name)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.