nlsr::AdjacencyList Class Reference

#include <adjacency-list.hpp>

Public Types

using const_iterator = std::list< Adjacent >::const_iterator
 
using iterator = std::list< Adjacent >::iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
AdjacencyList::iterator findAdjacent (const ndn::FaceUri &faceUri)
 
AdjacencyList::iterator findAdjacent (const ndn::Name &adjName)
 
void findAdjacent (const std::string &)=delete
 Hack to stop developers from using this function. More...
 
AdjacencyList::iterator findAdjacent (uint64_t faceId)
 
Adjacent getAdjacent (const ndn::Name &adjName)
 
std::list< Adjacent > & getAdjList ()
 
const std::list< Adjacent > & getAdjList () const
 
uint64_t getFaceId (const ndn::FaceUri &faceUri)
 
int32_t getNumOfActiveNeighbor () const
 
Adjacent::Status getStatusOfNeighbor (const ndn::Name &neighbor) const
 
int32_t getTimedOutInterestCount (const ndn::Name &neighbor) const
 
void incrementTimedOutInterestCount (const ndn::Name &neighbor)
 
bool insert (const Adjacent &adjacent)
 
bool isAdjLsaBuildable (const uint32_t interestRetryNo) const
 Determines whether this list can be used to build an adj. LSA. More...
 
bool isNeighbor (const ndn::Name &adjName) const
 
bool operator== (const AdjacencyList &adl) const
 
void reset ()
 
void setStatusOfNeighbor (const ndn::Name &neighbor, Adjacent::Status status)
 
void setTimedOutInterestCount (const ndn::Name &neighbor, uint32_t count)
 
size_t size () const
 
void writeLog ()
 

Detailed Description

Definition at line 32 of file adjacency-list.hpp.

Member Typedef Documentation

◆ const_iterator

Definition at line 35 of file adjacency-list.hpp.

◆ iterator

Definition at line 36 of file adjacency-list.hpp.

Member Function Documentation

◆ begin()

const_iterator nlsr::AdjacencyList::begin ( ) const
inline

Definition at line 130 of file adjacency-list.hpp.

◆ end()

const_iterator nlsr::AdjacencyList::end ( ) const
inline

Definition at line 136 of file adjacency-list.hpp.

◆ findAdjacent() [1/4]

AdjacencyList::iterator nlsr::AdjacencyList::findAdjacent ( const ndn::FaceUri &  faceUri)

Definition at line 212 of file adjacency-list.cpp.

◆ findAdjacent() [2/4]

AdjacencyList::iterator nlsr::AdjacencyList::findAdjacent ( const ndn::Name &  adjName)

Definition at line 194 of file adjacency-list.cpp.

◆ findAdjacent() [3/4]

void nlsr::AdjacencyList::findAdjacent ( const std::string &  )
delete

Hack to stop developers from using this function.

It is here so that faceUri cannot be passed in as string, converted to Name and findAdjacent(Name) be used. So when faceUri is passed as string this will cause a compile error

◆ findAdjacent() [4/4]

AdjacencyList::iterator nlsr::AdjacencyList::findAdjacent ( uint64_t  faceId)

Definition at line 203 of file adjacency-list.cpp.

◆ getAdjacent()

Adjacent nlsr::AdjacencyList::getAdjacent ( const ndn::Name &  adjName)

Definition at line 43 of file adjacency-list.cpp.

◆ getAdjList() [1/2]

std::list< Adjacent > & nlsr::AdjacencyList::getAdjList ( )

Definition at line 131 of file adjacency-list.cpp.

◆ getAdjList() [2/2]

const std::list< Adjacent > & nlsr::AdjacencyList::getAdjList ( ) const

Definition at line 137 of file adjacency-list.cpp.

◆ getFaceId()

uint64_t nlsr::AdjacencyList::getFaceId ( const ndn::FaceUri &  faceUri)

Definition at line 221 of file adjacency-list.cpp.

◆ getNumOfActiveNeighbor()

int32_t nlsr::AdjacencyList::getNumOfActiveNeighbor ( ) const

Definition at line 166 of file adjacency-list.cpp.

◆ getStatusOfNeighbor()

Adjacent::Status nlsr::AdjacencyList::getStatusOfNeighbor ( const ndn::Name &  neighbor) const

Definition at line 109 of file adjacency-list.cpp.

◆ getTimedOutInterestCount()

int32_t nlsr::AdjacencyList::getTimedOutInterestCount ( const ndn::Name &  neighbor) const

Definition at line 99 of file adjacency-list.cpp.

◆ incrementTimedOutInterestCount()

void nlsr::AdjacencyList::incrementTimedOutInterestCount ( const ndn::Name &  neighbor)

Definition at line 79 of file adjacency-list.cpp.

◆ insert()

bool nlsr::AdjacencyList::insert ( const Adjacent adjacent)

Definition at line 32 of file adjacency-list.cpp.

◆ isAdjLsaBuildable()

bool nlsr::AdjacencyList::isAdjLsaBuildable ( const uint32_t  interestRetryNo) const

Determines whether this list can be used to build an adj. LSA.

Parameters
interestRetryNoThe maximum number of hello-interest retries to contact a neighbor.
Returns
Returns a boolean indicating whether this list can be used to build an adj. LSA.

Determines whether this adjacency list object could be used to build an adjacency LSA. An LSA is buildable when the status of all neighbors is known. A neighbor's status is known when their status is ACTIVE, or INACTIVE and some number of hello interests (specified by nlsr::ConfParameter::getInterestRetryNumber()) have failed. To be explicit, a neighbor's status is unknown if we are still sending hello interests.

Definition at line 143 of file adjacency-list.cpp.

◆ isNeighbor()

bool nlsr::AdjacencyList::isNeighbor ( const ndn::Name &  adjName) const

Definition at line 68 of file adjacency-list.cpp.

◆ operator==()

bool nlsr::AdjacencyList::operator== ( const AdjacencyList adl) const

Definition at line 54 of file adjacency-list.cpp.

◆ reset()

void nlsr::AdjacencyList::reset ( )
inline

Definition at line 99 of file adjacency-list.hpp.

◆ setStatusOfNeighbor()

void nlsr::AdjacencyList::setStatusOfNeighbor ( const ndn::Name &  neighbor,
Adjacent::Status  status 
)

Definition at line 122 of file adjacency-list.cpp.

◆ setTimedOutInterestCount()

void nlsr::AdjacencyList::setTimedOutInterestCount ( const ndn::Name &  neighbor,
uint32_t  count 
)

Definition at line 89 of file adjacency-list.cpp.

◆ size()

size_t nlsr::AdjacencyList::size ( ) const
inline

Definition at line 93 of file adjacency-list.hpp.

◆ writeLog()

void nlsr::AdjacencyList::writeLog ( )

Definition at line 232 of file adjacency-list.cpp.