lsdb: emit signals when modified
RoutingTable and NamePrefixTable consume the signal
and behave accordingly.
refs: #4127
Change-Id: I6540f30f0222f804b01dc7d9640831c84e5264cc
diff --git a/src/lsa/adj-lsa.cpp b/src/lsa/adj-lsa.cpp
index 781422c..3d49533 100644
--- a/src/lsa/adj-lsa.cpp
+++ b/src/lsa/adj-lsa.cpp
@@ -124,7 +124,7 @@
AdjLsa::toString() const
{
std::ostringstream os;
- os << Lsa::toString();
+ os << getString();
os << " Adjacent(s):\n";
int adjacencyIndex = 0;
@@ -139,6 +139,20 @@
return os.str();
}
+std::tuple<bool, std::list<ndn::Name>, std::list<ndn::Name>>
+AdjLsa::update(const std::shared_ptr<Lsa>& lsa)
+{
+ auto alsa = std::static_pointer_cast<AdjLsa>(lsa);
+ if (!isEqualContent(*alsa)) {
+ resetAdl();
+ for (const auto& adjacent : alsa->getAdl()) {
+ addAdjacent(adjacent);
+ }
+ return std::make_tuple(true, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+ }
+ return std::make_tuple(false, std::list<ndn::Name>{}, std::list<ndn::Name>{});
+}
+
std::ostream&
operator<<(std::ostream& os, const AdjLsa& lsa)
{