publisher: simplified LSDB dataset interest handler.
refs: #4235
Change-Id: Ia3f606947884304e8b01211b5887ad62488f7167
diff --git a/src/publisher/lsdb-dataset-interest-handler.hpp b/src/publisher/lsdb-dataset-interest-handler.hpp
index b92a72f..e01a5da 100644
--- a/src/publisher/lsdb-dataset-interest-handler.hpp
+++ b/src/publisher/lsdb-dataset-interest-handler.hpp
@@ -22,10 +22,10 @@
#ifndef NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP
#define NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP
-#include "lsa-publisher.hpp"
#include "tlv/adjacency-lsa.hpp"
#include "tlv/coordinate-lsa.hpp"
#include "tlv/name-lsa.hpp"
+#include "lsdb.hpp"
#include <ndn-cxx/mgmt/dispatcher.hpp>
#include <ndn-cxx/face.hpp>
@@ -33,6 +33,12 @@
namespace nlsr {
+namespace dataset {
+ const ndn::Name::Component ADJACENCY_COMPONENT = ndn::Name::Component{"adjacencies"};
+ const ndn::Name::Component NAME_COMPONENT = ndn::Name::Component{"names"};
+ const ndn::Name::Component COORDINATE_COMPONENT = ndn::Name::Component{"coordinates"};
+} // namespace dataset
+
/*!
\brief Class to publish all lsa dataset
\sa https://redmine.named-data.net/projects/nlsr/wiki/LSDB_DataSet
@@ -100,20 +106,25 @@
ndn::mgmt::StatusDatasetContext& context);
private:
+ const Lsdb& m_lsdb;
ndn::Name m_routerNamePrefix;
ndn::mgmt::Dispatcher& m_localhostDispatcher;
ndn::mgmt::Dispatcher& m_routerNameDispatcher;
-
- AdjacencyLsaPublisher m_adjacencyLsaPublisher;
- CoordinateLsaPublisher m_coordinateLsaPublisher;
- NameLsaPublisher m_nameLsaPublisher;
-
- const std::list<AdjLsa>& m_adjacencyLsas;
- const std::list<CoordinateLsa>& m_coordinateLsas;
- const std::list<NameLsa>& m_nameLsas;
};
+template<typename T> std::list<T>
+getTlvLsas(const Lsdb& lsdb);
+
+template<> std::list<tlv::AdjacencyLsa>
+getTlvLsas<tlv::AdjacencyLsa>(const Lsdb& lsdb);
+
+template<> std::list<tlv::CoordinateLsa>
+getTlvLsas<tlv::CoordinateLsa>(const Lsdb& lsdb);
+
+template<> std::list<tlv::NameLsa>
+getTlvLsas<tlv::NameLsa>(const Lsdb& lsdb);
+
} // namespace nlsr
#endif // NLSR_PUBLISHER_LSDB_DATASET_INTEREST_HANDLER_HPP