blob: b8b6695c9dcc4044e95b6918277130d6020db4cb [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#include <string>
akmhoquefdbddb12014-05-02 18:35:19 -05002#include <boost/cstdint.hpp>
akmhoque53353462014-04-22 08:43:45 -05003
akmhoquefdbddb12014-05-02 18:35:19 -05004#ifndef NLSR_ADJACENT_HPP
5#define NLSR_ADJACENT_HPP
akmhoque53353462014-04-22 08:43:45 -05006
7namespace nlsr {
8class Adjacent
9{
10
11public:
12 Adjacent()
13 : m_name("")
14 , m_connectingFace(0)
15 , m_linkCost(10.0)
16 , m_status(0)
17 , m_interestTimedOutNo(0)
18 {
19 }
20
21 Adjacent(const std::string& an)
22 : m_connectingFace(0)
23 , m_linkCost(0.0)
24 , m_status(0)
25 , m_interestTimedOutNo(0)
26 {
27 m_name = an;
28 }
29
akmhoquefdbddb12014-05-02 18:35:19 -050030 Adjacent(const std::string& an, uint32_t cf, double lc, uint32_t s, uint32_t iton);
akmhoque53353462014-04-22 08:43:45 -050031
32 std::string
akmhoquefdbddb12014-05-02 18:35:19 -050033 getName() const
akmhoque53353462014-04-22 08:43:45 -050034 {
35 return m_name;
36 }
37
38 void
39 setName(const std::string& an)
40 {
41 m_name = an;
42 }
43
akmhoquefdbddb12014-05-02 18:35:19 -050044 uint32_t
45 getConnectingFace() const
akmhoque53353462014-04-22 08:43:45 -050046 {
47 return m_connectingFace;
48 }
49
50 void
akmhoquefdbddb12014-05-02 18:35:19 -050051 setConnectingFace(uint32_t cf)
akmhoque53353462014-04-22 08:43:45 -050052 {
53 m_connectingFace = cf;
54 }
55
56 double
akmhoquefdbddb12014-05-02 18:35:19 -050057 getLinkCost() const
akmhoque53353462014-04-22 08:43:45 -050058 {
59 return m_linkCost;
60 }
61
62 void
63 setLinkCost(double lc)
64 {
65 m_linkCost = lc;
66 }
67
akmhoquefdbddb12014-05-02 18:35:19 -050068 uint32_t
69 getStatus() const
akmhoque53353462014-04-22 08:43:45 -050070 {
71 return m_status;
72 }
73
74 void
akmhoquefdbddb12014-05-02 18:35:19 -050075 setStatus(uint32_t s)
akmhoque53353462014-04-22 08:43:45 -050076 {
77 m_status = s;
78 }
79
akmhoquefdbddb12014-05-02 18:35:19 -050080 uint32_t
81 getInterestTimedOutNo() const
akmhoque53353462014-04-22 08:43:45 -050082 {
83 return m_interestTimedOutNo;
84 }
85
86 void
akmhoquefdbddb12014-05-02 18:35:19 -050087 setInterestTimedOutNo(uint32_t iton)
akmhoque53353462014-04-22 08:43:45 -050088 {
89 m_interestTimedOutNo = iton;
90 }
91
92 bool
akmhoquefdbddb12014-05-02 18:35:19 -050093 operator==(const Adjacent& adjacent) const;
akmhoque53353462014-04-22 08:43:45 -050094
akmhoquefdbddb12014-05-02 18:35:19 -050095 bool
96 compareName(const Adjacent& adjacent);
97
akmhoque53353462014-04-22 08:43:45 -050098private:
99 std::string m_name;
akmhoquefdbddb12014-05-02 18:35:19 -0500100 uint32_t m_connectingFace;
akmhoque53353462014-04-22 08:43:45 -0500101 double m_linkCost;
akmhoquefdbddb12014-05-02 18:35:19 -0500102 uint32_t m_status;
103 uint32_t m_interestTimedOutNo;
akmhoque53353462014-04-22 08:43:45 -0500104};
105
106std::ostream&
akmhoquefdbddb12014-05-02 18:35:19 -0500107operator<<(std::ostream& os, const Adjacent& adj);
akmhoque53353462014-04-22 08:43:45 -0500108
109} // namespace nlsr
110
akmhoquefdbddb12014-05-02 18:35:19 -0500111#endif //NLSR_ADJACENT_HPP