akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 1 | #include <string> |
| 2 | |
| 3 | #ifndef ADJACENT_HPP |
| 4 | #define ADJACENT_HPP |
| 5 | |
| 6 | namespace nlsr { |
| 7 | class Adjacent |
| 8 | { |
| 9 | |
| 10 | public: |
| 11 | Adjacent() |
| 12 | : m_name("") |
| 13 | , m_connectingFace(0) |
| 14 | , m_linkCost(10.0) |
| 15 | , m_status(0) |
| 16 | , m_interestTimedOutNo(0) |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | Adjacent(const std::string& an) |
| 21 | : m_connectingFace(0) |
| 22 | , m_linkCost(0.0) |
| 23 | , m_status(0) |
| 24 | , m_interestTimedOutNo(0) |
| 25 | { |
| 26 | m_name = an; |
| 27 | } |
| 28 | |
| 29 | Adjacent(const std::string& an, int cf, double lc, int s, int iton); |
| 30 | |
| 31 | std::string |
| 32 | getName() |
| 33 | { |
| 34 | return m_name; |
| 35 | } |
| 36 | |
| 37 | void |
| 38 | setName(const std::string& an) |
| 39 | { |
| 40 | m_name = an; |
| 41 | } |
| 42 | |
| 43 | int |
| 44 | getConnectingFace() |
| 45 | { |
| 46 | return m_connectingFace; |
| 47 | } |
| 48 | |
| 49 | void |
| 50 | setConnectingFace(int cf) |
| 51 | { |
| 52 | m_connectingFace = cf; |
| 53 | } |
| 54 | |
| 55 | double |
| 56 | getLinkCost() |
| 57 | { |
| 58 | return m_linkCost; |
| 59 | } |
| 60 | |
| 61 | void |
| 62 | setLinkCost(double lc) |
| 63 | { |
| 64 | m_linkCost = lc; |
| 65 | } |
| 66 | |
| 67 | int |
| 68 | getStatus() |
| 69 | { |
| 70 | return m_status; |
| 71 | } |
| 72 | |
| 73 | void |
| 74 | setStatus(int s) |
| 75 | { |
| 76 | m_status = s; |
| 77 | } |
| 78 | |
| 79 | int |
| 80 | getInterestTimedOutNo() |
| 81 | { |
| 82 | return m_interestTimedOutNo; |
| 83 | } |
| 84 | |
| 85 | void |
| 86 | setInterestTimedOutNo(int iton) |
| 87 | { |
| 88 | m_interestTimedOutNo = iton; |
| 89 | } |
| 90 | |
| 91 | bool |
| 92 | isEqual(Adjacent& adj); |
| 93 | |
| 94 | private: |
| 95 | std::string m_name; |
| 96 | int m_connectingFace; |
| 97 | double m_linkCost; |
| 98 | int m_status; |
| 99 | int m_interestTimedOutNo; |
| 100 | }; |
| 101 | |
| 102 | std::ostream& |
| 103 | operator<<(std::ostream& os, Adjacent& adj); |
| 104 | |
| 105 | } // namespace nlsr |
| 106 | |
| 107 | #endif //ADJACENT_HPP |