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>
41 using namespace boost::multi_index;
48 hashed_unique<tag<byRouterName>,
49 member<MapEntry, ndn::Name, &MapEntry::router>,
50 std::hash<ndn::Name>>,
51 hashed_unique<tag<byMappingNumber>,
52 member<MapEntry, int32_t, &MapEntry::mappingNumber>>
73 addEntry(
const ndn::Name& rtrName);
79 template<
typename IteratorType>
84 for (
auto lsa = begin; lsa != end; lsa++) {
85 auto adjLsa = std::static_pointer_cast<AdjLsa>(*lsa);
86 addEntry(adjLsa->getOriginRouter());
87 for (
const auto& adjacent : adjLsa->getAdl().getAdjList()) {
88 addEntry(adjacent.getName());
97 template<
typename IteratorType>
102 for (
auto lsa = begin; lsa != end; lsa++) {
103 addEntry((*lsa)->getOriginRouter());
107 ndn::optional<ndn::Name>
108 getRouterNameByMappingNo(int32_t mn)
const;
110 ndn::optional<int32_t>
111 getMappingNoByRouterName(
const ndn::Name& rName);
116 return m_entries.size();
126 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,...