| #ifndef NLSR_ADL_HPP |
| #define NLSR_ADL_HPP |
| |
| #include <ndn-cxx/common.hpp> |
| #include <list> |
| |
| #include "adjacent.hpp" |
| |
| namespace nlsr { |
| class Nlsr; |
| |
| class AdjacencyList |
| { |
| |
| public: |
| AdjacencyList(); |
| ~AdjacencyList(); |
| |
| int |
| insert(Adjacent& adj); |
| |
| int |
| updateAdjacentStatus(const std::string& adjName, int s); |
| |
| int |
| updateAdjacentLinkCost(const std::string& adjName, double lc); |
| |
| std::list<Adjacent>& |
| getAdjList(); |
| |
| bool |
| isNeighbor(const std::string& adjName); |
| |
| void |
| incrementTimedOutInterestCount(const std::string& neighbor); |
| |
| int |
| getTimedOutInterestCount(const std::string& neighbor); |
| |
| int |
| getStatusOfNeighbor(const std::string& neighbor); |
| |
| void |
| setStatusOfNeighbor(const std::string& neighbor, int status); |
| |
| void |
| setTimedOutInterestCount(const std::string& neighbor, int count); |
| |
| void |
| addAdjacentsFromAdl(AdjacencyList& adl); |
| |
| bool |
| isAdjLsaBuildable(Nlsr& pnlsr); |
| |
| int |
| getNumOfActiveNeighbor(); |
| |
| Adjacent |
| getAdjacent(const std::string& adjName); |
| |
| bool |
| isEqual(AdjacencyList& adl); |
| |
| int |
| getSize() |
| { |
| return m_adjList.size(); |
| } |
| |
| void |
| reset() |
| { |
| if (m_adjList.size() > 0) |
| { |
| m_adjList.clear(); |
| } |
| } |
| |
| void |
| print(); |
| |
| private: |
| std::list<Adjacent>::iterator |
| find(std::string adjName); |
| |
| private: |
| std::list<Adjacent> m_adjList; |
| }; |
| |
| } //namespace nlsr |
| #endif //NLSR_ADL_HPP |