blob: 8d97db61b68b2199d44001804a7600c0fba8e718 [file] [log] [blame]
akmhoque298385a2014-02-13 14:13:09 -06001#ifndef ADJACENT_HPP
2#define ADJACENT_HPP
3
akmhoque1fd8c1e2014-02-19 19:41:49 -06004namespace nlsr
5{
akmhoqueb1710aa2014-02-19 17:13:36 -06006
akmhoque1fd8c1e2014-02-19 19:41:49 -06007 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -06008
akmhoque1fd8c1e2014-02-19 19:41:49 -06009 class Adjacent
10 {
akmhoque298385a2014-02-13 14:13:09 -060011
akmhoque1fd8c1e2014-02-19 19:41:49 -060012 public:
13 Adjacent()
14 :adjacentName()
15 ,connectingFace(0)
16 ,linkCost(10.0)
17 ,status(0)
18 ,interestTimedOutNo(0)
19 {
20 }
akmhoque298385a2014-02-13 14:13:09 -060021
akmhoque1fd8c1e2014-02-19 19:41:49 -060022 Adjacent(const string& an)
23 :connectingFace(0)
24 ,linkCost(0.0)
25 ,status(0)
26 ,interestTimedOutNo(0)
27 {
28 adjacentName=an;
29 }
akmhoque298385a2014-02-13 14:13:09 -060030
akmhoque1fd8c1e2014-02-19 19:41:49 -060031 Adjacent(const string& an, int cf, double lc, int s, int iton);
akmhoque298385a2014-02-13 14:13:09 -060032
akmhoque1fd8c1e2014-02-19 19:41:49 -060033 string getAdjacentName()
34 {
35 return adjacentName;
36 }
akmhoque298385a2014-02-13 14:13:09 -060037
akmhoque1fd8c1e2014-02-19 19:41:49 -060038 void setAdjacentName(const string& an)
39 {
40 adjacentName=an;
41 }
akmhoque298385a2014-02-13 14:13:09 -060042
akmhoque1fd8c1e2014-02-19 19:41:49 -060043 int getConnectingFace()
44 {
45 return connectingFace;
46 }
akmhoque298385a2014-02-13 14:13:09 -060047
akmhoque1fd8c1e2014-02-19 19:41:49 -060048 void setConnectingFace(int cf)
49 {
50 connectingFace=cf;
51 }
akmhoque298385a2014-02-13 14:13:09 -060052
akmhoque1fd8c1e2014-02-19 19:41:49 -060053 double getLinkCost()
54 {
55 return linkCost;
56 }
akmhoque298385a2014-02-13 14:13:09 -060057
akmhoque1fd8c1e2014-02-19 19:41:49 -060058 void setLinkCost(double lc)
59 {
60 linkCost=lc;
61 }
akmhoque298385a2014-02-13 14:13:09 -060062
akmhoque1fd8c1e2014-02-19 19:41:49 -060063 int getStatus()
64 {
65 return status;
66 }
akmhoque298385a2014-02-13 14:13:09 -060067
akmhoque1fd8c1e2014-02-19 19:41:49 -060068 void setStatus(int s)
69 {
70 status=s;
71 }
akmhoque298385a2014-02-13 14:13:09 -060072
akmhoque1fd8c1e2014-02-19 19:41:49 -060073 int getInterestTimedOutNo()
74 {
75 return interestTimedOutNo;
76 }
akmhoque298385a2014-02-13 14:13:09 -060077
akmhoque1fd8c1e2014-02-19 19:41:49 -060078 void setInterestTimedOutNo(int iton)
79 {
80 interestTimedOutNo=iton;
81 }
akmhoque298385a2014-02-13 14:13:09 -060082
akmhoque1fd8c1e2014-02-19 19:41:49 -060083 bool isAdjacentEqual(Adjacent& adj);
84 private:
85 string adjacentName;
86 int connectingFace;
87 double linkCost;
88 int status;
89 int interestTimedOutNo;
90 };
91
92 std::ostream&
93 operator << (std::ostream &os, Adjacent &adj);
akmhoque298385a2014-02-13 14:13:09 -060094
akmhoqueb1710aa2014-02-19 17:13:36 -060095} // namespace nlsr
96
akmhoque298385a2014-02-13 14:13:09 -060097#endif