22 #ifndef NLSR_ADJACENT_HPP
23 #define NLSR_ADJACENT_HPP
28 #include <ndn-cxx/face.hpp>
29 #include <ndn-cxx/net/face-uri.hpp>
49 class Error :
public ndn::tlv::Error
52 using ndn::tlv::Error::Error;
68 Adjacent(
const ndn::Name& an,
const ndn::FaceUri& faceUri,
double lc,
69 Status s, uint32_t iton, uint64_t faceId);
100 return ceil(m_linkCost);
122 return m_interestTimedOutNo;
129 m_interestTimedOutNo = iton;
151 return !(*
this == adjacent);
160 return m_name == adjacencyName;
166 return m_faceId == faceId;
172 return m_faceUri == faceUri;
175 template<ndn::encoding::Tag TAG>
177 wireEncode(ndn::EncodingImpl<TAG>& block)
const;
193 ndn::FaceUri m_faceUri;
199 uint32_t m_interestTimedOutNo = 0;
204 mutable ndn::Block m_wire;
A neighbor reachable over a Face.
static constexpr double NON_ADJACENT_COST
static constexpr double DEFAULT_LINK_COST
uint32_t getInterestTimedOutNo() const
bool compareFaceUri(const ndn::FaceUri &faceUri) const
bool operator!=(const Adjacent &adjacent) const
const ndn::FaceUri & getFaceUri() const
void setFaceId(uint64_t faceId)
void setFaceUri(const ndn::FaceUri &faceUri)
void wireDecode(const ndn::Block &wire)
bool operator<(const Adjacent &adjacent) const
bool compare(const ndn::Name &adjacencyName) const
void setLinkCost(double lc)
bool compareFaceId(const uint64_t faceId) const
const ndn::Block & wireEncode() const
void setInterestTimedOutNo(uint32_t iton)
const ndn::Name & getName() const
bool operator==(const Adjacent &adjacent) const
Equality is when name, Face URI, and link cost are all equal.
void setName(const ndn::Name &name)
double getLinkCost() const
friend std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
uint64_t getFaceId() const
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)