blob: 26072180e73045e78ebf4876339b7e44b366b3a8 [file] [log] [blame]
akmhoquefdbddb12014-05-02 18:35:19 -05001#ifndef NLSR_NEXTHOP_LIST_HPP
2#define NLSR_NEXTHOP_LIST_HPP
akmhoque53353462014-04-22 08:43:45 -05003
akmhoque53353462014-04-22 08:43:45 -05004#include <list>
5#include <iostream>
akmhoquefdbddb12014-05-02 18:35:19 -05006#include <boost/cstdint.hpp>
7
8#include <ndn-cxx/face.hpp>
akmhoque53353462014-04-22 08:43:45 -05009
10#include "nexthop.hpp"
11#include "adjacent.hpp"
12
13namespace nlsr {
14
akmhoquec8a10f72014-04-25 18:42:55 -050015class NexthopList
akmhoque53353462014-04-22 08:43:45 -050016{
17public:
akmhoquec8a10f72014-04-25 18:42:55 -050018 NexthopList()
akmhoque53353462014-04-22 08:43:45 -050019 {
20 }
21
akmhoquec8a10f72014-04-25 18:42:55 -050022 ~NexthopList()
akmhoque53353462014-04-22 08:43:45 -050023 {
24 }
akmhoquefdbddb12014-05-02 18:35:19 -050025
akmhoque53353462014-04-22 08:43:45 -050026 void
27 addNextHop(NextHop& nh);
28
29 void
30 removeNextHop(NextHop& nh);
31
32 void
33 sort();
34
akmhoquefdbddb12014-05-02 18:35:19 -050035 size_t
akmhoque53353462014-04-22 08:43:45 -050036 getSize()
37 {
38 return m_nexthopList.size();
39 }
40
41 void
42 reset()
43 {
akmhoquefdbddb12014-05-02 18:35:19 -050044 m_nexthopList.clear();
akmhoque53353462014-04-22 08:43:45 -050045 }
46
47 std::list<NextHop>&
akmhoquefdbddb12014-05-02 18:35:19 -050048 getNextHops()
akmhoque53353462014-04-22 08:43:45 -050049 {
50 return m_nexthopList;
51 }
52
53private:
54 std::list<NextHop> m_nexthopList;
55};
56
57std::ostream&
akmhoquec8a10f72014-04-25 18:42:55 -050058operator<<(std::ostream& os, NexthopList& nhl);
akmhoque53353462014-04-22 08:43:45 -050059
60}//namespace nlsr
61
akmhoquefdbddb12014-05-02 18:35:19 -050062#endif //NLSR_NEXTHOP_LIST_HPP