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/src/lsa/name-lsa.cpp b/src/lsa/name-lsa.cpp
index ce743a3..7867b68 100644
--- a/src/lsa/name-lsa.cpp
+++ b/src/lsa/name-lsa.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.
*
@@ -112,18 +112,14 @@
m_npl = npl;
}
-std::string
-NameLsa::toString() const
+void
+NameLsa::print(std::ostream& os) const
{
- std::ostringstream os;
- os << getString();
os << " Names:\n";
int i = 0;
for (const auto& name : m_npl.getNames()) {
os << " Name " << i++ << ": " << name << "\n";
}
-
- return os.str();
}
std::tuple<bool, std::list<ndn::Name>, std::list<ndn::Name>>
@@ -156,10 +152,4 @@
return {updated, namesToAdd, namesToRemove};
}
-std::ostream&
-operator<<(std::ostream& os, const NameLsa& lsa)
-{
- return os << lsa.toString();
-}
-
} // namespace nlsr