akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 1 | #ifndef NLSR_NEXTHOP_HPP |
2 | #define NLSR_NEXTHOP_HPP | ||||
3 | |||||
4 | #include<iostream> | ||||
5 | |||||
6 | namespace nlsr | ||||
7 | { | ||||
8 | |||||
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 9 | using namespace std; |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 10 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 11 | class NextHop |
12 | { | ||||
13 | public: | ||||
14 | NextHop() | ||||
15 | : connectingFace(0) | ||||
16 | , routeCost(0) | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 17 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 18 | } |
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 19 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 20 | NextHop(int cf, double rc) |
21 | { | ||||
22 | connectingFace=cf; | ||||
23 | routeCost=rc; | ||||
24 | } | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 25 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 26 | int getConnectingFace() const |
27 | { | ||||
28 | return connectingFace; | ||||
29 | } | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 30 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 31 | void setConnectingFace(int cf) |
32 | { | ||||
33 | connectingFace=cf; | ||||
34 | } | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 35 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 36 | double getRouteCost() const |
37 | { | ||||
38 | return routeCost; | ||||
39 | } | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 40 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 41 | void setRouteCost(double rc) |
42 | { | ||||
43 | routeCost=rc; | ||||
44 | } | ||||
45 | private: | ||||
46 | int connectingFace; | ||||
47 | double routeCost; | ||||
48 | }; | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 49 | |
50 | |||||
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 51 | ostream& |
52 | operator<<(ostream& os, NextHop& nh); | ||||
akmhoque | ba09474 | 2014-02-28 11:47:21 -0600 | [diff] [blame] | 53 | |
54 | }//namespace nlsr | ||||
55 | |||||
56 | #endif |