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 | |
| 8 | class nlsr; |
| 9 | |
| 10 | using namespace std; |
| 11 | |
| 12 | class Adl{ |
| 13 | |
| 14 | public: |
| 15 | Adl(); |
| 16 | ~Adl(); |
| 17 | int insert(Adjacent& adj); |
| 18 | int updateAdjacentStatus(string adjName, int s); |
| 19 | int updateAdjacentLinkCost(string adjName, double lc); |
| 20 | std::list<Adjacent>& getAdjList(); |
| 21 | bool isNeighbor(string adjName); |
| 22 | void incrementTimedOutInterestCount(string& neighbor); |
| 23 | int getTimedOutInterestCount(string& neighbor); |
| 24 | int getStatusOfNeighbor(string& neighbor); |
| 25 | void setStatusOfNeighbor(string& neighbor, int status); |
| 26 | void setTimedOutInterestCount(string& neighbor, int count); |
| 27 | void addAdjacentsFromAdl(Adl& adl); |
| 28 | |
| 29 | bool isAdjLsaBuildable(nlsr& pnlsr); |
| 30 | int getNumOfActiveNeighbor(); |
| 31 | Adjacent getAdjacent(string adjName); |
| 32 | |
| 33 | bool isAdlEqual(Adl &adl); |
| 34 | |
| 35 | int getAdlSize() |
| 36 | { |
| 37 | return adjList.size(); |
| 38 | } |
| 39 | |
| 40 | void resetAdl() |
| 41 | { |
| 42 | if( adjList.size() > 0 ) |
| 43 | { |
| 44 | adjList.clear(); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | void printAdl(); |
| 49 | |
| 50 | private: |
| 51 | std::list< Adjacent > adjList; |
| 52 | }; |
| 53 | |
| 54 | #endif |