#ifndef NLSR_NEXTHOP_HPP
#define NLSR_NEXTHOP_HPP

#include<iostream>

namespace nlsr
{

  using namespace std;

  class NextHop
  {
  public:
    NextHop()
      : connectingFace(0)
      , routeCost(0)
    {
    }

    NextHop(int cf, double rc)
    {
      connectingFace=cf;
      routeCost=rc;
    }

    int getConnectingFace() const
    {
      return connectingFace;
    }

    void setConnectingFace(int cf)
    {
      connectingFace=cf;
    }

    double getRouteCost() const
    {
      return routeCost;
    }

    void setRouteCost(double rc)
    {
      routeCost=rc;
    }
  private:
    int connectingFace;
    double routeCost;
  };


  ostream&
  operator<<(ostream& os, NextHop& nh);

}//namespace nlsr

#endif
