22 #ifndef NLSR_NAME_PREFIX_LIST_HPP 23 #define NLSR_NAME_PREFIX_LIST_HPP 27 #include <boost/cstdint.hpp> 28 #include <ndn-cxx/name.hpp> 35 using NamePair = std::tuple<ndn::Name, std::vector<std::string>>;
45 NamePrefixList(
const std::initializer_list<NamePrefixList::NamePair>& namesAndSources);
47 template<
class ContainerType>
50 for (
const auto& elem : names) {
51 m_names.push_back(
NamePair{elem, {
""}});
62 insert(
const ndn::Name& name,
const std::string& source =
"");
69 remove(
const ndn::Name& name,
const std::string& source =
"");
77 return m_names.size();
98 const std::vector<std::string>
107 std::vector<NamePair>::iterator
108 get(
const ndn::Name& name);
112 std::vector<std::string>::iterator
113 getSource(
const std::string& source, std::vector<NamePair>::iterator& entry);
115 std::vector<NamePair> m_names;
123 #endif // NLSR_NAME_PREFIX_LIST_HPP std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
std::list< ndn::Name > getNames() const
bool operator==(const NamePrefixList &other) const
std::tuple< ndn::Name, std::vector< std::string >> NamePair
bool insert(const ndn::Name &name, const std::string &source="")
inserts name into NamePrefixList
const std::vector< std::string > getSources(const ndn::Name &name) const
NamePrefixList(const ContainerType &names)
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
uint32_t countSources(const ndn::Name &name) const