akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 1 | #ifndef ADJACENT_HPP |
| 2 | #define ADJACENT_HPP |
| 3 | |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 4 | namespace nlsr |
| 5 | { |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 6 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 7 | using namespace std; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 8 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 9 | class Adjacent |
| 10 | { |
| 11 | |
| 12 | public: |
| 13 | Adjacent() |
| 14 | :adjacentName() |
| 15 | ,connectingFace(0) |
| 16 | ,linkCost(10.0) |
| 17 | ,status(0) |
| 18 | ,interestTimedOutNo(0) |
akmhoque | 1fd8c1e | 2014-02-19 19:41:49 -0600 | [diff] [blame] | 19 | { |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 20 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 21 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 22 | Adjacent(const string& an) |
| 23 | :connectingFace(0) |
| 24 | ,linkCost(0.0) |
| 25 | ,status(0) |
| 26 | ,interestTimedOutNo(0) |
| 27 | { |
| 28 | adjacentName=an; |
| 29 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 30 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 31 | Adjacent(const string& an, int cf, double lc, int s, int iton); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 32 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 33 | string getAdjacentName() |
| 34 | { |
| 35 | return adjacentName; |
| 36 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 37 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 38 | void setAdjacentName(const string& an) |
| 39 | { |
| 40 | adjacentName=an; |
| 41 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 42 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 43 | int getConnectingFace() |
| 44 | { |
| 45 | return connectingFace; |
| 46 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 47 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 48 | void setConnectingFace(int cf) |
| 49 | { |
| 50 | connectingFace=cf; |
| 51 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 52 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 53 | double getLinkCost() |
| 54 | { |
| 55 | return linkCost; |
| 56 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 57 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 58 | void setLinkCost(double lc) |
| 59 | { |
| 60 | linkCost=lc; |
| 61 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 62 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 63 | int getStatus() |
| 64 | { |
| 65 | return status; |
| 66 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 67 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 68 | void setStatus(int s) |
| 69 | { |
| 70 | status=s; |
| 71 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 72 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 73 | int getInterestTimedOutNo() |
| 74 | { |
| 75 | return interestTimedOutNo; |
| 76 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 77 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 78 | void setInterestTimedOutNo(int iton) |
| 79 | { |
| 80 | interestTimedOutNo=iton; |
| 81 | } |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 82 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 83 | bool isAdjacentEqual(Adjacent& adj); |
| 84 | private: |
| 85 | string adjacentName; |
| 86 | int connectingFace; |
| 87 | double linkCost; |
| 88 | int status; |
| 89 | int interestTimedOutNo; |
| 90 | }; |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 91 | |
akmhoque | 5a44dd4 | 2014-03-12 18:11:32 -0500 | [diff] [blame^] | 92 | std::ostream& |
| 93 | operator << (std::ostream &os, Adjacent &adj); |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 94 | |
akmhoque | b1710aa | 2014-02-19 17:13:36 -0600 | [diff] [blame] | 95 | } // namespace nlsr |
| 96 | |
akmhoque | 298385a | 2014-02-13 14:13:09 -0600 | [diff] [blame] | 97 | #endif |