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 | |||||
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 53 | void |
54 | writeLog(); | ||||
55 | |||||
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 56 | private: |
57 | std::list<NextHop> m_nexthopList; | ||||
58 | }; | ||||
59 | |||||
60 | std::ostream& | ||||
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 61 | operator<<(std::ostream& os, NexthopList& nhl); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 62 | |
63 | }//namespace nlsr | ||||
64 | |||||
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 65 | #endif //NLSR_NEXTHOP_LIST_HPP |