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