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