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)
 
template<ndn::encoding::Tag TAG>
size_t wireEncode (ndn::EncodingImpl< TAG > &block) const
 
const ndn::Block & wireEncode () const
 

Static Public Attributes

static const double DEFAULT_LINK_COST = 10.0
 
static const double NON_ADJACENT_COST = -12345
 

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 59 of file adjacent.hpp.

Constructor & Destructor Documentation

◆ Adjacent() [1/4]

nlsr::Adjacent::Adjacent ( )

Definition at line 32 of file adjacent.cpp.

◆ Adjacent() [2/4]

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

Definition at line 42 of file adjacent.cpp.

+ Here is the call graph for this function:

◆ Adjacent() [3/4]

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

Definition at line 47 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 57 of file adjacent.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ compare()

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

Definition at line 162 of file adjacent.hpp.

+ Here is the caller graph for this function:

◆ compareFaceId()

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

Definition at line 168 of file adjacent.hpp.

+ Here is the caller graph for this function:

◆ compareFaceUri()

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

Definition at line 174 of file adjacent.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFaceId()

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

Definition at line 143 of file adjacent.hpp.

+ Here is the call graph for this function:

◆ getFaceUri()

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

Definition at line 89 of file adjacent.hpp.

+ Here is the caller graph for this function:

◆ getInterestTimedOutNo()

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

Definition at line 124 of file adjacent.hpp.

◆ getLinkCost()

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

Definition at line 102 of file adjacent.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getName()

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

Definition at line 76 of file adjacent.hpp.

+ Here is the caller graph for this function:

◆ getStatus()

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

Definition at line 111 of file adjacent.hpp.

◆ operator!=()

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

Definition at line 153 of file adjacent.hpp.

+ Here is the call graph for this function:

◆ operator<()

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

Definition at line 173 of file adjacent.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator==()

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

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

Definition at line 164 of file adjacent.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFaceId()

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

Definition at line 137 of file adjacent.hpp.

◆ setFaceUri()

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

Definition at line 95 of file adjacent.hpp.

◆ setInterestTimedOutNo()

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

Definition at line 130 of file adjacent.hpp.

◆ setLinkCost()

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

Definition at line 69 of file adjacent.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

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

Definition at line 82 of file adjacent.hpp.

◆ setStatus()

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

Definition at line 117 of file adjacent.hpp.

◆ wireDecode()

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

Definition at line 121 of file adjacent.cpp.

+ Here is the caller graph for this function:

◆ wireEncode() [1/2]

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

Definition at line 86 of file adjacent.cpp.

◆ wireEncode() [2/2]

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

Definition at line 103 of file adjacent.cpp.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 181 of file adjacent.cpp.

Member Data Documentation

◆ DEFAULT_LINK_COST

const double nlsr::Adjacent::DEFAULT_LINK_COST = 10.0
static

Definition at line 190 of file adjacent.hpp.

◆ NON_ADJACENT_COST

const double nlsr::Adjacent::NON_ADJACENT_COST = -12345
static

Definition at line 191 of file adjacent.hpp.