blob: f9a789a6d82c3454680e9b5a544d3dff2709d724 [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()
akmhoque05d5fcf2014-04-15 14:58:45 -050014 :m_name()
15 ,m_connectingFace(0)
16 ,m_linkCost(10.0)
17 ,m_status(0)
18 ,m_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)
akmhoque05d5fcf2014-04-15 14:58:45 -050023 :m_connectingFace(0)
24 ,m_linkCost(0.0)
25 ,m_status(0)
26 ,m_interestTimedOutNo(0)
akmhoque5a44dd42014-03-12 18:11:32 -050027 {
akmhoque05d5fcf2014-04-15 14:58:45 -050028 m_name=an;
akmhoque5a44dd42014-03-12 18:11:32 -050029 }
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
akmhoque05d5fcf2014-04-15 14:58:45 -050033 string getName()
akmhoque5a44dd42014-03-12 18:11:32 -050034 {
akmhoque05d5fcf2014-04-15 14:58:45 -050035 return m_name;
akmhoque5a44dd42014-03-12 18:11:32 -050036 }
akmhoque298385a2014-02-13 14:13:09 -060037
akmhoque05d5fcf2014-04-15 14:58:45 -050038 void setName(const string& an)
akmhoque5a44dd42014-03-12 18:11:32 -050039 {
akmhoque05d5fcf2014-04-15 14:58:45 -050040 m_name=an;
akmhoque5a44dd42014-03-12 18:11:32 -050041 }
akmhoque298385a2014-02-13 14:13:09 -060042
akmhoque5a44dd42014-03-12 18:11:32 -050043 int getConnectingFace()
44 {
akmhoque05d5fcf2014-04-15 14:58:45 -050045 return m_connectingFace;
akmhoque5a44dd42014-03-12 18:11:32 -050046 }
akmhoque298385a2014-02-13 14:13:09 -060047
akmhoque5a44dd42014-03-12 18:11:32 -050048 void setConnectingFace(int cf)
49 {
akmhoque05d5fcf2014-04-15 14:58:45 -050050 m_connectingFace=cf;
akmhoque5a44dd42014-03-12 18:11:32 -050051 }
akmhoque298385a2014-02-13 14:13:09 -060052
akmhoque5a44dd42014-03-12 18:11:32 -050053 double getLinkCost()
54 {
akmhoque05d5fcf2014-04-15 14:58:45 -050055 return m_linkCost;
akmhoque5a44dd42014-03-12 18:11:32 -050056 }
akmhoque298385a2014-02-13 14:13:09 -060057
akmhoque5a44dd42014-03-12 18:11:32 -050058 void setLinkCost(double lc)
59 {
akmhoque05d5fcf2014-04-15 14:58:45 -050060 m_linkCost=lc;
akmhoque5a44dd42014-03-12 18:11:32 -050061 }
akmhoque298385a2014-02-13 14:13:09 -060062
akmhoque5a44dd42014-03-12 18:11:32 -050063 int getStatus()
64 {
akmhoque05d5fcf2014-04-15 14:58:45 -050065 return m_status;
akmhoque5a44dd42014-03-12 18:11:32 -050066 }
akmhoque298385a2014-02-13 14:13:09 -060067
akmhoque5a44dd42014-03-12 18:11:32 -050068 void setStatus(int s)
69 {
akmhoque05d5fcf2014-04-15 14:58:45 -050070 m_status=s;
akmhoque5a44dd42014-03-12 18:11:32 -050071 }
akmhoque298385a2014-02-13 14:13:09 -060072
akmhoque5a44dd42014-03-12 18:11:32 -050073 int getInterestTimedOutNo()
74 {
akmhoque05d5fcf2014-04-15 14:58:45 -050075 return m_interestTimedOutNo;
akmhoque5a44dd42014-03-12 18:11:32 -050076 }
akmhoque298385a2014-02-13 14:13:09 -060077
akmhoque5a44dd42014-03-12 18:11:32 -050078 void setInterestTimedOutNo(int iton)
79 {
akmhoque05d5fcf2014-04-15 14:58:45 -050080 m_interestTimedOutNo=iton;
akmhoque5a44dd42014-03-12 18:11:32 -050081 }
akmhoque298385a2014-02-13 14:13:09 -060082
akmhoque05d5fcf2014-04-15 14:58:45 -050083 bool isEqual(Adjacent& adj);
akmhoque5a44dd42014-03-12 18:11:32 -050084 private:
akmhoque05d5fcf2014-04-15 14:58:45 -050085 string m_name;
86 int m_connectingFace;
87 double m_linkCost;
88 int m_status;
89 int m_interestTimedOutNo;
akmhoque5a44dd42014-03-12 18:11:32 -050090 };
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