nlsr::LinkStateRoutingTableCalculator Class Reference

#include <routing-table-calculator.hpp>

Inheritance diagram for nlsr::LinkStateRoutingTableCalculator:
[legend]
Collaboration diagram for nlsr::LinkStateRoutingTableCalculator:
[legend]

Public Member Functions

 LinkStateRoutingTableCalculator (size_t nRouters)
 
void calculatePath (Map &pMap, RoutingTable &rt, ConfParameter &confParam, const std::list< AdjLsa > &adjLsaList)
 

Protected Member Functions

void allocateAdjMatrix ()
 Allocate the space needed for the adj. matrix. More...
 
void initMatrix ()
 set NON_ADJACENT_COST i.e. -12345 to every cell of the matrix to ensure that the memory is safe. This is also to incorporate zero cost links More...
 
void makeAdjMatrix (const std::list< AdjLsa > &adjLsaList, Map &pMap)
 Constructs an adj. matrix to calculate with. More...
 
void writeAdjMatrixLog (const Map &map) const
 Writes a formated adjacent matrix to DEBUG log. More...
 
int getNumOfLinkfromAdjMatrix (int sRouter)
 Returns how many links a router in the matrix has. More...
 
void freeAdjMatrix ()
 
void adjustAdMatrix (int source, int link, double linkCost)
 Adjust a link cost in the adj. matrix. More...
 
void getLinksFromAdjMatrix (int *links, double *linkCosts, int source)
 Populates temp. variables with the link costs for some router. More...
 
void allocateLinks ()
 
void allocateLinkCosts ()
 
void freeLinks ()
 
void freeLinksCosts ()
 
void setNoLink (int nl)
 

Protected Attributes

double ** adjMatrix
 
size_t m_nRouters
 
int vNoLink
 
int * links
 
double * linkCosts
 

Detailed Description

Definition at line 130 of file routing-table-calculator.hpp.

Constructor & Destructor Documentation

nlsr::LinkStateRoutingTableCalculator::LinkStateRoutingTableCalculator ( size_t  nRouters)
inline

Definition at line 133 of file routing-table-calculator.hpp.

Member Function Documentation

void nlsr::RoutingTableCalculator::adjustAdMatrix ( int  source,
int  link,
double  linkCost 
)
protectedinherited

Adjust a link cost in the adj. matrix.

Parameters
sourceThe source router whose adjacency to adjust.
linkThe adjacency of the source to adjust.
linkCostThe cost to change to.

Definition at line 154 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateAdjMatrix ( )
protectedinherited

Allocate the space needed for the adj. matrix.

Definition at line 45 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateLinkCosts ( )
protectedinherited

Definition at line 211 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::allocateLinks ( )
protectedinherited

Allocates an array large enough to hold multipath calculation temps.

Definition at line 205 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::LinkStateRoutingTableCalculator::calculatePath ( Map pMap,
RoutingTable rt,
ConfParameter confParam,
const std::list< AdjLsa > &  adjLsaList 
)

Definition at line 229 of file routing-table-calculator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeAdjMatrix ( )
protectedinherited

Definition at line 196 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeLinks ( )
protectedinherited

Definition at line 218 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::freeLinksCosts ( )
protectedinherited

Definition at line 223 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::getLinksFromAdjMatrix ( int *  links,
double *  linkCosts,
int  source 
)
protectedinherited

Populates temp. variables with the link costs for some router.

Parameters
sourceThe router whose values are to be adjusted.
linksAn integer pointer array for the link mappingNos.
linkCostsA double pointer array that stores the link costs.

Obtains a sparse list of adjacencies and link costs for some router. Since this is sparse, that means while generating these arrays, if there is no adjacency at i in the matrix, these temporary variables will not contain a NON_ADJACENT_COST (-12345) at i, but rather will contain the values for the next valid adjacency.

Definition at line 181 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

int nlsr::RoutingTableCalculator::getNumOfLinkfromAdjMatrix ( int  sRouter)
protectedinherited

Returns how many links a router in the matrix has.

Parameters
sRouterThe router to count the links of.

Definition at line 168 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::initMatrix ( )
protectedinherited

set NON_ADJACENT_COST i.e. -12345 to every cell of the matrix to ensure that the memory is safe. This is also to incorporate zero cost links

Definition at line 55 of file routing-table-calculator.cpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::makeAdjMatrix ( const std::list< AdjLsa > &  adjLsaList,
Map pMap 
)
protectedinherited

Constructs an adj. matrix to calculate with.

Parameters
adjLsaListThe Adjacency Lsa list.
pMapThe map to populate with the adj. data.

Definition at line 65 of file routing-table-calculator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::setNoLink ( int  nl)
inlineprotectedinherited

Definition at line 115 of file routing-table-calculator.hpp.

Here is the caller graph for this function:

void nlsr::RoutingTableCalculator::writeAdjMatrixLog ( const Map map) const
protectedinherited

Writes a formated adjacent matrix to DEBUG log.

Parameters
mapThe map containing adjacent matrix data

Definition at line 121 of file routing-table-calculator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Field Documentation

double** nlsr::RoutingTableCalculator::adjMatrix
protectedinherited

Definition at line 121 of file routing-table-calculator.hpp.

double* nlsr::RoutingTableCalculator::linkCosts
protectedinherited

Definition at line 126 of file routing-table-calculator.hpp.

int* nlsr::RoutingTableCalculator::links
protectedinherited

Definition at line 125 of file routing-table-calculator.hpp.

size_t nlsr::RoutingTableCalculator::m_nRouters
protectedinherited

Definition at line 122 of file routing-table-calculator.hpp.

int nlsr::RoutingTableCalculator::vNoLink
protectedinherited

Definition at line 124 of file routing-table-calculator.hpp.