blob: f82d37ee52e79d510bea037ed54c6411fec6e95d [file] [log] [blame]
akmhoqueba094742014-02-28 11:47:21 -06001#ifndef NLSR_NHL_HPP
2#define NLSR_NHL_HPP
3
4#include <ndn-cpp-dev/face.hpp>
5#include "nlsr_adjacent.hpp"
6#include <list>
7#include <iostream>
8
9#include "nlsr_nexthop.hpp"
10
11namespace nlsr
12{
13
akmhoque5a44dd42014-03-12 18:11:32 -050014 using namespace std;
akmhoqueba094742014-02-28 11:47:21 -060015
akmhoque5a44dd42014-03-12 18:11:32 -050016 class Nhl
17 {
18 public:
19 Nhl()
20 : nexthopList()
akmhoqueba094742014-02-28 11:47:21 -060021 {
akmhoque5a44dd42014-03-12 18:11:32 -050022 }
akmhoqueba094742014-02-28 11:47:21 -060023
akmhoque5a44dd42014-03-12 18:11:32 -050024 ~Nhl()
25 {
26 }
27 void addNextHop(NextHop &nh);
28 void removeNextHop(NextHop &nh);
29 void sortNhl();
30 int getNhlSize()
31 {
32 return nexthopList.size();
33 }
34 void resetNhl()
35 {
36 if (nexthopList.size() > 0 )
37 {
38 nexthopList.clear();
39 }
40 }
41 std::list< NextHop >& getNextHopList()
42 {
43 return nexthopList;
44 }
akmhoqueba094742014-02-28 11:47:21 -060045
akmhoque5a44dd42014-03-12 18:11:32 -050046 private:
47 std::list< NextHop > nexthopList;
48 };
akmhoqueba094742014-02-28 11:47:21 -060049
akmhoque5a44dd42014-03-12 18:11:32 -050050 ostream&
51 operator<<(ostream& os, Nhl& nhl);
akmhoqueba094742014-02-28 11:47:21 -060052
53}//namespace nlsr
54
55#endif