nlsr::Adjacent Class Reference

A neighbor reachable over a Face. More...

#include <adjacent.hpp>

+ Collaboration diagram for nlsr::Adjacent:

Classes

class  Error
 

Public Types

enum  Status {
  STATUS_UNKNOWN = -1 ,
  STATUS_INACTIVE = 0 ,
  STATUS_ACTIVE = 1
}
 

Public Member Functions

 Adjacent ()
 
 Adjacent (const ndn::Block &block)
 
 Adjacent (const ndn::Name &an)
 
 Adjacent (const ndn::Name &an, const ndn::FaceUri &faceUri, double lc, Status s, uint32_t iton, uint64_t faceId)
 
bool compare (const ndn::Name &adjacencyName) const
 
bool compareFaceId (const uint64_t faceId) const
 
bool compareFaceUri (const ndn::FaceUri &faceUri) const
 
uint64_t getFaceId () const
 
const ndn::FaceUri & getFaceUri () const
 
uint32_t getInterestTimedOutNo () const
 
double getLinkCost () const
 
const ndn::Name & getName () const
 
Status getStatus () const
 
bool operator!= (const Adjacent &adjacent) const
 
bool operator< (const Adjacent &adjacent) const
 
bool operator== (const Adjacent &adjacent) const
 Equality is when name, Face URI, and link cost are all equal. More...
 
void setFaceId (uint64_t faceId)
 
void setFaceUri (const ndn::FaceUri &faceUri)
 
void setInterestTimedOutNo (uint32_t iton)
 
void setLinkCost (double lc)
 
void setName (const ndn::Name &name)
 
void setStatus (Status s)
 
void wireDecode (const ndn::Block &wire)
 
const ndn::Block & wireEncode () const
 
template<ndn::encoding::Tag TAG>
size_t wireEncode (ndn::EncodingImpl< TAG > &block) const
 

Static Public Attributes

static constexpr double DEFAULT_LINK_COST = 10.0
 
static constexpr double NON_ADJACENT_COST = -12345.0
 

Friends

std::ostream & operator<< (std::ostream &os, const Adjacent &adjacent)
 

Detailed Description

A neighbor reachable over a Face.

Represents another node that we expect to be running NLSR that we should be able to reach over a direct Face connection.

Data abstraction for Adjacent Adjacent := ADJACENCY-TYPE TLV-LENGTH Name FaceUri LinkCost AdjacencyStatus AdjacencyInterestTimedOutNo

Definition at line 46 of file adjacent.hpp.

Member Enumeration Documentation

◆ Status

Enumerator
STATUS_UNKNOWN 
STATUS_INACTIVE 
STATUS_ACTIVE 

Definition at line 55 of file adjacent.hpp.

Constructor & Destructor Documentation

◆ Adjacent() [1/4]

nlsr::Adjacent::Adjacent ( )

Definition at line 29 of file adjacent.cpp.

◆ Adjacent() [2/4]

nlsr::Adjacent::Adjacent ( const ndn::Block &  block)

Definition at line 39 of file adjacent.cpp.

◆ Adjacent() [3/4]

nlsr::Adjacent::Adjacent ( const ndn::Name &  an)

Definition at line 44 of file adjacent.cpp.

◆ Adjacent() [4/4]

nlsr::Adjacent::Adjacent ( const ndn::Name &  an,
const ndn::FaceUri &  faceUri,
double  lc,
Status  s,
uint32_t  iton,
uint64_t  faceId 
)

Definition at line 54 of file adjacent.cpp.

Member Function Documentation

◆ compare()

bool nlsr::Adjacent::compare ( const ndn::Name &  adjacencyName) const
inline

Definition at line 158 of file adjacent.hpp.

◆ compareFaceId()

bool nlsr::Adjacent::compareFaceId ( const uint64_t  faceId) const
inline

Definition at line 164 of file adjacent.hpp.

◆ compareFaceUri()

bool nlsr::Adjacent::compareFaceUri ( const ndn::FaceUri &  faceUri) const
inline

Definition at line 170 of file adjacent.hpp.

◆ getFaceId()

uint64_t nlsr::Adjacent::getFaceId ( ) const
inline

Definition at line 139 of file adjacent.hpp.

◆ getFaceUri()

const ndn::FaceUri& nlsr::Adjacent::getFaceUri ( ) const
inline

Definition at line 85 of file adjacent.hpp.

◆ getInterestTimedOutNo()

uint32_t nlsr::Adjacent::getInterestTimedOutNo ( ) const
inline

Definition at line 120 of file adjacent.hpp.

◆ getLinkCost()

double nlsr::Adjacent::getLinkCost ( ) const
inline

Definition at line 98 of file adjacent.hpp.

◆ getName()

const ndn::Name& nlsr::Adjacent::getName ( ) const
inline

Definition at line 72 of file adjacent.hpp.

◆ getStatus()

Status nlsr::Adjacent::getStatus ( ) const
inline

Definition at line 107 of file adjacent.hpp.

◆ operator!=()

bool nlsr::Adjacent::operator!= ( const Adjacent adjacent) const
inline

Definition at line 149 of file adjacent.hpp.

◆ operator<()

bool nlsr::Adjacent::operator< ( const Adjacent adjacent) const

Definition at line 167 of file adjacent.cpp.

◆ operator==()

bool nlsr::Adjacent::operator== ( const Adjacent adjacent) const

Equality is when name, Face URI, and link cost are all equal.

Definition at line 159 of file adjacent.cpp.

◆ setFaceId()

void nlsr::Adjacent::setFaceId ( uint64_t  faceId)
inline

Definition at line 133 of file adjacent.hpp.

◆ setFaceUri()

void nlsr::Adjacent::setFaceUri ( const ndn::FaceUri &  faceUri)
inline

Definition at line 91 of file adjacent.hpp.

◆ setInterestTimedOutNo()

void nlsr::Adjacent::setInterestTimedOutNo ( uint32_t  iton)
inline

Definition at line 126 of file adjacent.hpp.

◆ setLinkCost()

void nlsr::Adjacent::setLinkCost ( double  lc)

Definition at line 66 of file adjacent.cpp.

◆ setName()

void nlsr::Adjacent::setName ( const ndn::Name &  name)
inline

Definition at line 78 of file adjacent.hpp.

◆ setStatus()

void nlsr::Adjacent::setStatus ( Status  s)
inline

Definition at line 113 of file adjacent.hpp.

◆ wireDecode()

void nlsr::Adjacent::wireDecode ( const ndn::Block &  wire)

Definition at line 117 of file adjacent.cpp.

◆ wireEncode() [1/2]

const ndn::Block & nlsr::Adjacent::wireEncode ( ) const

Definition at line 99 of file adjacent.cpp.

◆ wireEncode() [2/2]

template<ndn::encoding::Tag TAG>
size_t nlsr::Adjacent::wireEncode ( ndn::EncodingImpl< TAG > &  block) const

Definition at line 82 of file adjacent.cpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Adjacent adjacent 
)
friend

Definition at line 175 of file adjacent.cpp.

Member Data Documentation

◆ DEFAULT_LINK_COST

constexpr double nlsr::Adjacent::DEFAULT_LINK_COST = 10.0
staticconstexpr

Definition at line 186 of file adjacent.hpp.

◆ NON_ADJACENT_COST

constexpr double nlsr::Adjacent::NON_ADJACENT_COST = -12345.0
staticconstexpr

Definition at line 187 of file adjacent.hpp.