blob: 23f334cf3120437fb142c0a77c0e82527737eecd [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
akmhoque5a44dd42014-03-12 18:11:32 -05007 using namespace std;
akmhoque298385a2014-02-13 14:13:09 -06008
akmhoque5a44dd42014-03-12 18:11:32 -05009 class Adjacent
10 {
11
12 public:
13 Adjacent()
14 :adjacentName()
15 ,connectingFace(0)
16 ,linkCost(10.0)
17 ,status(0)
18 ,interestTimedOutNo(0)
akmhoque1fd8c1e2014-02-19 19:41:49 -060019 {
akmhoque5a44dd42014-03-12 18:11:32 -050020 }
akmhoque298385a2014-02-13 14:13:09 -060021
akmhoque5a44dd42014-03-12 18:11:32 -050022 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
akmhoque5a44dd42014-03-12 18:11:32 -050031 Adjacent(const string& an, int cf, double lc, int s, int iton);
akmhoque298385a2014-02-13 14:13:09 -060032
akmhoque5a44dd42014-03-12 18:11:32 -050033 string getAdjacentName()
34 {
35 return adjacentName;
36 }
akmhoque298385a2014-02-13 14:13:09 -060037
akmhoque5a44dd42014-03-12 18:11:32 -050038 void setAdjacentName(const string& an)
39 {
40 adjacentName=an;
41 }
akmhoque298385a2014-02-13 14:13:09 -060042
akmhoque5a44dd42014-03-12 18:11:32 -050043 int getConnectingFace()
44 {
45 return connectingFace;
46 }
akmhoque298385a2014-02-13 14:13:09 -060047
akmhoque5a44dd42014-03-12 18:11:32 -050048 void setConnectingFace(int cf)
49 {
50 connectingFace=cf;
51 }
akmhoque298385a2014-02-13 14:13:09 -060052
akmhoque5a44dd42014-03-12 18:11:32 -050053 double getLinkCost()
54 {
55 return linkCost;
56 }
akmhoque298385a2014-02-13 14:13:09 -060057
akmhoque5a44dd42014-03-12 18:11:32 -050058 void setLinkCost(double lc)
59 {
60 linkCost=lc;
61 }
akmhoque298385a2014-02-13 14:13:09 -060062
akmhoque5a44dd42014-03-12 18:11:32 -050063 int getStatus()
64 {
65 return status;
66 }
akmhoque298385a2014-02-13 14:13:09 -060067
akmhoque5a44dd42014-03-12 18:11:32 -050068 void setStatus(int s)
69 {
70 status=s;
71 }
akmhoque298385a2014-02-13 14:13:09 -060072
akmhoque5a44dd42014-03-12 18:11:32 -050073 int getInterestTimedOutNo()
74 {
75 return interestTimedOutNo;
76 }
akmhoque298385a2014-02-13 14:13:09 -060077
akmhoque5a44dd42014-03-12 18:11:32 -050078 void setInterestTimedOutNo(int iton)
79 {
80 interestTimedOutNo=iton;
81 }
akmhoque298385a2014-02-13 14:13:09 -060082
akmhoque5a44dd42014-03-12 18:11:32 -050083 bool isAdjacentEqual(Adjacent& adj);
84 private:
85 string adjacentName;
86 int connectingFace;
87 double linkCost;
88 int status;
89 int interestTimedOutNo;
90 };
akmhoque298385a2014-02-13 14:13:09 -060091
akmhoque5a44dd42014-03-12 18:11:32 -050092 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