akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 1 | #ifndef NLSR_ADL_HPP |
| 2 | #define NLSR_ADL_HPP |
| 3 | |
| 4 | #include <ndn-cpp-dev/face.hpp> |
| 5 | #include "nlsr_adjacent.hpp" |
| 6 | #include<list> |
| 7 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame^] | 8 | namespace nlsr { |
| 9 | |
akmhoque | 1a48109 | 2014-02-19 16:34:22 -0600 | [diff] [blame] | 10 | class Nlsr; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 11 | |
| 12 | using namespace std; |
| 13 | |
| 14 | class Adl{ |
| 15 | |
| 16 | public: |
| 17 | Adl(); |
| 18 | ~Adl(); |
| 19 | int insert(Adjacent& adj); |
| 20 | int updateAdjacentStatus(string adjName, int s); |
| 21 | int updateAdjacentLinkCost(string adjName, double lc); |
| 22 | std::list<Adjacent>& getAdjList(); |
| 23 | bool isNeighbor(string adjName); |
| 24 | void incrementTimedOutInterestCount(string& neighbor); |
| 25 | int getTimedOutInterestCount(string& neighbor); |
| 26 | int getStatusOfNeighbor(string& neighbor); |
| 27 | void setStatusOfNeighbor(string& neighbor, int status); |
| 28 | void setTimedOutInterestCount(string& neighbor, int count); |
| 29 | void addAdjacentsFromAdl(Adl& adl); |
| 30 | |
akmhoque | 1a48109 | 2014-02-19 16:34:22 -0600 | [diff] [blame] | 31 | bool isAdjLsaBuildable(Nlsr& pnlsr); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 32 | int getNumOfActiveNeighbor(); |
| 33 | Adjacent getAdjacent(string adjName); |
| 34 | |
| 35 | bool isAdlEqual(Adl &adl); |
| 36 | |
| 37 | int getAdlSize() |
| 38 | { |
| 39 | return adjList.size(); |
| 40 | } |
| 41 | |
| 42 | void resetAdl() |
| 43 | { |
| 44 | if( adjList.size() > 0 ) |
| 45 | { |
| 46 | adjList.clear(); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | void printAdl(); |
| 51 | |
| 52 | private: |
| 53 | std::list< Adjacent > adjList; |
| 54 | }; |
| 55 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame^] | 56 | } //namespace nlsr |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 57 | #endif |