blob: fd8b4cac0ecb675e9357a4bab618350118f89b0e [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()
akmhoque05d5fcf2014-04-15 14:58:45 -050020 : m_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);
akmhoque05d5fcf2014-04-15 14:58:45 -050029 void sort();
30 int getSize()
akmhoque5a44dd42014-03-12 18:11:32 -050031 {
akmhoque05d5fcf2014-04-15 14:58:45 -050032 return m_nexthopList.size();
akmhoque5a44dd42014-03-12 18:11:32 -050033 }
akmhoque05d5fcf2014-04-15 14:58:45 -050034 void reset()
akmhoque5a44dd42014-03-12 18:11:32 -050035 {
akmhoque05d5fcf2014-04-15 14:58:45 -050036 if (m_nexthopList.size() > 0 )
akmhoque5a44dd42014-03-12 18:11:32 -050037 {
akmhoque05d5fcf2014-04-15 14:58:45 -050038 m_nexthopList.clear();
akmhoque5a44dd42014-03-12 18:11:32 -050039 }
40 }
41 std::list< NextHop >& getNextHopList()
42 {
akmhoque05d5fcf2014-04-15 14:58:45 -050043 return m_nexthopList;
akmhoque5a44dd42014-03-12 18:11:32 -050044 }
akmhoqueba094742014-02-28 11:47:21 -060045
akmhoque5a44dd42014-03-12 18:11:32 -050046 private:
akmhoque05d5fcf2014-04-15 14:58:45 -050047 std::list< NextHop > m_nexthopList;
akmhoque5a44dd42014-03-12 18:11:32 -050048 };
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