#ifndef NLSR_NHL_HPP
#define NLSR_NHL_HPP

#include <ndn-cpp-dev/face.hpp>
#include "nlsr_adjacent.hpp"
#include <list>
#include <iostream>

#include "nlsr_nexthop.hpp"

namespace nlsr
{

  using namespace std;

  class Nhl
  {
  public:
    Nhl()
      : nexthopList()
    {
    }

    ~Nhl()
    {
    }
    void addNextHop(NextHop &nh);
    void removeNextHop(NextHop &nh);
    void sortNhl();
    int getNhlSize()
    {
      return nexthopList.size();
    }
    void resetNhl()
    {
      if (nexthopList.size() > 0 )
      {
        nexthopList.clear();
      }
    }
    std::list< NextHop >& getNextHopList()
    {
      return nexthopList;
    }

  private:
    std::list< NextHop > nexthopList;
  };

  ostream&
  operator<<(ostream& os, Nhl& nhl);

}//namespace nlsr

#endif
