22 #ifndef NLSR_NAME_PREFIX_LIST_HPP
23 #define NLSR_NAME_PREFIX_LIST_HPP
29 #include <ndn-cxx/name.hpp>
36 using NamePair = std::tuple<ndn::Name, std::vector<std::string>>;
46 NamePrefixList(
const std::initializer_list<NamePrefixList::NamePair>& namesAndSources);
49 template<
class ContainerType>
52 for (
const auto& elem : names) {
53 m_names.push_back(
NamePair{elem, {
""}});
65 insert(
const ndn::Name& name,
const std::string& source =
"");
72 remove(
const ndn::Name& name,
const std::string& source =
"");
80 return m_names.size();
101 const std::vector<std::string>
116 std::vector<NamePair>::iterator
117 get(
const ndn::Name& name);
121 std::vector<std::string>::iterator
122 getSource(
const std::string& source, std::vector<NamePair>::iterator& entry);
124 std::vector<NamePair> m_names;
128 operator<<(std::ostream& os,
const NamePrefixList& list);
bool operator==(const NamePrefixList &other) const
bool remove(const ndn::Name &name, const std::string &source="")
removes name from NamePrefixList
bool insert(const ndn::Name &name, const std::string &source="")
inserts name into NamePrefixList
std::tuple< ndn::Name, std::vector< std::string > > NamePair
uint32_t countSources(const ndn::Name &name) const
std::list< ndn::Name > getNames() const
const std::vector< std::string > getSources(const ndn::Name &name) const
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California,...
std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE