akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame^] | 1 | #ifndef NLSR_NHL_HPP |
| 2 | #define NLSR_NHL_HPP |
| 3 | |
| 4 | #include <ndn-cpp-dev/face.hpp> |
| 5 | #include <list> |
| 6 | #include <iostream> |
| 7 | |
| 8 | #include "nexthop.hpp" |
| 9 | #include "adjacent.hpp" |
| 10 | |
| 11 | namespace nlsr { |
| 12 | |
| 13 | class Nhl |
| 14 | { |
| 15 | public: |
| 16 | Nhl() |
| 17 | : m_nexthopList() |
| 18 | { |
| 19 | } |
| 20 | |
| 21 | ~Nhl() |
| 22 | { |
| 23 | } |
| 24 | void |
| 25 | addNextHop(NextHop& nh); |
| 26 | |
| 27 | void |
| 28 | removeNextHop(NextHop& nh); |
| 29 | |
| 30 | void |
| 31 | sort(); |
| 32 | |
| 33 | int |
| 34 | getSize() |
| 35 | { |
| 36 | return m_nexthopList.size(); |
| 37 | } |
| 38 | |
| 39 | void |
| 40 | reset() |
| 41 | { |
| 42 | if (m_nexthopList.size() > 0) |
| 43 | { |
| 44 | m_nexthopList.clear(); |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | std::list<NextHop>& |
| 49 | getNextHopList() |
| 50 | { |
| 51 | return m_nexthopList; |
| 52 | } |
| 53 | |
| 54 | private: |
| 55 | std::list<NextHop> m_nexthopList; |
| 56 | }; |
| 57 | |
| 58 | std::ostream& |
| 59 | operator<<(std::ostream& os, Nhl& nhl); |
| 60 | |
| 61 | }//namespace nlsr |
| 62 | |
| 63 | #endif //NLSR_NLH_HPP |