Actions
Task #2346
closedConstruct LSA data strings using std::ostringstream
Start date:
01/05/2015
Due date:
% Done:
0%
Estimated time:
Description
Currently, the getData() methods for the three LSA types return a string representation of their data constructed using multiple casts and helper methods:
string adjLsaData;
adjLsaData = m_origRouter.toUri() + "|" + "adjacency" + "|"
+ boost::lexical_cast<std::string>(m_lsSeqNo) + "|"
+ ndn::time::toIsoString(m_expirationTimePoint);
adjLsaData += "|";
adjLsaData += boost::lexical_cast<std::string>(m_adl.getSize());
std::list<Adjacent> al = m_adl.getAdjList();
for (std::list<Adjacent>::iterator it = al.begin(); it != al.end(); it++) {
adjLsaData += "|";
adjLsaData += (*it).getName().toUri();
adjLsaData += "|";
adjLsaData += (*it).getConnectingFaceUri();
adjLsaData += "|";
adjLsaData += boost::lexical_cast<std::string>((*it).getLinkCost());
}
return adjLsaData + "|";
Instead, LSA data strings should be constructed using std::ostringstream:
std::ostringstream os;
os << m_origRouter << "|" << "adjacency" << "|"
<< m_lsSeqNo << "|" << m_expirationTimePoint ...
...
return os.str();
Updated by Nicholas Gordon over 7 years ago
- Status changed from New to In Progress
- Assignee set to Nicholas Gordon
- Target version set to v0.4.0
Updated by Nicholas Gordon over 7 years ago
- Status changed from In Progress to Code review
Updated by Nicholas Gordon over 7 years ago
- Status changed from Code review to Closed
Actions