34 auto it = find(adjacent.
getName());
35 if (it != m_adjList.end()) {
38 m_adjList.push_back(adjacent);
46 std::list<Adjacent>::iterator 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());
64 return ourSet == theirSet;
70 std::list<Adjacent>::const_iterator it = find(adjName);
71 if (it == m_adjList.end())
81 std::list<Adjacent>::iterator it = find(neighbor);
82 if (it == m_adjList.end()) {
85 (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo() + 1);
92 std::list<Adjacent>::iterator it = find(neighbor);
93 if (it != m_adjList.end()) {
94 (*it).setInterestTimedOutNo(count);
101 std::list<Adjacent>::const_iterator it = find(neighbor);
102 if (it == m_adjList.end()) {
105 return (*it).getInterestTimedOutNo();
111 std::list<Adjacent>::const_iterator it = find(neighbor);
113 if (it == m_adjList.end()) {
117 return it->getStatus();
124 std::list<Adjacent>::iterator it = find(neighbor);
125 if (it != m_adjList.end()) {
126 it->setStatus(status);
136 const std::list<Adjacent>&
145 uint32_t nTimedOutNeighbors = 0;
147 for (
const Adjacent& adjacency : m_adjList) {
152 else if (adjacency.getInterestTimedOutNo() >= interestRetryNo) {
153 nTimedOutNeighbors++;
157 if (nTimedOutNeighbors == m_adjList.size()) {
168 int32_t actNbrCount = 0;
169 for (
const auto& adjacent: m_adjList) {
177 std::list<Adjacent>::iterator
178 AdjacencyList::find(
const ndn::Name& adjName)
180 return std::find_if(m_adjList.begin(),
185 std::list<Adjacent>::const_iterator
186 AdjacencyList::find(
const ndn::Name& adjName)
const
188 return std::find_if(m_adjList.cbegin(),
196 return std::find_if(m_adjList.begin(),
199 _1, std::cref(adjName)));
205 return std::find_if(m_adjList.begin(),
214 return std::find_if(m_adjList.begin(),
223 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
228 return it != m_adjList.end() ? it->getFaceId() : 0;
235 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
Adjacent getAdjacent(const ndn::Name &adjName)
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
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.