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()) {
77 if (m_adjList.size() != theirList.size()) {
81 std::set<Adjacent> ourSet(m_adjList.cbegin(), m_adjList.cend());
82 std::set<Adjacent> theirSet(theirList.cbegin(), theirList.cend());
84 return ourSet == theirSet;
90 std::list<Adjacent>::const_iterator it = find(adjName);
91 if (it == m_adjList.end())
101 std::list<Adjacent>::iterator it = find(neighbor);
102 if (it == m_adjList.end()) {
105 (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo() + 1);
112 std::list<Adjacent>::iterator it = find(neighbor);
113 if (it != m_adjList.end()) {
114 (*it).setInterestTimedOutNo(count);
121 std::list<Adjacent>::const_iterator it = find(neighbor);
122 if (it == m_adjList.end()) {
125 return (*it).getInterestTimedOutNo();
131 std::list<Adjacent>::const_iterator it = find(neighbor);
133 if (it == m_adjList.end()) {
137 return it->getStatus();
144 std::list<Adjacent>::iterator it = find(neighbor);
145 if (it != m_adjList.end()) {
146 it->setStatus(status);
156 const std::list<Adjacent>&
165 uint32_t nTimedOutNeighbors = 0;
167 for (
const Adjacent& adjacency : m_adjList) {
172 else if (adjacency.getInterestTimedOutNo() >= interestRetryNo) {
173 nTimedOutNeighbors++;
177 if (nTimedOutNeighbors == m_adjList.size()) {
188 int32_t actNbrCount = 0;
189 for (std::list<Adjacent>::const_iterator it = m_adjList.begin(); it != m_adjList.end(); it++) {
198 std::list<Adjacent>::iterator
199 AdjacencyList::find(
const ndn::Name& adjName)
201 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
204 _1, std::cref(adjName)));
208 std::list<Adjacent>::const_iterator
209 AdjacencyList::find(
const ndn::Name& adjName)
const 211 std::list<Adjacent>::const_iterator it = std::find_if(m_adjList.cbegin(),
214 _1, std::cref(adjName)));
222 return std::find_if(m_adjList.begin(),
225 _1, std::cref(adjName)));
231 return std::find_if(m_adjList.begin(),
240 return std::find_if(m_adjList.begin(),
249 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
253 if (it != m_adjList.end()) {
254 return it->getFaceId();
264 for (std::list<Adjacent>::iterator it = m_adjList.begin();
265 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-2018, 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)