blob: a8ebe7bb1dd1f9854bf79f8eca1edd11bde745f3 [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#ifndef NLSR_NHL_HPP
2#define NLSR_NHL_HPP
3
akmhoquec8a10f72014-04-25 18:42:55 -05004#include <ndn-cxx/face.hpp>
akmhoque53353462014-04-22 08:43:45 -05005#include <list>
6#include <iostream>
7
8#include "nexthop.hpp"
9#include "adjacent.hpp"
10
11namespace nlsr {
12
akmhoquec8a10f72014-04-25 18:42:55 -050013class NexthopList
akmhoque53353462014-04-22 08:43:45 -050014{
15public:
akmhoquec8a10f72014-04-25 18:42:55 -050016 NexthopList()
akmhoque53353462014-04-22 08:43:45 -050017 : m_nexthopList()
18 {
19 }
20
akmhoquec8a10f72014-04-25 18:42:55 -050021 ~NexthopList()
akmhoque53353462014-04-22 08:43:45 -050022 {
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
54private:
55 std::list<NextHop> m_nexthopList;
56};
57
58std::ostream&
akmhoquec8a10f72014-04-25 18:42:55 -050059operator<<(std::ostream& os, NexthopList& nhl);
akmhoque53353462014-04-22 08:43:45 -050060
61}//namespace nlsr
62
63#endif //NLSR_NLH_HPP