27 #include <boost/multi_index_container.hpp>
28 #include <boost/multi_index/hashed_index.hpp>
29 #include <boost/multi_index/member.hpp>
30 #include <boost/multi_index/tag.hpp>
44 using namespace boost::multi_index;
51 hashed_unique<tag<byRouterName>,
52 member<MapEntry, ndn::Name, &MapEntry::router>,
53 std::hash<ndn::Name>>,
54 hashed_unique<tag<byMappingNumber>,
55 member<MapEntry, int32_t, &MapEntry::mappingNumber>>
76 addEntry(
const ndn::Name& rtrName);
82 template<
typename IteratorType>
87 for (
auto lsa = begin; lsa != end; lsa++) {
88 auto adjLsa = std::static_pointer_cast<AdjLsa>(*lsa);
89 addEntry(adjLsa->getOriginRouter());
90 for (
const auto& adjacent : adjLsa->getAdl().getAdjList()) {
91 addEntry(adjacent.getName());
100 template<
typename IteratorType>
105 for (
auto lsa = begin; lsa != end; lsa++) {
106 addEntry((*lsa)->getOriginRouter());
110 std::optional<ndn::Name>
111 getRouterNameByMappingNo(int32_t mn)
const;
113 std::optional<int32_t>
114 getMappingNoByRouterName(
const ndn::Name& rName);
119 return m_entries.size();
129 int32_t m_mappingIndex;
void createFromAdjLsdb(IteratorType begin, IteratorType end)
size_t getMapSize() const
void createFromCoordinateLsdb(IteratorType begin, IteratorType end)
multi_index_container< MapEntry, indexed_by< hashed_unique< tag< byRouterName >, member< MapEntry, ndn::Name, &MapEntry::router >, std::hash< ndn::Name > >, hashed_unique< tag< byMappingNumber >, member< MapEntry, int32_t, &MapEntry::mappingNumber > > > > entryContainer
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.