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/adj-lsa.hpp b/src/lsa/adj-lsa.hpp
index 133e95c..8c6354d 100644
--- a/src/lsa/adj-lsa.hpp
+++ b/src/lsa/adj-lsa.hpp
@@ -30,23 +30,27 @@
namespace nlsr {
-/*!
- \brief Data abstraction for AdjLsa
- AdjacencyLsa := ADJACENCY-LSA-TYPE TLV-LENGTH
- Lsa
- Adjacency*
-
+/**
+ * @brief Represents an LSA of adjacencies of the origin router in link-state mode.
+ *
+ * AdjLsa is encoded as:
+ * @code{.abnf}
+ * AdjLsa = ADJACENCY-LSA-TYPE TLV-LENGTH
+ * Lsa
+ * *Adjacency
+ * @endcode
*/
class AdjLsa : public Lsa, private boost::equality_comparable<AdjLsa>
{
public:
- typedef AdjacencyList::const_iterator const_iterator;
+ using const_iterator = AdjacencyList::const_iterator;
AdjLsa() = default;
AdjLsa(const ndn::Name& originR, uint64_t seqNo,
const ndn::time::system_clock::time_point& timepoint, AdjacencyList& adl);
+ explicit
AdjLsa(const ndn::Block& block);
Lsa::Type
@@ -103,12 +107,13 @@
void
wireDecode(const ndn::Block& wire);
- std::string
- toString() const override;
-
std::tuple<bool, std::list<ndn::Name>, std::list<ndn::Name>>
update(const std::shared_ptr<Lsa>& lsa) override;
+private:
+ void
+ print(std::ostream& os) const override;
+
private: // non-member operators
// NOTE: the following "hidden friend" operators are available via
// argument-dependent lookup only and must be defined inline.
@@ -126,9 +131,6 @@
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(AdjLsa);
-std::ostream&
-operator<<(std::ostream& os, const AdjLsa& lsa);
-
} // namespace nlsr
#endif // NLSR_LSA_ADJ_LSA_HPP