nlsr::AdjacencyList Class Reference

#include <adjacency-list.hpp>

Public Types

typedef std::list< Adjacent >::const_iterator const_iterator
 
typedef std::list< Adjacent >::iterator iterator
 

Public Member Functions

 AdjacencyList ()
 
 ~AdjacencyList ()
 
int32_t insert (Adjacent &adjacent)
 Inserts an adjacency into the list. More...
 
bool updateAdjacentStatus (const ndn::Name &adjName, Adjacent::Status s)
 Sets the status of an adjacency. More...
 
int32_t updateAdjacentLinkCost (const ndn::Name &adjName, double lc)
 
std::list< Adjacent > & getAdjList ()
 
const std::list< Adjacent > & getAdjList () const
 
bool isNeighbor (const ndn::Name &adjName)
 
void incrementTimedOutInterestCount (const ndn::Name &neighbor)
 
int32_t getTimedOutInterestCount (const ndn::Name &neighbor)
 
Adjacent::Status getStatusOfNeighbor (const ndn::Name &neighbor)
 
void setStatusOfNeighbor (const ndn::Name &neighbor, Adjacent::Status status)
 
void setTimedOutInterestCount (const ndn::Name &neighbor, uint32_t count)
 
void addAdjacents (AdjacencyList &adl)
 Copies the adjacencies in a list to this one. More...
 
bool isAdjLsaBuildable (const uint32_t interestRetryNo) const
 Determines whether this list can be used to build an adj. LSA. More...
 
int32_t getNumOfActiveNeighbor ()
 
Adjacent getAdjacent (const ndn::Name &adjName)
 
bool operator== (AdjacencyList &adl) const
 
size_t size () const
 
void reset ()
 
AdjacencyList::iterator findAdjacent (const ndn::Name &adjName)
 
AdjacencyList::iterator findAdjacent (uint64_t faceId)
 
AdjacencyList::iterator findAdjacent (const ndn::FaceUri &faceUri)
 
template<typename T = float>
void findAdjacent (const std::string &faceUri)
 Hack to stop developers from using this function. More...
 
uint64_t getFaceId (const ndn::FaceUri &faceUri)
 
void writeLog ()
 
const_iterator begin () const
 
const_iterator end () const
 

Detailed Description

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

Member Typedef Documentation

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

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

Constructor & Destructor Documentation

nlsr::AdjacencyList::AdjacencyList ( )

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

nlsr::AdjacencyList::~AdjacencyList ( )

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

Member Function Documentation

void nlsr::AdjacencyList::addAdjacents ( AdjacencyList adl)

Copies the adjacencies in a list to this one.

Parameters
adlThe adjacency list, the entries of which we want to copy into this object.

Copies the entries contained in one list into this object.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

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

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

template<typename T = float>
void nlsr::AdjacencyList::findAdjacent ( const std::string &  faceUri)
inline

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

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

Here is the call graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t nlsr::AdjacencyList::getNumOfActiveNeighbor ( )

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

int32_t nlsr::AdjacencyList::insert ( Adjacent adjacent)

Inserts an adjacency into the list.

Parameters
adjacentThe adjacency that we want to add to this list.
Return values
0Indicates success.
1Indicates failure.

This function attempts to insert the supplied adjacency into this object, which is an adjacency list.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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 205 of file adjacency-list.cpp.

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

void nlsr::AdjacencyList::reset ( )
inline

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

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

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

Here is the caller graph for this function:

int32_t nlsr::AdjacencyList::updateAdjacentLinkCost ( const ndn::Name &  adjName,
double  lc 
)

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

bool nlsr::AdjacencyList::updateAdjacentStatus ( const ndn::Name &  adjName,
Adjacent::Status  s 
)

Sets the status of an adjacency.

Parameters
adjNameThe adjacency in this list you want to change the status of.
sThe status to change to.
Returns
A boolean indicating whether an adjacency was updated. This is false if s is not in the list.

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

void nlsr::AdjacencyList::writeLog ( )

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

Here is the caller graph for this function: