Actions
Task #2310
closedLSA string literals should be replaced with static variables
Start date:
12/18/2014
Due date:
% Done:
100%
Estimated time:
Description
There are many places in the code where LSA types are set or compared using string literals:
In lsdb.cpp:
if (interestedLsType == "name") {
processInterestForNameLsa(interest, originRouter.append(interestedLsType), seqNo);
}
else if (interestedLsType == "adjacency") {
processInterestForAdjacencyLsa(interest, originRouter.append(interestedLsType), seqNo);
}
else if (interestedLsType == "coordinate") {
processInterestForCoordinateLsa(interest, originRouter.append(interestedLsType), seqNo);
}
Code like this is prone to typos that cannot be caught by the compiler.
Instead, LSA types should be static member variables of their respective class and these static variables should be used in the
code in place of string literals.
Actions