akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame^] | 1 | #ifndef NLSR_NHL_HPP |
| 2 | #define NLSR_NHL_HPP |
| 3 | |
| 4 | #include <ndn-cpp-dev/face.hpp> |
| 5 | #include "nlsr_adjacent.hpp" |
| 6 | #include <list> |
| 7 | #include <iostream> |
| 8 | |
| 9 | #include "nlsr_nexthop.hpp" |
| 10 | |
| 11 | using namespace std; |
| 12 | |
| 13 | class Nhl |
| 14 | { |
| 15 | public: |
| 16 | Nhl() |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | ~Nhl() |
| 21 | { |
| 22 | } |
| 23 | void addNextHop(NextHop &nh); |
| 24 | void removeNextHop(NextHop &nh); |
| 25 | void sortNhl(); |
| 26 | int getNhlSize() |
| 27 | { |
| 28 | return nexthopList.size(); |
| 29 | } |
| 30 | void resetNhl() |
| 31 | { |
| 32 | if (nexthopList.size() > 0 ) |
| 33 | { |
| 34 | nexthopList.clear(); |
| 35 | } |
| 36 | } |
| 37 | std::list< NextHop >& getNextHopList() |
| 38 | { |
| 39 | return nexthopList; |
| 40 | } |
| 41 | |
| 42 | private: |
| 43 | std::list< NextHop > nexthopList; |
| 44 | }; |
| 45 | |
| 46 | ostream& |
| 47 | operator<<(ostream& os, Nhl& nhl); |
| 48 | |
| 49 | #endif |