21 #ifndef NLSR_ROUTE_NEXTHOP_HPP
22 #define NLSR_ROUTE_NEXTHOP_HPP
26 #include <ndn-cxx/encoding/block.hpp>
27 #include <ndn-cxx/encoding/encoding-buffer.hpp>
28 #include <ndn-cxx/encoding/tlv.hpp>
49 : m_connectingFaceUri()
51 , m_isHyperbolic(false)
55 NextHop(
const std::string& cfu,
double rc)
56 : m_connectingFaceUri(cfu)
58 , m_isHyperbolic(false)
70 return m_connectingFaceUri;
76 m_connectingFaceUri = cfu;
86 return static_cast<uint64_t
>(round(m_routeCost*HYPERBOLIC_COST_ADJUSTMENT_FACTOR));
89 return static_cast<uint64_t
>(m_routeCost);
114 return m_isHyperbolic;
117 template<ndn::encoding::Tag TAG>
119 wireEncode(ndn::EncodingImpl<TAG>& block)
const;
128 std::string m_connectingFaceUri;
132 mutable ndn::Block m_wire;
145 static constexpr uint64_t HYPERBOLIC_COST_ADJUSTMENT_FACTOR = 1000;
Data abstraction for Nexthop.
void setRouteCost(const double rc)
NextHop(const std::string &cfu, double rc)
void setConnectingFaceUri(const std::string &cfu)
const ndn::Block & wireEncode() const
void wireDecode(const ndn::Block &wire)
const std::string & getConnectingFaceUri() const
double getRouteCost() const
void setHyperbolic(bool b)
uint64_t getRouteCostAsAdjustedInteger() const
bool isHyperbolic() const
NextHop(const ndn::Block &block)
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Adjacent)
std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
bool operator==(const NamePrefixTableEntry &lhs, const NamePrefixTableEntry &rhs)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE