blob: 0105fb61bd10212fa5c2e9e929328776b1b4ba1e [file] [log] [blame]
akmhoqueba094742014-02-28 11:47:21 -06001#ifndef NLSR_NEXTHOP_HPP
2#define NLSR_NEXTHOP_HPP
3
4#include<iostream>
5
6namespace nlsr
7{
8
akmhoque5a44dd42014-03-12 18:11:32 -05009 using namespace std;
akmhoqueba094742014-02-28 11:47:21 -060010
akmhoque5a44dd42014-03-12 18:11:32 -050011 class NextHop
12 {
13 public:
14 NextHop()
akmhoque05d5fcf2014-04-15 14:58:45 -050015 : m_connectingFace(0)
16 , m_routeCost(0)
akmhoqueba094742014-02-28 11:47:21 -060017 {
akmhoque5a44dd42014-03-12 18:11:32 -050018 }
akmhoqueba094742014-02-28 11:47:21 -060019
akmhoque5a44dd42014-03-12 18:11:32 -050020 NextHop(int cf, double rc)
21 {
akmhoque05d5fcf2014-04-15 14:58:45 -050022 m_connectingFace=cf;
23 m_routeCost=rc;
akmhoque5a44dd42014-03-12 18:11:32 -050024 }
akmhoqueba094742014-02-28 11:47:21 -060025
akmhoque5a44dd42014-03-12 18:11:32 -050026 int getConnectingFace() const
27 {
akmhoque05d5fcf2014-04-15 14:58:45 -050028 return m_connectingFace;
akmhoque5a44dd42014-03-12 18:11:32 -050029 }
akmhoqueba094742014-02-28 11:47:21 -060030
akmhoque5a44dd42014-03-12 18:11:32 -050031 void setConnectingFace(int cf)
32 {
akmhoque05d5fcf2014-04-15 14:58:45 -050033 m_connectingFace=cf;
akmhoque5a44dd42014-03-12 18:11:32 -050034 }
akmhoqueba094742014-02-28 11:47:21 -060035
akmhoque5a44dd42014-03-12 18:11:32 -050036 double getRouteCost() const
37 {
akmhoque05d5fcf2014-04-15 14:58:45 -050038 return m_routeCost;
akmhoque5a44dd42014-03-12 18:11:32 -050039 }
akmhoqueba094742014-02-28 11:47:21 -060040
akmhoque5a44dd42014-03-12 18:11:32 -050041 void setRouteCost(double rc)
42 {
akmhoque05d5fcf2014-04-15 14:58:45 -050043 m_routeCost=rc;
akmhoque5a44dd42014-03-12 18:11:32 -050044 }
45 private:
akmhoque05d5fcf2014-04-15 14:58:45 -050046 int m_connectingFace;
47 double m_routeCost;
akmhoque5a44dd42014-03-12 18:11:32 -050048 };
akmhoqueba094742014-02-28 11:47:21 -060049
50
akmhoque5a44dd42014-03-12 18:11:32 -050051 ostream&
52 operator<<(ostream& os, NextHop& nh);
akmhoqueba094742014-02-28 11:47:21 -060053
54}//namespace nlsr
55
56#endif