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();
65 std::list<Adjacent>::iterator it = find(adjName);
67 if (it == m_adjList.end()) {
80 std::list<Adjacent>::iterator it = find(adjName);
81 if (it != m_adjList.end()) {
99 std::vector<const Adjacent*> ourList;
100 std::transform(m_adjList.begin(), m_adjList.end(),
101 std::back_inserter(ourList), std::pointer_traits<const Adjacent*>::pointer_to);
103 std::vector<const Adjacent*> theirList;
105 std::back_inserter(theirList), std::pointer_traits<const Adjacent*>::pointer_to);
107 std::sort(ourList.begin(), ourList.end(), std::bind(comparator, _1, _2));
108 std::sort(theirList.begin(), theirList.end(), std::bind(comparator, _1, _2));
110 for (
size_t i = 0; i < ourList.size(); i++) {
111 if (*(ourList[i]) != *(theirList[i])) {
121 std::list<Adjacent>::iterator it = find(adjName);
122 if (it == m_adjList.end()) {
125 (*it).setLinkCost(lc);
132 std::list<Adjacent>::iterator it = find(adjName);
133 if (it == m_adjList.end())
143 std::list<Adjacent>::iterator it = find(neighbor);
144 if (it == m_adjList.end()) {
147 (*it).setInterestTimedOutNo((*it).getInterestTimedOutNo() + 1);
154 std::list<Adjacent>::iterator it = find(neighbor);
155 if (it != m_adjList.end()) {
156 (*it).setInterestTimedOutNo(count);
163 std::list<Adjacent>::iterator it = find(neighbor);
164 if (it == m_adjList.end()) {
167 return (*it).getInterestTimedOutNo();
173 std::list<Adjacent>::iterator it = find(neighbor);
175 if (it == m_adjList.end()) {
179 return it->getStatus();
186 std::list<Adjacent>::iterator it = find(neighbor);
187 if (it != m_adjList.end()) {
188 it->setStatus(status);
198 const std::list<Adjacent>&
207 uint32_t nTimedOutNeighbors = 0;
209 for (
const Adjacent& adjacency : m_adjList) {
214 else if (adjacency.getInterestTimedOutNo() >= interestRetryNo) {
215 nTimedOutNeighbors++;
219 if (nTimedOutNeighbors == m_adjList.size()) {
230 int32_t actNbrCount = 0;
231 for (std::list<Adjacent>::iterator it = m_adjList.begin(); it != m_adjList.end(); it++) {
240 std::list<Adjacent>::iterator
241 AdjacencyList::find(
const ndn::Name& adjName)
243 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
246 _1, std::cref(adjName)));
253 return std::find_if(m_adjList.begin(),
256 _1, std::cref(adjName)));
262 return std::find_if(m_adjList.begin(),
271 return std::find_if(m_adjList.begin(),
280 std::list<Adjacent>::iterator it = std::find_if(m_adjList.begin(),
284 if (it != m_adjList.end()) {
285 return it->getFaceId();
295 for (std::list<Adjacent>::iterator it = m_adjList.begin();
296 it != m_adjList.end(); it++) {
void setTimedOutInterestCount(const ndn::Name &neighbor, uint32_t count)
bool updateAdjacentStatus(const ndn::Name &adjName, Adjacent::Status s)
Sets the status of an adjacency.
Adjacent::Status getStatusOfNeighbor(const ndn::Name &neighbor)
#define NLSR_LOG_DEBUG(x)
Copyright (c) 2014-2017, 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)
int32_t updateAdjacentLinkCost(const ndn::Name &adjName, double lc)
bool compare(const ndn::Name &adjacencyName)
#define INIT_LOGGER(name)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California.
const ndn::Name & getName() const
bool isNeighbor(const ndn::Name &adjName)
int32_t getNumOfActiveNeighbor()
bool compareFaceUri(const ndn::FaceUri &faceUri)
int32_t insert(Adjacent &adjacent)
Inserts an adjacency into the list.
A neighbor reachable over a Face.
int32_t getTimedOutInterestCount(const ndn::Name &neighbor)
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
AdjacencyList::iterator findAdjacent(const ndn::Name &adjName)
bool compareFaceId(const uint64_t faceId)
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()
bool operator==(AdjacencyList &adl) const
void setStatusOfNeighbor(const ndn::Name &neighbor, Adjacent::Status status)