lsa: cleanup operator<<
Delete .toString() virtual function in favor of ostream output.
Delete Lsa::getOriginRouterCopy() in favor of a custom Boost.Multi-Index
key extractor.
Mark single-parameter constructor as 'explicit'.
Rewrite class-level Doxygen with ABNF syntax.
refs #5308
Change-Id: I3c43395ce86f9a1a52da186fcf8c5a15cf35fe40
diff --git a/tools/nlsrc.cpp b/tools/nlsrc.cpp
index 4b16aaa..32a008c 100644
--- a/tools/nlsrc.cpp
+++ b/tools/nlsrc.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, The University of Memphis,
+ * Copyright (c) 2014-2024, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
@@ -343,15 +343,16 @@
Nlsrc::recordLsa(const nlsr::Lsa& lsa)
{
Router& router = m_routers.emplace(lsa.getOriginRouter(), Router()).first->second;
+ auto lsaString = boost::lexical_cast<std::string>(lsa);
if (lsa.getType() == nlsr::Lsa::Type::ADJACENCY) {
- router.adjacencyLsaString = lsa.toString();
+ router.adjacencyLsaString = lsaString;
}
else if (lsa.getType() == nlsr::Lsa::Type::COORDINATE) {
- router.coordinateLsaString = lsa.toString();
+ router.coordinateLsaString = lsaString;
}
else if (lsa.getType() == nlsr::Lsa::Type::NAME) {
- router.nameLsaString = lsa.toString();
+ router.nameLsaString = lsaString;
}
}