blob: 73ee4730461105c3a2f9aa57d88213f9133b99ac [file] [log] [blame]
akmhoque53353462014-04-22 08:43:45 -05001#ifndef NLSR_NEXTHOP_HPP
2#define NLSR_NEXTHOP_HPP
3
4#include <iostream>
akmhoquefdbddb12014-05-02 18:35:19 -05005#include <boost/cstdint.hpp>
akmhoque53353462014-04-22 08:43:45 -05006
7namespace nlsr {
8class NextHop
9{
10public:
11 NextHop()
akmhoque157b0a42014-05-13 00:26:37 -050012 : m_connectingFaceUri()
akmhoque53353462014-04-22 08:43:45 -050013 , m_routeCost(0)
14 {
15 }
16
akmhoque157b0a42014-05-13 00:26:37 -050017 NextHop(const std::string& cfu, double rc)
akmhoque53353462014-04-22 08:43:45 -050018 {
akmhoque157b0a42014-05-13 00:26:37 -050019 m_connectingFaceUri = cfu;
akmhoque53353462014-04-22 08:43:45 -050020 m_routeCost = rc;
21 }
22
akmhoque157b0a42014-05-13 00:26:37 -050023 const std::string&
24 getConnectingFaceUri() const
akmhoque53353462014-04-22 08:43:45 -050025 {
akmhoque157b0a42014-05-13 00:26:37 -050026 return m_connectingFaceUri;
akmhoque53353462014-04-22 08:43:45 -050027 }
28
29 void
akmhoque157b0a42014-05-13 00:26:37 -050030 setConnectingFaceUri(const std::string& cfu)
akmhoque53353462014-04-22 08:43:45 -050031 {
akmhoque157b0a42014-05-13 00:26:37 -050032 m_connectingFaceUri = cfu;
akmhoque53353462014-04-22 08:43:45 -050033 }
34
35 double
36 getRouteCost() const
37 {
38 return m_routeCost;
39 }
40
41 void
42 setRouteCost(double rc)
43 {
44 m_routeCost = rc;
45 }
46
47private:
akmhoque157b0a42014-05-13 00:26:37 -050048 std::string m_connectingFaceUri;
akmhoque53353462014-04-22 08:43:45 -050049 double m_routeCost;
50};
51
52
akmhoque157b0a42014-05-13 00:26:37 -050053inline std::ostream&
54operator<<(std::ostream& os, const NextHop& nh)
55{
56 os << "Face: " << nh.getConnectingFaceUri() << " Route Cost: " <<
57 nh.getRouteCost();
58 return os;
59}
akmhoque53353462014-04-22 08:43:45 -050060
61}//namespace nlsr
62
63#endif //NLSR_NEXTHOP_HPP