akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 1 | #ifndef NLSR_NHL_HPP |
2 | #define NLSR_NHL_HPP | ||||
3 | |||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 4 | #include <ndn-cxx/face.hpp> |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 5 | #include <list> |
6 | #include <iostream> | ||||
7 | |||||
8 | #include "nexthop.hpp" | ||||
9 | #include "adjacent.hpp" | ||||
10 | |||||
11 | namespace nlsr { | ||||
12 | |||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 13 | class NexthopList |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 14 | { |
15 | public: | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 16 | NexthopList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 17 | : m_nexthopList() |
18 | { | ||||
19 | } | ||||
20 | |||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 21 | ~NexthopList() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 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& | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 59 | operator<<(std::ostream& os, NexthopList& nhl); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 60 | |
61 | }//namespace nlsr | ||||
62 | |||||
63 | #endif //NLSR_NLH_HPP |